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

102 lines
4.3 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.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.*,
2 years ago
a1.mainAction,
a1.auditTime,
2 years ago
b1.NAME AS fromCorpName,
(SELECT NAME FROM basic_bussiness_type bus WHERE bus.action = a1.action) billTypeName
FROM io_order_detail_result a2
2 years ago
LEFT JOIN io_order a1 ON a1.billNo = a2.orderIdFk
LEFT JOIN basic_corp b1 ON b1.erpId = a1.fromCorp
<where>
2 years ago
a1.status = 7
<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 like concat('%', #{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="manufacturer != null and manufacturer != ''">
AND a2.manufacturer like concat('%', #{manufacturer}, '%')
</if>
<if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''">
AND a2.certCode like concat('%', #{zczbhhzbapzbh}, '%')
</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 like concat('%', #{batchNo}, '%')
</if>
<if test="coName != null and coName != ''">
AND a2.coName like concat('%', #{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>
<select id="selectStatDataByTime" resultType="com.glxp.api.entity.inout.IoOrderDetailResultEntity">
select orderIdFk,
bindRlFk,
nameCode,
batchNo,
coName,
spec,
price,
reCount,
io_order.deptCode
from io_order_detail_result
left JOIN io_order on io_order.billNo=io_order_detail_result.orderIdFk
<where>
<if test="list != null and list.size() > 0 ">
orderIdFk in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>