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/DeviceInspectPlanDao.xml

55 lines
2.1 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.DeviceInspectPlanDao">
<select id="selectByOrderId" resultType="com.glxp.api.entity.inv.DeviceInspectPlanEntity">
select *
from device_inspect_plan
where orderId = #{orderId}
</select>
<select id="filterList" resultType="com.glxp.api.res.inv.DeviceInspectPlanResponse">
select t.id,
t.orderId,
t.deptCode,
t.invCode,
t.code,
t.level,
t.status,
t.createUser,
t.auditUser,
t.createTime,
t.auditUser,
t.auditTime,
t.remark,
(select employeeName from auth_user where id = t.createUser) createUserName,
(select employeeName from auth_user where id = t.auditUser) auditUserName,
(select `name` from auth_dept where code = t.deptCode) deptName,
(select `name` from auth_warehouse where code = t.invCode) invName,
t1.deviceName,
t1.ggxh,
t1.batchNo
from device_inspect_plan 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>
</where>
order by t.updateTime desc
</select>
</mapper>