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.
293 lines
11 KiB
XML
293 lines
11 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.sale.admin.dao.inout.OrderDetailDao">
|
|
|
|
<select id="filterMyErpOrder" parameterType="com.glxp.sale.admin.entity.inout.FilterErpOrderRequest"
|
|
resultType="com.glxp.sale.admin.entity.inout.ErpOrderEntity">
|
|
select io_order_detail.* ,basic_corp.name supName from io_order_detail
|
|
left join basic_corp on io_order_detail.supId = basic_corp.erpId
|
|
<where>
|
|
<if test="erpOrderId != '' and erpOrderId!=null">
|
|
and io_order_detail.erpOrderId = #{erpOrderId}
|
|
</if>
|
|
<if test="goodsname != '' and goodsname!=null">
|
|
and io_order_detail.goodsname = #{goodsname}
|
|
</if>
|
|
<if test="orderId != '' and orderId!=null">
|
|
and io_order_detail.orderIdFk = #{orderId}
|
|
</if>
|
|
<if test="orderIdFk != '' and orderIdFk!=null">
|
|
and io_order_detail.orderIdFk = #{orderIdFk}
|
|
</if>
|
|
</where>
|
|
group by io_order_detail.id
|
|
</select>
|
|
|
|
<select id="findByStockCheck" parameterType="java.util.List"
|
|
resultType="com.glxp.sale.admin.entity.inout.ErpOrderEntity">
|
|
select * from io_order_detail where orderIdFk in
|
|
<foreach item="item" index="index" collection="orderids" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
<select id="filterMyErpMainOrder" parameterType="com.glxp.sale.admin.entity.inout.FilterErpOrderRequest"
|
|
resultType="com.glxp.sale.admin.entity.inout.ErpOrderEntity">
|
|
select * from io_order_detail
|
|
<where>
|
|
<if test="erpOrderId != '' and erpOrderId!=null">
|
|
and erpOrderId = #{erpOrderId}
|
|
</if>
|
|
<if test="goodsname != '' and goodsname!=null">
|
|
and goodsname = #{goodsname}
|
|
</if>
|
|
</where>
|
|
group by orderIdFk,erpOrderId
|
|
</select>
|
|
|
|
|
|
<select id="filterMyErpDetailOrder" parameterType="com.glxp.sale.admin.entity.inout.FilterErpOrderRequest"
|
|
resultType="com.glxp.sale.admin.entity.inout.ErpOrderEntity">
|
|
select * from io_order_detail
|
|
<where>
|
|
<if test="erpOrderId != '' and erpOrderId!=null">
|
|
and erpOrderId = #{erpOrderId}
|
|
</if>
|
|
<if test="goodsname != '' and goodsname!=null">
|
|
and goodsname = #{goodsname}
|
|
</if>
|
|
<if test="orderIdFk != '' and orderIdFk!=null">
|
|
and orderIdFk = #{orderIdFk}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
<select id="findAllByDocids" parameterType="java.util.List"
|
|
resultType="com.glxp.sale.admin.entity.inout.ErpOrderEntity">
|
|
|
|
select * from io_order_detail where erpOrderId in
|
|
<foreach item="item" index="index" collection="docids" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
<select id="selectAllIds" parameterType="java.util.List"
|
|
resultType="java.lang.String">
|
|
select erpOrderId from io_order_detail where
|
|
erpOrderId in (
|
|
<foreach collection="docids" item="item" index="index"
|
|
separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
GROUP BY erpOrderId
|
|
</select>
|
|
|
|
<select id="filterAllDocid" parameterType="com.glxp.sale.admin.entity.inout.FilterErpOrderRequest"
|
|
resultType="java.lang.String">
|
|
select erpOrderId from io_order_detail
|
|
<where>
|
|
<if test="orderId != '' and orderId!=null">
|
|
and orderIdFk = #{orderId}
|
|
</if>
|
|
</where>
|
|
group by erpOrderId
|
|
</select>
|
|
<!-- and dtlgoodsqty=count-->
|
|
<select id="filterAllDocidE" parameterType="com.glxp.sale.admin.entity.inout.FilterErpOrderRequest"
|
|
resultType="com.glxp.sale.admin.entity.inout.ErpOrderEntity">
|
|
select erpOrderId,orderIdFk from io_order_detail
|
|
<where>
|
|
<if test="orderId != '' and orderId!=null">
|
|
and orderIdFk <![CDATA[ <> ]]> #{orderId}
|
|
</if>
|
|
</where>
|
|
group by erpOrderId
|
|
</select>
|
|
|
|
<insert id="insertErpOrder" keyProperty="id" parameterType="com.glxp.sale.admin.entity.inout.ErpOrderEntity">
|
|
replace
|
|
INTO io_order_detail(id,
|
|
companyid,erpOrderId,iodtlId,inoutId,goodsunit,goodsid,
|
|
batchNoId,goodsname,companyname,
|
|
batchNo,erpCount,credate,nameCode,productCompany,
|
|
coName,authCode,packSpec,packRatio,bhzxxsbzsl,
|
|
zxxsbzbhsydysl,orderIdFk,`count`,reCount,productDate,expireDate,bindStatus,bindRlFk,uuidFk,supId,bindSupStatus
|
|
,ylqxzcrbarmc,secSalesListNo,firstSalesInvNo,secSalesInvNo,invoiceDate,price)
|
|
values(
|
|
#{id},
|
|
#{companyid},
|
|
#{erpOrderId},
|
|
#{iodtlId},
|
|
#{inoutId},
|
|
#{goodsunit},
|
|
#{goodsid},
|
|
#{batchNoId},
|
|
#{goodsname},
|
|
#{companyname},
|
|
#{batchNo},
|
|
#{erpCount},
|
|
#{credate},
|
|
#{nameCode},
|
|
#{productCompany},
|
|
#{coName},
|
|
#{authCode},
|
|
#{packSpec},
|
|
#{packRatio},
|
|
#{bhzxxsbzsl},
|
|
#{zxxsbzbhsydysl},
|
|
#{orderIdFk},
|
|
#{count},
|
|
#{reCount},
|
|
#{productDate},
|
|
#{expireDate},
|
|
#{bindStatus},
|
|
#{bindRlFk},
|
|
#{uuidFk},
|
|
#{supId},
|
|
#{bindSupStatus},
|
|
#{ylqxzcrbarmc},
|
|
#{secSalesListNo},
|
|
#{firstSalesInvNo},
|
|
#{secSalesInvNo},
|
|
#{invoiceDate},
|
|
#{price}
|
|
)
|
|
</insert>
|
|
|
|
<insert id="insertErpOrders" keyProperty="id" parameterType="com.glxp.sale.admin.entity.inout.ErpOrderEntity">
|
|
replace INTO io_order_detail(id,
|
|
companyid,erpOrderId,iodtlId,inoutId,goodsunit,goodsid,batchNoId,goodsname,companyname,
|
|
batchNo,erpCount,credate,nameCode,productCompany,
|
|
coName,authCode,packSpec,packRatio,bhzxxsbzsl,zxxsbzbhsydysl,orderIdFk,count,reCount,productDate,expireDate
|
|
,bindStatus,bindRlFk,uuidFk,supId,bindSupStatus,ylqxzcrbarmc,secSalesListNo,firstSalesInvNo,secSalesInvNo,invoiceDate,price)
|
|
values
|
|
<foreach collection="erpOrderEntities" item="item" index="index"
|
|
separator=",">
|
|
|
|
(
|
|
#{item.id},
|
|
#{item.companyid},
|
|
#{item.erpOrderId},
|
|
#{item.iodtlId},
|
|
#{item.inoutId},
|
|
#{item.goodsunit},
|
|
#{item.goodsid},
|
|
#{item.batchNoId},
|
|
#{item.goodsname},
|
|
#{item.companyname},
|
|
#{item.batchNo},
|
|
#{item.erpCount}, #{item.credate},
|
|
#{item.nameCode}, #{item.productCompany}, #{item.coName}, #{item.authCode}, #{item.packSpec},
|
|
#{item.packRatio}, #{item.bhzxxsbzsl},
|
|
#{item.zxxsbzbhsydysl}, #{item.orderIdFk},
|
|
#{item.count},#{item.reCount},#{item.productDate},#{item.expireDate},
|
|
#{item.bindStatus}, #{item.bindRlFk},#{item.uuidFk},#{item.supId},#{item.bindSupStatus}
|
|
, #{item.ylqxzcrbarmc},
|
|
#{item.secSalesListNo},
|
|
#{item.firstSalesInvNo},
|
|
#{item.secSalesInvNo},
|
|
#{item.invoiceDate},#{item.price}
|
|
)
|
|
</foreach>
|
|
|
|
</insert>
|
|
<update id="updateErpOrder" parameterType="com.glxp.sale.admin.entity.inout.ErpOrderEntity">
|
|
UPDATE io_order_detail
|
|
<trim prefix="set" suffixOverrides=",">
|
|
<if test="goodsid != null">goodsid=#{goodsid},</if>
|
|
<if test="goodsname != null">goodsname=#{goodsname},</if>
|
|
<if test="bindStatus != null">bindStatus=#{bindStatus},</if>
|
|
<if test="bindRlFk != null">bindRlFk=#{bindRlFk},</if>
|
|
<if test="count != null">count=#{count},</if>
|
|
<if test="reCount != null">reCount=#{reCount},</if>
|
|
<if test="erpCount != null">erpCount=#{erpCount},</if>
|
|
<if test="uuidFk != null">uuidFk=#{uuidFk},</if>
|
|
<if test="erpOrderId != null">erpOrderId=#{erpOrderId},</if>
|
|
<if test="erpOrderId != null">erpOrderId=#{erpOrderId},</if>
|
|
<if test="supId != null">supId=#{supId},</if>
|
|
<if test="bindSupStatus != null">bindSupStatus=#{bindSupStatus},</if>
|
|
<if test="price != null">price=#{price},</if>
|
|
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
|
|
<if test="secSalesListNo != null">secSalesListNo=#{secSalesListNo},</if>
|
|
<if test="firstSalesInvNo != null">firstSalesInvNo=#{firstSalesInvNo},</if>
|
|
<if test="secSalesInvNo != null">secSalesInvNo=#{secSalesInvNo},</if>
|
|
<if test="invoiceDate != null">invoiceDate=#{invoiceDate},</if>
|
|
<if test="productCompany != null">productCompany=#{productCompany},</if>
|
|
<if test="bindSupStatus != null">bindSupStatus=#{bindSupStatus},</if>
|
|
</trim>
|
|
WHERE id = #{id}
|
|
</update>
|
|
<delete id="deleteById" parameterType="Map">
|
|
DELETE
|
|
FROM io_order_detail
|
|
WHERE erpOrderId = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteByPrimiyId" parameterType="Map">
|
|
DELETE
|
|
FROM io_order_detail
|
|
WHERE id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteByOrderId" parameterType="Map">
|
|
DELETE
|
|
FROM io_order_detail
|
|
WHERE orderIdFk = #{id}
|
|
</delete>
|
|
|
|
<select id="findById" parameterType="Map"
|
|
resultType="com.glxp.sale.admin.entity.inout.ErpOrderEntity">
|
|
SELECT *
|
|
FROM io_order_detail
|
|
WHERE `id` = #{id}
|
|
</select>
|
|
|
|
<select id="selectByNameCodeAndOrderId" resultType="com.glxp.sale.admin.entity.inout.ErpOrderEntity">
|
|
select *
|
|
from io_order_detail
|
|
where nameCode = #{nameCode}
|
|
and orderIdFk = #{orderId}
|
|
</select>
|
|
|
|
<select id="countByOrderId" resultType="int">
|
|
select count(*)
|
|
from io_order_detail
|
|
where orderIdFk = #{orderId}
|
|
</select>
|
|
|
|
<delete id="deleteOrder">
|
|
delete
|
|
from io_order_detail
|
|
<where>
|
|
<if test="filterErpOrderRequest.orderIdFk != null">
|
|
AND orderIdFk = #{filterErpOrderRequest.orderIdFk}
|
|
</if>
|
|
<if test="filterErpOrderRequest.goodsid != null">
|
|
AND goodsid = #{filterErpOrderRequest.goodsid}
|
|
</if>
|
|
<if test="filterErpOrderRequest.batchNo != null">
|
|
AND batchNo = #{filterErpOrderRequest.batchNo}
|
|
</if>
|
|
</where>
|
|
</delete>
|
|
|
|
<select id="filterErpOrder" resultType="com.glxp.sale.admin.entity.inout.ErpOrderEntity">
|
|
select *
|
|
from io_order_detail
|
|
<where>
|
|
<if test="filterErpOrderRequest.orderIdFk != null">
|
|
AND orderIdFk = #{filterErpOrderRequest.orderIdFk}
|
|
</if>
|
|
<if test="filterErpOrderRequest.goodsid != null">
|
|
AND goodsid = #{filterErpOrderRequest.goodsid}
|
|
</if>
|
|
<if test="filterErpOrderRequest.batchNo != null">
|
|
AND batchNo = #{filterErpOrderRequest.batchNo}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
</mapper> |