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

164 lines
6.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.inout.IoOrderDetailBizDao">
<select id="filterList" resultType="com.glxp.api.res.inout.IoOrderDetailBizResponse">
select io_order_detail_biz.*,bp.zczbhhzbapzbh,
bp.ggxh,
bp.bzgg,
bp.prepnUnit,
bp.prepnSpec
from io_order_detail_biz
left join basic_udirel bu on bu.id = io_order_detail_biz.bindRlFk
left join basic_products bp on bu.uuid = bp.uuid
<where>
<if test="orderIdFk != null and orderIdFk != ''">
AND orderIdFk = #{orderIdFk}
</if>
<if test="relId != null">
AND bindRlFk = #{relId}
</if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="productName != null and productName != ''">
AND bp.cpmctymc like concat('%', #{productName}, '%')
</if>
</where>
group by io_order_detail_biz.id
</select>
<select id="selectByinvoiceId" parameterType="java.lang.Long"
resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse">
select *
from io_order_invoice
where id = #{id}
</select>
<select id="selectByorderIdFk" parameterType="java.lang.String"
resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse">
select *
from io_order_invoice
where orderIdFk = #{orderIdFk}
</select>
<select id="getfilterList" resultType="com.glxp.api.res.inout.IoOrderDetailCodeResponse">
select io_order_detail_code.*,
(select count(*)
FROM io_order_invoice
where io_order_invoice.orderIdFk = io_order_detail_code.orderIdFk) as sucCount
from io_order_detail_code
left join basic_udirel bu on bu.id = io_order_detail_code.bindRlFk
left join basic_products bp on bu.uuid = bp.uuid
<where>
<if test="orderIdFk != null and orderIdFk != ''">
AND orderIdFk = #{orderIdFk}
</if>
<if test="relId != null">
AND bindRlFk = #{relId}
</if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="productName != null and productName != ''">
AND bp.cpmctymc like concat('%', #{productName}, '%')
</if>
</where>
group by io_order_detail_code.id
</select>
<select id="filterListInv" resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse">
SELECT ic.*, cpmctymc, ggxh
FROM io_order_invoice ic
LEFT JOIN basic_udirel bu ON bu.id = ic.bindRlFk
LEFT JOIN basic_products bp ON bu.uuid = bp.uuid
<where>
<if test="orderIdFk != null and orderIdFk != ''">
AND ic.orderIdFk = #{orderIdFk}
</if>
<if test="orderIdFk == null || orderIdFk == ''">
AND (ic.orderIdFk is null or ic.orderIdFk = '')
</if>
<if test="relId != null">
AND ic.bindRlFk = #{relId}
</if>
<if test="batchNo != null and batchNo != ''">
AND ic.batchNo = #{batchNo}
</if>
<if test="batchNo == null || batchNo == ''">
AND (ic.batchNo is null or ic.batchNo = '')
</if>
</where>
GROUP BY ic.id
</select>
<select id="selectOrderDetailBiz" resultType="com.glxp.api.entity.inout.IoOrderDetailBizEntity">
select *
from io_order_detail_biz
<where>
<if test="orderId != null and orderId != ''">
AND orderIdFk = #{orderId}
</if>
<if test="relId != null">
AND bindRlFk = #{relId}
</if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="batchNo == null || batchNo == ''">
AND (batchNo is null or batchNo = '')
</if>
<if test="productDate != null and productDate != ''">
AND productDate = #{productDate}
</if>
<if test="productDate == null or productDate == ''">
AND (productDate is null or productDate = '')
</if>
<if test="expireDate != null and expireDate != ''">
AND expireDate = #{expireDate}
</if>
<if test="expireDate == null || expireDate == ''">
AND (expireDate is null or expireDate = '')
</if>
</where>
limit 1
</select>
<select id="findByRelBatch" resultType="com.glxp.api.entity.inout.IoOrderDetailBizEntity">
select *
from io_order_detail_biz
<where>
<if test="orderId != null and orderId != ''">
AND orderIdFk = #{orderId}
</if>
<if test="relId != null">
AND bindRlFk = #{relId}
</if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="batchNo == null || batchNo == ''">
AND (batchNo is null or batchNo = '')
</if>
</where>
limit 1
</select>
<select id="getfilterOrderList" 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="relId != null">
AND bindRlFk = #{relId}
</if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
</where>
group by io_order_detail_result.id
</select>
</mapper>