|
|
|
<?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.purchase.PurPlanDetailDao">
|
|
|
|
|
|
|
|
<select id="queryPageList" parameterType="com.glxp.api.req.purchase.PurPlanDetailRequest"
|
|
|
|
resultType="com.glxp.api.entity.purchase.PurPlanDetailEntity">
|
|
|
|
select *
|
|
|
|
FROM pur_plan_detail
|
|
|
|
<where>
|
|
|
|
<if test="orderIdFk != '' and orderIdFk != null">
|
|
|
|
AND orderIdFk = #{orderIdFk}
|
|
|
|
</if>
|
|
|
|
<if test="productId != null">
|
|
|
|
AND productId = #{productId}
|
|
|
|
</if>
|
|
|
|
<if test="supId != '' and supId != null">
|
|
|
|
AND supId = #{supId}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- <select id="joinQueryList" parameterType="com.glxp.api.req.purchase.PurPlanDetailRequest"-->
|
|
|
|
<!-- resultType="com.glxp.api..entity.business.StockOrderDetailEntity">-->
|
|
|
|
<!-- select-->
|
|
|
|
<!-- pur_plan_detail.*,-->
|
|
|
|
<!-- basic_products.ggxh spec,basic_udirel.measname,basic_udirel.manufactory,basic_products.ylqxzcrbarmc-->
|
|
|
|
<!-- ,basic_corp.`name` supName-->
|
|
|
|
<!-- FROM pur_plan_detail-->
|
|
|
|
<!-- INNER JOIN basic_udirel on pur_plan_detail.productId = basic_udirel.id-->
|
|
|
|
<!-- INNER JOIN basic_products on basic_udirel.uuid = basic_products.uuid-->
|
|
|
|
<!-- inner join basic_corp on pur_plan_detail.supId =basic_corp.erpId-->
|
|
|
|
<!-- <where>-->
|
|
|
|
<!-- <if test="orderIdFk != '' and orderIdFk != null">-->
|
|
|
|
<!-- AND orderIdFk = #{orderIdFk}-->
|
|
|
|
<!-- AND basic_products.diType=1-->
|
|
|
|
<!-- </if>-->
|
|
|
|
<!-- <if test="productId != null">-->
|
|
|
|
<!-- AND productId = #{productId}-->
|
|
|
|
<!-- </if>-->
|
|
|
|
<!-- <if test="supId != '' and supId != null">-->
|
|
|
|
<!-- AND supId = #{supId}-->
|
|
|
|
<!-- </if>-->
|
|
|
|
<!-- </where>-->
|
|
|
|
|
|
|
|
<!-- </select>-->
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insert" keyProperty="id"
|
|
|
|
parameterType="com.glxp.api.entity.purchase.PurPlanDetailEntity">
|
|
|
|
replace
|
|
|
|
INTO pur_plan_detail
|
|
|
|
(
|
|
|
|
orderIdFk,productId,productName,`count`,supId,zczbhhzbapzbh
|
|
|
|
)
|
|
|
|
values (
|
|
|
|
#{orderIdFk},
|
|
|
|
#{productId},
|
|
|
|
#{productName},
|
|
|
|
#{count},
|
|
|
|
#{supId},#{zczbhhzbapzbh}
|
|
|
|
)
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteByIds" parameterType="java.util.List">
|
|
|
|
DELETE FROM pur_plan_detail WHERE id in
|
|
|
|
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
|
|
|
#{item}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteByOrderId" parameterType="map">
|
|
|
|
DELETE
|
|
|
|
FROM pur_plan_detail
|
|
|
|
WHERE orderIdFk = #{orderIdFk}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<update id="update" parameterType="com.glxp.api.entity.purchase.PurPlanDetailEntity">
|
|
|
|
UPDATE pur_plan_detail
|
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
|
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
|
|
|
|
<if test="productId != null">productId=#{productId},</if>
|
|
|
|
<if test="productName != null">productName=#{productName},</if>
|
|
|
|
<if test="count != null">`count`=#{count},</if>
|
|
|
|
<if test="supId != null">supId=#{supId},</if>
|
|
|
|
<if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if>
|
|
|
|
</trim>
|
|
|
|
WHERE id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertPurPlanDetailEntity" keyProperty="id" parameterType="com.glxp.api.entity.purchase.PurPlanDetailEntity">
|
|
|
|
REPLACE INTO pur_plan_detail
|
|
|
|
( orderIdFk,productId,productName,count,supId,zczbhhzbapzbh) values
|
|
|
|
|
|
|
|
<foreach collection="datas" item="item" index="index" separator=",">
|
|
|
|
(
|
|
|
|
#{item.orderIdFk},
|
|
|
|
#{item.productId},
|
|
|
|
#{item.productName},
|
|
|
|
#{item.count},
|
|
|
|
#{item.supId},
|
|
|
|
#{item.zczbhhzbapzbh}
|
|
|
|
)
|
|
|
|
</foreach>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
</mapper>
|