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.
udiwms-java/api-admin/target/classes/mybatis/mapper/inout/OrderDetail.xml

183 lines
6.5 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.admin.dao.inout.OrderDetailDao">
<select id="filterMyErpOrder" parameterType="com.glxp.api.admin.entity.inout.FilterErpOrderRequest"
resultType="com.glxp.api.admin.entity.inout.ErpOrderEntity">
select * from io_order_detail
<where>
<if test="docid != '' and docid!=null">
and docid = #{docid}
</if>
<if test="goodsname != '' and goodsname!=null">
and GOODSNAME = #{goodsname}
</if>
<if test="orderId != '' and orderId!=null">
and orderIdFk = #{orderId}
</if>
</where>
</select>
<select id="findByStockCheck" parameterType="java.util.List"
resultType="com.glxp.api.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.api.admin.entity.inout.FilterErpOrderRequest"
resultType="com.glxp.api.admin.entity.inout.ErpOrderEntity">
select * from io_order_detail
<where>
<if test="docid != '' and docid!=null">
and docid = #{docid}
</if>
<if test="goodsname != '' and goodsname!=null">
and GOODSNAME = #{goodsname}
</if>
</where>
group by orderIdFk,docid
</select>
<select id="filterMyErpDetailOrder" parameterType="com.glxp.api.admin.entity.inout.FilterErpOrderRequest"
resultType="com.glxp.api.admin.entity.inout.ErpOrderEntity">
select * from io_order_detail
<where>
<if test="docid != '' and docid!=null">
and docid = #{docid}
</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.api.admin.entity.inout.ErpOrderEntity">
select * from io_order_detail where docid 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 docid from io_order_detail where
docid in (
<foreach collection="docids" item="item" index="index"
separator=",">
#{item}
</foreach>
)
GROUP BY docid
</select>
<select id="filterAllDocid" parameterType="com.glxp.api.admin.entity.inout.FilterErpOrderRequest"
resultType="java.lang.String">
select docid from io_order_detail
<where>
<if test="orderId != '' and orderId!=null">
and orderIdFk = #{orderId}
</if>
</where>
group by docid
</select>
<!-- and dtlgoodsqty=count-->
<select id="filterAllDocidE" parameterType="com.glxp.api.admin.entity.inout.FilterErpOrderRequest"
resultType="com.glxp.api.admin.entity.inout.ErpOrderEntity">
select docid,orderIdFk from io_order_detail
<where>
<if test="orderId != '' and orderId!=null">
and orderIdFk <![CDATA[ <> ]]> #{orderId}
</if>
</where>
group by docid
</select>
<insert id="insertErpOrder" keyProperty="id" parameterType="com.glxp.api.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)
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}
)
</insert>
<insert id="insertErpOrders" keyProperty="id" parameterType="com.glxp.api.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)
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})
</foreach>
</insert>
<update id="updateErpOrder" parameterType="com.glxp.api.admin.entity.inout.ErpOrderEntity">
UPDATE io_order_detail
<set>
<if test="count != null">count=#{count},</if>
<if test="reCount != null">reCount=#{reCount},</if>
</set>
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">
DELETE FROM io_order_detail WHERE docid = #{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>
</mapper>