|
|
@ -39,6 +39,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
where quote_history_id = #{quoteHistoryId} |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="findLatestQuoteHistory" parameterType="String" resultMap="SysCustomerQuoteHistoryResult" > |
|
|
|
<include refid="selectSysCustomerQuoteHistoryVo"/> |
|
|
|
where customer_code = #{customerCode} and materialCode = #{materialCode} and audit_status = '1' |
|
|
|
order by update_time desc |
|
|
|
limit 1 |
|
|
|
</select> |
|
|
|
|
|
|
|
<insert id="insertSysCustomerQuoteHistory" parameterType="SysCustomerQuoteHistory" useGeneratedKeys="true" keyProperty="quoteHistoryId"> |
|
|
|
insert into sys_customer_quote_history |
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
@ -78,11 +86,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<insert id="insertSysCustomerQuoteHistoryListBatch" parameterType="java.util.List" useGeneratedKeys="true" |
|
|
|
keyProperty="quoteHistoryId"> |
|
|
|
insert into sys_customer_quote_history |
|
|
|
(customer_code, materialCode, materialRmb, materialNoRmb, materialNoUsd, materialUsd, quote_time, create_by, |
|
|
|
(customer_code, materialCode, supplierCode ,materialRmb, materialNoRmb, materialNoUsd, materialUsd, quote_time, create_by, |
|
|
|
create_time, audit_status, is_latest) |
|
|
|
values |
|
|
|
<foreach collection="list" item="item" index="index" open="(" close=")" separator="),("> |
|
|
|
#{item.customerCode},#{item.materialCode}, #{item.materialRmb}, #{item.materialNoRmb}, |
|
|
|
#{item.customerCode},#{item.materialCode}, #{item.supplierCode}, #{item.materialRmb}, #{item.materialNoRmb}, |
|
|
|
#{item.materialNoUsd}, #{item.materialUsd}, #{item.quoteTime}, #{item.createBy}, |
|
|
|
#{item.createTime},#{item.auditStatus}, #{item.isLatest} |
|
|
|
</foreach> |
|
|
@ -110,6 +118,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
where quote_history_id = #{quoteHistoryId} |
|
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
<update id="updateSysCustomerQuoteHistoryByCode" parameterType="SysCustomerQuoteHistory"> |
|
|
|
update sys_customer_quote_history |
|
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
|
<if test="customerCode != null">customer_code = #{customerCode},</if> |
|
|
|
<if test="supplierCode != null">supplierCode = #{supplierCode},</if> |
|
|
|
<if test="materialCode != null">materialCode = #{materialCode},</if> |
|
|
|
<if test="materialRmb != null">materialRmb = #{materialRmb},</if> |
|
|
|
<if test="materialNoRmb != null">materialNoRmb = #{materialNoRmb},</if> |
|
|
|
<if test="materialNoUsd != null">materialNoUsd = #{materialNoUsd},</if> |
|
|
|
<if test="materialUsd != null">materialUsd = #{materialUsd},</if> |
|
|
|
<if test="quoteTime != null">quote_time = #{quoteTime},</if> |
|
|
|
<if test="createBy != null">create_by = #{createBy},</if> |
|
|
|
<if test="createTime != null">create_time = #{createTime},</if> |
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if> |
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
|
|
<if test="auditStatus != null">audit_status = #{auditStatus},</if> |
|
|
|
<if test="isLatest != null">is_latest = #{isLatest},</if> |
|
|
|
</trim> |
|
|
|
where supplierCode = #{supplierCode} and materialCode = #{materialCode} |
|
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updateOtherQuoteHistoryByCode" parameterType="SysCustomerQuoteHistory"> |
|
|
|
update sys_customer_quote_history |
|
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
|
<if test="customerCode != null">customer_code = #{customerCode},</if> |
|
|
|
<if test="supplierCode != null">supplierCode = #{supplierCode},</if> |
|
|
|
<if test="materialCode != null">materialCode = #{materialCode},</if> |
|
|
|
<if test="materialRmb != null">materialRmb = #{materialRmb},</if> |
|
|
|
<if test="materialNoRmb != null">materialNoRmb = #{materialNoRmb},</if> |
|
|
|
<if test="materialNoUsd != null">materialNoUsd = #{materialNoUsd},</if> |
|
|
|
<if test="materialUsd != null">materialUsd = #{materialUsd},</if> |
|
|
|
<if test="quoteTime != null">quote_time = #{quoteTime},</if> |
|
|
|
<if test="createBy != null">create_by = #{createBy},</if> |
|
|
|
<if test="createTime != null">create_time = #{createTime},</if> |
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if> |
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
|
|
<if test="auditStatus != null">audit_status = #{auditStatus},</if> |
|
|
|
<if test="isLatest != null">is_latest = #{isLatest},</if> |
|
|
|
</trim> |
|
|
|
where supplierCode = #{supplierCode} and materialCode != #{materialCode} |
|
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
<delete id="deleteSysCustomerQuoteHistoryById" parameterType="Long"> |
|
|
|
delete from sys_customer_quote_history where quote_history_id = #{quoteHistoryId} |
|
|
|
</delete> |
|
|
|