|
|
|
<?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.purchase.PurDeliveryDao">
|
|
|
|
<select id="queryPageList" parameterType="com.glxp.api.req.purchase.PurDeliveryRequest"
|
|
|
|
resultType="com.glxp.api.res.purchase.PurDeliveryResponse">
|
|
|
|
SELECT pur_delivery.*,
|
|
|
|
cb.employeeName createUserName,
|
|
|
|
ab.employeeName auditUserName,
|
|
|
|
auth_warehouse.NAME invName,
|
|
|
|
auth_dept.`name` deptName,
|
|
|
|
bc.name supName
|
|
|
|
|
|
|
|
FROM pur_delivery
|
|
|
|
LEFT JOIN auth_user cb ON pur_delivery.createUser = cb.id
|
|
|
|
LEFT JOIN auth_user ab ON pur_delivery.auditUser = ab.id
|
|
|
|
LEFT JOIN auth_warehouse ON pur_delivery.invCode = auth_warehouse.`code`
|
|
|
|
LEFT JOIN auth_dept ON auth_dept.CODE = pur_delivery.deptCode
|
|
|
|
left join basic_corp bc on pur_delivery.supId = bc.erpId
|
|
|
|
<where>
|
|
|
|
<if test="billNo != '' and billNo != null">
|
|
|
|
AND billNo = #{billNo}
|
|
|
|
</if>
|
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
|
<![CDATA[
|
|
|
|
and DATE_FORMAT(billDate, '%Y-%m-%d') >= #{startDate}
|
|
|
|
]]>
|
|
|
|
</if>
|
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
|
<![CDATA[
|
|
|
|
and DATE_FORMAT(billDate, '%Y-%m-%d') <= #{endDate}
|
|
|
|
]]>
|
|
|
|
</if>
|
|
|
|
<if test="status != null and status != 10 and status != 11">
|
|
|
|
and pur_delivery.status = #{status}
|
|
|
|
</if>
|
|
|
|
<if test="status == 10">
|
|
|
|
and (pur_delivery.status = 3 or pur_delivery.status = 2 or pur_delivery.status = 4)
|
|
|
|
</if>
|
|
|
|
<if test="status == 11">
|
|
|
|
and (pur_delivery.status = 1 or pur_delivery.status = 2 or pur_delivery.status = 4)
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="deptCode != '' and deptCode != null">
|
|
|
|
AND deptCode = #{deptCode}
|
|
|
|
</if>
|
|
|
|
<if test="invCode != '' and invCode != null">
|
|
|
|
AND invCode = #{invCode}
|
|
|
|
</if>
|
|
|
|
<if test="auditUser != '' and auditUser != null">
|
|
|
|
AND auditUser = #{auditUser}
|
|
|
|
</if>
|
|
|
|
<if test="createUser != '' and createUser != null">
|
|
|
|
AND createUser = #{createUser}
|
|
|
|
</if>
|
|
|
|
<if test="supId != '' and supId != null">
|
|
|
|
AND supId = #{supId}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</mapper>
|