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-spms-java/src/main/resources/mybatis/mapper/inout/IoOrderDetailResultDao.xml

71 lines
3.1 KiB
XML

2 years ago
<?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.IoOrderDetailResultDao">
<select id="filterList" resultType="com.glxp.api.res.inout.IoOrderDetailResultResponse">
select *
from io_order_detail_result
<where>
<if test="orderIdFk != null and orderIdFk != ''">
AND orderIdFk = #{orderIdFk}
</if>
<if test="nameCode != null and nameCode != ''">
AND nameCode = #{nameCode}
</if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="coName != null and coName != ''">
AND coName = #{productName}
</if>
<if test="productName != null and productName != ''">
AND coName like concat('%', #{productName}, '%')
</if>
</where>
</select>
<select id="filterOrderList" resultType="com.glxp.api.res.inout.IoOrderDetailResultResponse">
SELECT a2.*,
a1.mainAction,
b1.NAME AS fromCorpName,
(SELECT NAME FROM basic_bussiness_type bus WHERE bus.action = a1.action) billTypeName
FROM io_order_detail_result a2
LEFT JOIN io_order a1 ON a1.billNo = a2.orderIdFk
LEFT JOIN basic_corp b1 ON b1.erpId = a1.fromCorp
<where>
<if test="orderIdFk != null and orderIdFk != ''">
AND a2.orderIdFk = #{orderIdFk}
</if>
<if test="nameCode != null and nameCode != ''">
AND a2.nameCode = #{nameCode}
</if>
<if test="spec != null and spec != ''">
AND a2.spec = #{spec}
</if>
<if test="fromCorp != null and fromCorp != ''">
AND a1.fromCorp = #{fromCorp}
</if>
<if test="fromCorpName != null and fromCorpName != ''">
AND b1.name = #{fromCorpName}
</if>
<if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''">
AND date_format(a1.auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and date_format(#{endAduditTime}, '%Y-%m-%d')
</if>
<if test="batchNo != null and batchNo != ''">
AND a2.batchNo = #{batchNo}
</if>
<if test="coName != null and coName != ''">
AND a2.coName = #{coName}
</if>
<if test="productName != null and productName != ''">
AND a2.coName like concat('%', #{productName}, '%')
</if>
<if test="actions != null and actions.size() != 0">
AND a1.`action` in
<foreach collection="actions" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>