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/inout/IoOrderDao.xml

88 lines
3.8 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.inout.IoOrderDao">
<select id="filterList" resultType="com.glxp.api.res.inout.IoOrderResponse">
select io_order.*,
bu.name billTypeName,
auth_user.employeeName createUserName,
auth_dept.name deptName,
auth_warehouse.name invName
from io_order
left join basic_bussiness_type bu on io_order.action = bu.action
left join auth_user on auth_user.id = io_order.createUser or auth_user.id = io_order.updateUser
or auth_user.id = io_order.reviewUser
left join auth_dept on auth_dept.code = io_order.deptCode
left join auth_warehouse on auth_warehouse.code = io_order.invCode
<where>
<if test="id != null and id != ''">
AND io_order.id = #{id}
</if>
<if test="billNo != null and billNo != ''">
AND billNo like concat('%', #{billNo}, '%')
</if>
<if test="corpOrderId != null and corpOrderId != ''">
AND corpOrderId = #{corpOrderId}
</if>
<if test="deptCode != null and deptCode != ''">
AND deptCode = #{deptCode}
</if>
<if test="invCode != null and invCode != ''">
AND invCode = #{invCode}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND io_order.createTime between #{startTime} and #{endTime}
</if>
<if test="startTime != null and startTime != ''">
AND io_order.createTime >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND io_order.createTime &lt;= #{endTime}
</if>
</where>
</select>
<select id="filterOrderList" resultType="com.glxp.api.entity.inout.IoOrderEntity">
select * from io_order
<where>
<if test="billNo != null and billNo != ''">
AND billNo like concat('%', #{billNo}, '%')
</if>
<if test="id != null and id != ''">
AND id = #{id}
</if>
<if test="action != null and action != ''">
AND action = #{action}
</if>
<if test="mainAction != null and mainAction != ''">
AND mainAction = #{mainAction}
</if>
<if test="status != null">
AND status = #{status}
</if>
<if test="corpOrderId != null and corpOrderId != ''">
AND corpOrderId = #{corpOrderId}
</if>
<if test="fromCorp != null and fromCorp != ''">
AND fromCorp = #{fromCorp}
</if>
<if test="customerId != null and customerId != ''">
AND customerId = #{customerId}
</if>
<if test="invCode != null and invCode != ''">
AND invCode = #{invCode}
</if>
<if test="deptCode != null and deptCode != ''">
AND deptCode = #{deptCode}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND createTime between #{startTime} and #{endTime}
</if>
<if test="startTime != null and startTime != ''">
AND createTime >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND createTime &lt;= #{endTime}
</if>
</where>
</select>
</mapper>