You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-wms-java/src/main/resources/mybatis/mapper/inv/DeviceInspectTaskMapper.xml

99 lines
3.9 KiB
XML

<?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.glxp.api.dao.inv.DeviceInspectTaskMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.inv.DeviceInspectTaskEntity">
<!--@mbg.generated-->
<!--@Table device_inspect_task-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="orderId" jdbcType="VARCHAR" property="orderId" />
<result column="planOrderIdFk" jdbcType="VARCHAR" property="planOrderIdFk" />
<result column="deptCode" jdbcType="VARCHAR" property="deptCode" />
<result column="invCode" jdbcType="VARCHAR" property="invCode" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="inspectUser" jdbcType="VARCHAR" property="inspectUser" />
<result column="remindTime" jdbcType="TIMESTAMP" property="remindTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="strartTime" jdbcType="TIMESTAMP" property="strartTime" />
<result column="endTime" jdbcType="TIMESTAMP" property="endTime" />
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, orderId, planOrderIdFk, deptCode, invCode, code, `status`, inspectUser, remindTime,
remark, strartTime, endTime, createTime, updateTime
</sql>
<select id="filterList" resultType="com.glxp.api.res.inv.DeviceInspectTakeResponse">
select
t.id,
t.orderId,
t.planOrderIdFk,
t.deptCode,
t.invCode,
t.code,
t.status,
t.inspectUser,
t.updateTime,
t.createTime,
t.endTime,
t.strartTime,
t.remark,
t.remindTime,
t.expectedTime,
(select `name` from auth_dept where code = t.deptCode) deptName,
(select `name` from auth_warehouse where code = t.invCode) invName,
( SELECT `employeeName` FROM auth_user WHERE id = t.inspectUser ) inspectName,
t1.deviceName,
t1.ggxh,
t1.batchNo,
t.type
from device_inspect_task t
left join dept_device_detail t1 on t.code = t1.code
<where>
<if test="orderId != null and orderId != ''">
AND t.orderId like concat('%', #{orderId}, '%')
</if>
<if test="deptCode != null and deptCode != ''">
AND t.deptCode = #{deptCode}
</if>
<if test="invCode != null and invCode != ''">
AND t.invCode = #{invCode}
</if>
<if test="code != null and code != ''">
AND t.code like concat('%', #{code}, '%')
</if>
<if test="level != null">
AND t.level = #{level}
</if>
<if test="status != null">
AND t.status = #{status}
</if>
<if test="ksStartDate != null and ksStartDate != '' and ksEndDate != null and ksEndDate != ''">
AND date_format(t.strartTime, '%Y-%m-%d') between date_format(#{ksStartDate},
'%Y-%m-%d') and date_format(#{ksEndDate}, '%Y-%m-%d')
</if>
<if test="jsStartDate != null and jsStartDate != '' and jsEndDate != null and jsEndDate != ''">
AND date_format(t.endTime, '%Y-%m-%d') between date_format(#{jsStartDate},
'%Y-%m-%d') and date_format(#{jsEndDate}, '%Y-%m-%d')
</if>
<if test="yjjsStartDate != null and yjjsStartDate != '' and yjjsEndDate != null and yjjsEndDate != ''">
AND date_format(t.expectedTime, '%Y-%m-%d') between date_format(#{yjjsStartDate},
'%Y-%m-%d') and date_format(#{yjjsEndDate}, '%Y-%m-%d')
</if>
<if test="statusList != null and statusList.size()>0">
AND t.status in
<foreach close=")" collection="statusList" item="item" open="(" separator=", ">
#{item,jdbcType=INTEGER}
</foreach>
</if>
</where>
order by t.updateTime desc
</select>
</mapper>