emis-service/emis-biz/src/main/resources/mapper/EmisQuotePriceMapper.xml
2024-01-12 16:44:02 +08:00

256 lines
20 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.xdadan.erp.emis.mapper.EmisQuotePriceMapper">
<resultMap type="EmisQuotePrice" id="EmisQuotePriceResult">
<result property="quoteId" column="quote_id" />
<result property="quoteName" column="quote_name" />
<result property="quoteCode" column="quote_code" />
<result property="useSiteCode" column="use_site_code" />
<result property="useSite" column="use_site" />
<result property="transLineCode" column="trans_line_code" />
<result property="transLine" column="trans_line" />
<result property="feeType" column="fee_type" />
<result property="prodCode" column="prod_code" />
<result property="prodName" column="prod_name" />
<result property="soonPieceType" column="soon_piece_type" />
<result property="recPayType" column="rec_pay_type" />
<result property="billType" column="bill_type" />
<result property="otherType1" column="other_type1" />
<result property="otherType2" column="other_type2" />
<result property="carryType" column="carry_type" />
<result property="status" column="status" />
<result property="dispAreaId" column="disp_area_id" />
<result property="dispAreaSite" column="disp_area_site" />
<result property="dispAreaName" column="disp_area_name" />
<result property="dispAreaSiteId" column="disp_area_site_id" />
<result property="sendAreaId" column="send_area_id" />
<result property="sendAreaName" column="send_area_name" />
<result property="sendAreaSite" column="send_area_site" />
<result property="sendAreaSiteId" column="send_area_site_id" />
<result property="carriesNumber" column="carries_number" />
<result property="discardsNumber" column="discards_number" />
<result property="leastPrice" column="least_price" />
<result property="priceType" column="price_type" />
<result property="startDate" column="start_date" />
<result property="endDate" column="end_date" />
<result property="priorityLevel" column="priority_level" />
<result property="remark" column="remark" />
<result property="tenantId" column="tenant_id" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="createSite" column="create_site" />
<result property="updateSite" column="update_site" />
</resultMap>
<sql id="selectEmisQuotePriceVo">
select quote_id, quote_name, quote_code, use_site_code, use_site, trans_line_code, trans_line, fee_type, prod_code, prod_name, soon_piece_type, rec_pay_type, bill_type, other_type1, other_type2, carry_type, status, disp_area_id, disp_area_site, disp_area_name, disp_area_site_id, send_area_id, send_area_name, send_area_site, send_area_site_id, carries_number, discards_number, least_price, price_type, start_date, end_date, priority_level, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_quote_price
</sql>
<select id="selectEmisQuotePriceList" parameterType="EmisQuotePrice" resultMap="EmisQuotePriceResult">
<include refid="selectEmisQuotePriceVo"/>
<where>
<if test="quoteId != null "> and quote_id = #{quoteId}</if>
<if test="quoteName != null and quoteName != ''"> and quote_name like concat('%', #{quoteName}, '%')</if>
<if test="quoteCode != null and quoteCode != ''"> and quote_code like concat('%', #{quoteCode}, '%')</if>
<if test="useSiteCode != null and useSiteCode != ''"> and use_site_code like concat('%', #{useSiteCode}, '%')</if>
<if test="useSite != null and useSite != ''"> and use_site like concat('%', #{useSite}, '%')</if>
<if test="transLineCode != null and transLineCode != ''"> and trans_line_code like concat('%', #{transLineCode}, '%')</if>
<if test="transLine != null and transLine != ''"> and trans_line like concat('%', #{transLine}, '%')</if>
<if test="feeType != null and feeType != ''"> and fee_type like concat('%', #{feeType}, '%')</if>
<if test="prodCode != null and prodCode != ''"> and prod_code like concat('%', #{prodCode}, '%')</if>
<if test="prodName != null and prodName != ''"> and prod_name like concat('%', #{prodName}, '%')</if>
<if test="soonPieceType != null and soonPieceType != ''"> and soon_piece_type like concat('%', #{soonPieceType}, '%')</if>
<if test="recPayType != null and recPayType != ''"> and rec_pay_type like concat('%', #{recPayType}, '%')</if>
<if test="billType != null and billType != ''"> and bill_type like concat('%', #{billType}, '%')</if>
<if test="otherType1 != null and otherType1 != ''"> and other_type1 like concat('%', #{otherType1}, '%')</if>
<if test="otherType2 != null and otherType2 != ''"> and other_type2 like concat('%', #{otherType2}, '%')</if>
<if test="carryType != null and carryType != ''"> and carry_type like concat('%', #{carryType}, '%')</if>
<if test="status != null "> and status = #{status}</if>
<if test="dispAreaId != null and dispAreaId != ''"> and disp_area_id like concat('%', #{dispAreaId}, '%')</if>
<if test="dispAreaSite != null and dispAreaSite != ''"> and disp_area_site like concat('%', #{dispAreaSite}, '%')</if>
<if test="dispAreaName != null and dispAreaName != ''"> and disp_area_name like concat('%', #{dispAreaName}, '%')</if>
<if test="dispAreaSiteId != null and dispAreaSiteId != ''"> and disp_area_site_id like concat('%', #{dispAreaSiteId}, '%')</if>
<if test="sendAreaId != null and sendAreaId != ''"> and send_area_id like concat('%', #{sendAreaId}, '%')</if>
<if test="sendAreaName != null and sendAreaName != ''"> and send_area_name like concat('%', #{sendAreaName}, '%')</if>
<if test="sendAreaSite != null and sendAreaSite != ''"> and send_area_site like concat('%', #{sendAreaSite}, '%')</if>
<if test="sendAreaSiteId != null and sendAreaSiteId != ''"> and send_area_site_id like concat('%', #{sendAreaSiteId}, '%')</if>
<if test="carriesNumber != null and carriesNumber != ''"> and carries_number like concat('%', #{carriesNumber}, '%')</if>
<if test="discardsNumber != null and discardsNumber != ''"> and discards_number like concat('%', #{discardsNumber}, '%')</if>
<if test="leastPrice != null "> and least_price = #{leastPrice}</if>
<if test="priceType != null and priceType != ''"> and price_type like concat('%', #{priceType}, '%')</if>
<if test="startDate != null "> and start_date = #{startDate}</if>
<if test="endDate != null "> and end_date = #{endDate}</if>
<if test="priorityLevel != null "> and priority_level = #{priorityLevel}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
</where>
order by create_time desc
</select>
<select id="selectEmisQuotePriceByQuoteId" parameterType="Long" resultMap="EmisQuotePriceResult">
select quote_id, quote_name, quote_code, use_site_code, use_site, trans_line_code, trans_line, fee_type, prod_code, prod_name, soon_piece_type, rec_pay_type, bill_type, other_type1, other_type2, carry_type, status, disp_area_id, disp_area_site, disp_area_name, disp_area_site_id, send_area_id, send_area_name, send_area_site, send_area_site_id, carries_number, discards_number, least_price, price_type, start_date, end_date, priority_level, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_quote_price a
where a.quote_id = #{quoteId}
</select>
<insert id="insertEmisQuotePrice" parameterType="EmisQuotePrice">
insert into emis_quote_price
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="quoteId != null">quote_id,</if>
<if test="quoteName != null and quoteName != ''">quote_name,</if>
<if test="quoteCode != null and quoteCode != ''">quote_code,</if>
<if test="useSiteCode != null and useSiteCode != ''">use_site_code,</if>
<if test="useSite != null and useSite != ''">use_site,</if>
<if test="transLineCode != null and transLineCode != ''">trans_line_code,</if>
<if test="transLine != null and transLine != ''">trans_line,</if>
<if test="feeType != null and feeType != ''">fee_type,</if>
<if test="prodCode != null and prodCode != ''">prod_code,</if>
<if test="prodName != null and prodName != ''">prod_name,</if>
<if test="soonPieceType != null and soonPieceType != ''">soon_piece_type,</if>
<if test="recPayType != null and recPayType != ''">rec_pay_type,</if>
<if test="billType != null and billType != ''">bill_type,</if>
<if test="otherType1 != null and otherType1 != ''">other_type1,</if>
<if test="otherType2 != null and otherType2 != ''">other_type2,</if>
<if test="carryType != null and carryType != ''">carry_type,</if>
<if test="status != null">status,</if>
<if test="dispAreaId != null and dispAreaId != ''">disp_area_id,</if>
<if test="dispAreaSite != null and dispAreaSite != ''">disp_area_site,</if>
<if test="dispAreaName != null and dispAreaName != ''">disp_area_name,</if>
<if test="dispAreaSiteId != null and dispAreaSiteId != ''">disp_area_site_id,</if>
<if test="sendAreaId != null and sendAreaId != ''">send_area_id,</if>
<if test="sendAreaName != null and sendAreaName != ''">send_area_name,</if>
<if test="sendAreaSite != null and sendAreaSite != ''">send_area_site,</if>
<if test="sendAreaSiteId != null and sendAreaSiteId != ''">send_area_site_id,</if>
<if test="carriesNumber != null and carriesNumber != ''">carries_number,</if>
<if test="discardsNumber != null and discardsNumber != ''">discards_number,</if>
<if test="leastPrice != null">least_price,</if>
<if test="priceType != null and priceType != ''">price_type,</if>
<if test="startDate != null">start_date,</if>
<if test="endDate != null">end_date,</if>
<if test="priorityLevel != null">priority_level,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="quoteId != null">#{quoteId},</if>
<if test="quoteName != null and quoteName != ''">#{quoteName},</if>
<if test="quoteCode != null and quoteCode != ''">#{quoteCode},</if>
<if test="useSiteCode != null and useSiteCode != ''">#{useSiteCode},</if>
<if test="useSite != null and useSite != ''">#{useSite},</if>
<if test="transLineCode != null and transLineCode != ''">#{transLineCode},</if>
<if test="transLine != null and transLine != ''">#{transLine},</if>
<if test="feeType != null and feeType != ''">#{feeType},</if>
<if test="prodCode != null and prodCode != ''">#{prodCode},</if>
<if test="prodName != null and prodName != ''">#{prodName},</if>
<if test="soonPieceType != null and soonPieceType != ''">#{soonPieceType},</if>
<if test="recPayType != null and recPayType != ''">#{recPayType},</if>
<if test="billType != null and billType != ''">#{billType},</if>
<if test="otherType1 != null and otherType1 != ''">#{otherType1},</if>
<if test="otherType2 != null and otherType2 != ''">#{otherType2},</if>
<if test="carryType != null and carryType != ''">#{carryType},</if>
<if test="status != null">#{status},</if>
<if test="dispAreaId != null and dispAreaId != ''">#{dispAreaId},</if>
<if test="dispAreaSite != null and dispAreaSite != ''">#{dispAreaSite},</if>
<if test="dispAreaName != null and dispAreaName != ''">#{dispAreaName},</if>
<if test="dispAreaSiteId != null and dispAreaSiteId != ''">#{dispAreaSiteId},</if>
<if test="sendAreaId != null and sendAreaId != ''">#{sendAreaId},</if>
<if test="sendAreaName != null and sendAreaName != ''">#{sendAreaName},</if>
<if test="sendAreaSite != null and sendAreaSite != ''">#{sendAreaSite},</if>
<if test="sendAreaSiteId != null and sendAreaSiteId != ''">#{sendAreaSiteId},</if>
<if test="carriesNumber != null and carriesNumber != ''">#{carriesNumber},</if>
<if test="discardsNumber != null and discardsNumber != ''">#{discardsNumber},</if>
<if test="leastPrice != null">#{leastPrice},</if>
<if test="priceType != null and priceType != ''">#{priceType},</if>
<if test="startDate != null">#{startDate},</if>
<if test="endDate != null">#{endDate},</if>
<if test="priorityLevel != null">#{priorityLevel},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim>
</insert>
<update id="updateEmisQuotePrice" parameterType="EmisQuotePrice">
update emis_quote_price
<trim prefix="SET" suffixOverrides=",">
<if test="quoteName != null and quoteName != ''">quote_name = #{quoteName},</if>
<if test="quoteCode != null and quoteCode != ''">quote_code = #{quoteCode},</if>
<if test="useSiteCode != null and useSiteCode != ''">use_site_code = #{useSiteCode},</if>
<if test="useSite != null and useSite != ''">use_site = #{useSite},</if>
<if test="transLineCode != null and transLineCode != ''">trans_line_code = #{transLineCode},</if>
<if test="transLine != null and transLine != ''">trans_line = #{transLine},</if>
<if test="feeType != null and feeType != ''">fee_type = #{feeType},</if>
<if test="prodCode != null and prodCode != ''">prod_code = #{prodCode},</if>
<if test="prodName != null and prodName != ''">prod_name = #{prodName},</if>
<if test="soonPieceType != null and soonPieceType != ''">soon_piece_type = #{soonPieceType},</if>
<if test="recPayType != null and recPayType != ''">rec_pay_type = #{recPayType},</if>
<if test="billType != null and billType != ''">bill_type = #{billType},</if>
<if test="otherType1 != null and otherType1 != ''">other_type1 = #{otherType1},</if>
<if test="otherType2 != null and otherType2 != ''">other_type2 = #{otherType2},</if>
<if test="carryType != null and carryType != ''">carry_type = #{carryType},</if>
<if test="status != null">status = #{status},</if>
<if test="dispAreaId != null and dispAreaId != ''">disp_area_id = #{dispAreaId},</if>
<if test="dispAreaSite != null and dispAreaSite != ''">disp_area_site = #{dispAreaSite},</if>
<if test="dispAreaName != null and dispAreaName != ''">disp_area_name = #{dispAreaName},</if>
<if test="dispAreaSiteId != null and dispAreaSiteId != ''">disp_area_site_id = #{dispAreaSiteId},</if>
<if test="sendAreaId != null and sendAreaId != ''">send_area_id = #{sendAreaId},</if>
<if test="sendAreaName != null and sendAreaName != ''">send_area_name = #{sendAreaName},</if>
<if test="sendAreaSite != null and sendAreaSite != ''">send_area_site = #{sendAreaSite},</if>
<if test="sendAreaSiteId != null and sendAreaSiteId != ''">send_area_site_id = #{sendAreaSiteId},</if>
<if test="carriesNumber != null and carriesNumber != ''">carries_number = #{carriesNumber},</if>
<if test="discardsNumber != null and discardsNumber != ''">discards_number = #{discardsNumber},</if>
<if test="leastPrice != null">least_price = #{leastPrice},</if>
<if test="priceType != null and priceType != ''">price_type = #{priceType},</if>
<if test="startDate != null">start_date = #{startDate},</if>
<if test="endDate != null">end_date = #{endDate},</if>
<if test="priorityLevel != null">priority_level = #{priorityLevel},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim>
where quote_id = #{quoteId}
</update>
<delete id="deleteEmisQuotePriceByQuoteId" parameterType="Long">
delete from emis_quote_price where quote_id = #{quoteId}
</delete>
<delete id="deleteEmisQuotePriceByQuoteIds" parameterType="String">
delete from emis_quote_price where quote_id in
<foreach item="quoteId" collection="array" open="(" separator="," close=")">
#{quoteId}
</foreach>
</delete>
</mapper>