|
|
@ -30,11 +30,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<result property="remark" column="remark" /> |
|
|
|
<result property="useStatus" column="use_status" /> |
|
|
|
<result property="auditStatus" column="audit_status" /> |
|
|
|
<result property="isLatest" column=" is_latest"/> |
|
|
|
<result property="delFlag" column="del_flag" /> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="selectPurchaseQuoteHistoryVo"> |
|
|
|
select purchase_quote_child_id, purchase_quote_code, material_id, material_code, material_name, material_type, processMethod, brand, photoUrl, describe, tax_rate, usd_rate, material_num, material_sole, material_rmb, material_noRmb, supplier_code, supplier_name, create_by, create_time, update_by, update_time, remark, use_status, audit_status, del_flag from purchase_quote_history |
|
|
|
select purchase_quote_child_id, purchase_quote_code, material_id, material_code, material_name, material_type, processMethod, brand, photoUrl, describe, tax_rate, usd_rate, material_num, material_sole, material_rmb, material_noRmb, supplier_code, supplier_name, create_by, create_time, update_by, update_time, remark, use_status, audit_status, is_latest,del_flag from purchase_quote_history |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="selectPurchaseQuoteHistoryList" parameterType="PurchaseQuoteHistory" resultMap="PurchaseQuoteHistoryResult"> |
|
|
@ -95,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="remark != null">remark,</if> |
|
|
|
<if test="useStatus != null">use_status,</if> |
|
|
|
<if test="auditStatus != null">audit_status,</if> |
|
|
|
<if test="isLatest != null">is_latest,</if> |
|
|
|
<if test="delFlag != null">del_flag,</if> |
|
|
|
</trim> |
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
@ -122,10 +124,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="remark != null">#{remark},</if> |
|
|
|
<if test="useStatus != null">#{useStatus},</if> |
|
|
|
<if test="auditStatus != null">#{auditStatus},</if> |
|
|
|
<if test="isLatest != null">#{isLatest},</if> |
|
|
|
<if test="delFlag != null">#{delFlag},</if> |
|
|
|
</trim> |
|
|
|
</insert> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertBatchPurchaseQuoteHistory" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="purchaseQuoteChildId"> |
|
|
|
insert into purchase_quote_history ( |
|
|
|
purchase_quote_code, |
|
|
|
material_id, |
|
|
|
material_code, |
|
|
|
material_name, |
|
|
|
tax_rate, |
|
|
|
usd_rate, |
|
|
|
material_num, |
|
|
|
material_sole, |
|
|
|
material_rmb, |
|
|
|
material_noRmb, |
|
|
|
supplier_code, |
|
|
|
supplier_name, |
|
|
|
create_by, |
|
|
|
create_time, |
|
|
|
remark, |
|
|
|
use_status, |
|
|
|
audit_status, |
|
|
|
is_latest, |
|
|
|
del_flag |
|
|
|
) values |
|
|
|
<foreach collection="list" item="item" separator=","> |
|
|
|
( |
|
|
|
#{item.purchaseQuoteCode}, |
|
|
|
#{item.materialId}, |
|
|
|
#{item.materialCode}, |
|
|
|
#{item.materialName}, |
|
|
|
#{item.taxRate}, |
|
|
|
#{item.usdRate}, |
|
|
|
#{item.materialNum}, |
|
|
|
#{item.materialSole}, |
|
|
|
#{item.materialRmb}, |
|
|
|
#{item.materialNormb}, |
|
|
|
#{item.supplierCode}, |
|
|
|
#{item.supplierName}, |
|
|
|
#{item.createBy}, |
|
|
|
#{item.createTime}, |
|
|
|
#{item.remark}, |
|
|
|
#{item.useStatus}, |
|
|
|
#{item.auditStatus}, |
|
|
|
#{item.isLatest}, |
|
|
|
#{item.delFlag} |
|
|
|
) |
|
|
|
</foreach> |
|
|
|
</insert> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updatePurchaseQuoteHistory" parameterType="PurchaseQuoteHistory"> |
|
|
|
update purchase_quote_history |
|
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
@ -153,6 +213,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="remark != null">remark = #{remark},</if> |
|
|
|
<if test="useStatus != null">use_status = #{useStatus},</if> |
|
|
|
<if test="auditStatus != null">audit_status = #{auditStatus},</if> |
|
|
|
<if test="isLatest != null">is_latest = #{isLatest},</if> |
|
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if> |
|
|
|
</trim> |
|
|
|
where purchase_quote_child_id = #{purchaseQuoteChildId} |
|
|
@ -177,4 +238,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
update purchase_quote_history set del_flag = '0' where purchase_quote_child_id = #{purchaseQuoteChildId} |
|
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
<select id="findLatestPurchaseQuoteHistory" parameterType="String" resultMap="PurchaseQuoteHistoryResult" > |
|
|
|
<include refid="selectPurchaseQuoteHistoryVo"/> |
|
|
|
where purchase_quote_code = #{purchaseQuoteCode} and material_code = #{materialCode} and audit_status = '1' |
|
|
|
order by update_time desc |
|
|
|
limit 1 |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |