<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.qianwen.mdc.mapper.MachineMaintainMapper">
|
<resultMap id="BaseResultMap" type="com.qianwen.mdc.domain.maintain.MachineMaintain">
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
<result column="machine_id" jdbcType="INTEGER" property="machineId" />
|
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
<result column="machine_account_id" jdbcType="INTEGER" property="machineAccountId" />
|
<result column="style" jdbcType="INTEGER" property="style" />
|
<result column="period" jdbcType="VARCHAR" property="period" />
|
<result column="start_date_from" jdbcType="TIMESTAMP" property="startDateFrom" />
|
<result column="start_date_to" jdbcType="TIMESTAMP" property="startDateTo" />
|
<result column="complete_date_from" jdbcType="TIMESTAMP" property="completeDateFrom" />
|
<result column="complete_date_to" jdbcType="TIMESTAMP" property="completeDateTo" />
|
<result column="is_qualified" jdbcType="BIT" property="isQualified" />
|
<result column="status" jdbcType="VARCHAR" property="status" />
|
<result column="detail" jdbcType="VARCHAR" property="detail" />
|
<result column="department" jdbcType="INTEGER" property="department" />
|
</resultMap>
|
|
<resultMap id="FullResultMap" type="com.qianwen.mdc.dto.MachineMaintainFullDTO">
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
<result column="machine_id" jdbcType="INTEGER" property="machineId" />
|
<result column="machine_name" jdbcType="VARCHAR" property="machineName" />
|
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
<result column="user_name" jdbcType="VARCHAR" property="userName" />
|
<result column="machine_account_id" jdbcType="INTEGER" property="machineAccountId" />
|
<result column="style" jdbcType="INTEGER" property="style" />
|
<result column="uuid" jdbcType="VARCHAR" property="uuid" />
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
<result column="period" jdbcType="VARCHAR" property="period" />
|
<result column="start_date_from" jdbcType="TIMESTAMP" property="startDateFrom" />
|
<result column="start_date_to" jdbcType="TIMESTAMP" property="startDateTo" />
|
<result column="complete_date_from" jdbcType="TIMESTAMP" property="completeDateFrom" />
|
<result column="complete_date_to" jdbcType="TIMESTAMP" property="completeDateTo" />
|
<result column="is_qualified" jdbcType="BIT" property="isQualified" />
|
<result column="status" jdbcType="VARCHAR" property="status" />
|
<result column="detail" jdbcType="VARCHAR" property="detail" />
|
<result column="department" jdbcType="VARCHAR" property="department" />
|
<result column="department_name" jdbcType="VARCHAR" property="departmentName" />
|
<result column="specification" jdbcType="VARCHAR" property="specification" />
|
|
</resultMap>
|
|
<select id="queryPage" resultMap="FullResultMap">
|
SELECT mm.id,mm.machine_id,ma.machine_name,mm.user_id,u.name user_name,style,mm.department,ud.name department_name,ma.uuid,ma.type,
|
ma.specification,
|
start_date_from,start_date_to,complete_date_from,complete_date_to,is_qualified,mm.status,mm.detail
|
FROM machine_maintain mm left join machine m on mm.machine_id=m.id left join sys_account u on mm.user_id=u.id
|
left join machine_account ma on m.id=ma.machine_id
|
left join use_department ud on mm.department=ud.id
|
<where>
|
<if test="dto.uuid != null and dto.uuid != ''">
|
<bind name="uuid" value="'%' + dto.uuid + '%'" />
|
and ma.uuid like #{uuid}
|
</if>
|
<if test="dto.type != null and dto.type != ''">
|
<bind name="type" value="'%' + dto.type + '%'" />
|
and ma.type like #{type}
|
</if>
|
<if test="dto.style != null">
|
and mm.style=#{dto.style}
|
</if>
|
<if test="dto.department != null">
|
and mm.department=#{dto.department}
|
</if>
|
<if test="dto.machineId != null">
|
and mm.machine_id=#{dto.machineId}
|
</if>
|
<if test="dto.isQualified != null">
|
and mm.is_qualified=#{dto.isQualified}
|
</if>
|
|
<if test="dto.startDateFrom != null">
|
and (mm.start_date_from>=#{dto.startDateFrom} or mm.start_date_to <=#{dto.startDateFrom})
|
</if>
|
<if test="dto.startDateTo != null">
|
and mm.start_date_to<=#{dto.startDateTo}
|
</if>
|
<if test="dto.completeDateFrom != null">
|
and (mm.complete_date_from>=#{dto.completeDateFrom} or mm.complete_date_to <=#{dto.completeDateFrom})
|
</if>
|
<if test="dto.completeDateTo != null">
|
and mm.complete_date_to<=#{dto.completeDateTo}
|
</if>
|
</where>
|
</select>
|
</mapper>
|