emis-service/emis-biz/src/main/resources/mapper/EmisWaybillFeeitemMapper.xml
2024-06-02 10:57:46 +08:00

153 lines
9.0 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.EmisWaybillFeeitemMapper">
<resultMap type="EmisWaybillFeeitem" id="EmisWaybillFeeitemResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" />
<result property="waybillId" column="waybill_id" />
<result property="feeCode" column="fee_code" />
<result property="feeName" column="fee_name" />
<result property="fee" column="fee" />
<result property="realFee" column="real_fee" />
<result property="currency" column="currency" />
<result property="quoteId" column="quote_id" />
<result property="exprId" column="expr_id" />
<result property="calcExp" column="calc_exp" />
<result property="initialWeightFee" column="initial_weight_fee" />
<result property="addWeightPrice" column="add_weight_price" />
<result property="blAutoGen" column="bl_auto_gen" />
<result property="orderNum" column="order_num" />
</resultMap>
<sql id="selectEmisWaybillFeeitemVo">
select id, waybill_id, fee_code, fee_name, fee, real_fee, currency, quote_id, expr_id, calc_exp, initial_weight_fee, add_weight_price, bl_auto_gen, order_num, del_flag, create_by, create_time, update_by, update_time, remark from emis_waybill_feeitem
</sql>
<select id="selectEmisWaybillFeeitemList" parameterType="EmisWaybillFeeitem" resultMap="EmisWaybillFeeitemResult">
<include refid="selectEmisWaybillFeeitemVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="waybillId != null "> and waybill_id = #{waybillId}</if>
<if test="feeCode != null and feeCode != ''"> and fee_code like concat('%', #{feeCode}, '%')</if>
<if test="feeName != null and feeName != ''"> and fee_name like concat('%', #{feeName}, '%')</if>
<if test="fee != null "> and fee like concat('%', #{fee}, '%')</if>
<if test="realFee != null "> and real_fee = #{realFee}</if>
<if test="currency != null and currency != ''"> and currency like concat('%', #{currency}, '%')</if>
<if test="quoteId != null "> and quote_id = #{quoteId}</if>
<if test="exprId != null "> and expr_id = #{exprId}</if>
<if test="calcExp != null and calcExp != ''"> and calc_exp like concat('%', #{calcExp}, '%')</if>
<if test="initialWeightFee != null "> and initial_weight_fee = #{initialWeightFee}</if>
<if test="addWeightPrice != null "> and add_weight_price = #{addWeightPrice}</if>
<if test="orderNum != null "> and order_num like concat('%', #{orderNum}, '%')</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="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
</where>
order by create_time desc
</select>
<select id="selectEmisWaybillFeeitemById" parameterType="Long" resultMap="EmisWaybillFeeitemResult">
select id, waybill_id, fee_code, fee_name, fee, real_fee, currency, quote_id, expr_id, calc_exp, initial_weight_fee, add_weight_price, bl_auto_gen, order_num, del_flag, create_by, create_time, update_by, update_time, remark
from emis_waybill_feeitem a
where a.id = #{id}
</select>
<insert id="insertEmisWaybillFeeitem" parameterType="EmisWaybillFeeitem">
insert into emis_waybill_feeitem
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="waybillId != null">waybill_id,</if>
<if test="feeCode != null and feeCode != ''">fee_code,</if>
<if test="feeName != null and feeName != ''">fee_name,</if>
<if test="fee != null">fee,</if>
<if test="realFee != null">real_fee,</if>
<if test="currency != null and currency != ''">currency,</if>
<if test="quoteId != null">quote_id,</if>
<if test="exprId != null">expr_id,</if>
<if test="calcExp != null and calcExp != ''">calc_exp,</if>
<if test="initialWeightFee != null">initial_weight_fee,</if>
<if test="addWeightPrice != null">add_weight_price,</if>
<if test="blAutoGen != null and blAutoGen != ''">bl_auto_gen,</if>
<if test="orderNum != null">order_num,</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="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="waybillId != null">#{waybillId},</if>
<if test="feeCode != null and feeCode != ''">#{feeCode},</if>
<if test="feeName != null and feeName != ''">#{feeName},</if>
<if test="fee != null">#{fee},</if>
<if test="realFee != null">#{realFee},</if>
<if test="currency != null and currency != ''">#{currency},</if>
<if test="quoteId != null">#{quoteId},</if>
<if test="exprId != null">#{exprId},</if>
<if test="calcExp != null and calcExp != ''">#{calcExp},</if>
<if test="initialWeightFee != null">#{initialWeightFee},</if>
<if test="addWeightPrice != null">#{addWeightPrice},</if>
<if test="blAutoGen != null and blAutoGen != ''">#{blAutoGen},</if>
<if test="orderNum != null">#{orderNum},</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="remark != null and remark != ''">#{remark},</if>
</trim>
</insert>
<update id="updateEmisWaybillFeeitem" parameterType="EmisWaybillFeeitem">
update emis_waybill_feeitem
<trim prefix="SET" suffixOverrides=",">
<if test="waybillId != null">waybill_id = #{waybillId},</if>
<if test="feeCode != null and feeCode != ''">fee_code = #{feeCode},</if>
<if test="feeName != null and feeName != ''">fee_name = #{feeName},</if>
<if test="fee != null">fee = #{fee},</if>
<if test="realFee != null">real_fee = #{realFee},</if>
<if test="currency != null and currency != ''">currency = #{currency},</if>
<if test="quoteId != null">quote_id = #{quoteId},</if>
<if test="exprId != null">expr_id = #{exprId},</if>
<if test="initialWeightFee != null">initial_weight_fee = #{initialWeightFee},</if>
<if test="addWeightPrice != null">add_weight_price = #{addWeightPrice},</if>
<if test="orderNum != null">order_num = #{orderNum},</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="remark != null and remark != ''">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<!-- <if test="calcExp != null and calcExp != ''">calc_exp = #{calcExp},</if>-->
<!-- <if test="blAutoGen != null and blAutoGen != ''">bl_auto_gen = #{blAutoGen},</if>-->
<delete id="deleteEmisWaybillFeeitemById" parameterType="Long">
update emis_waybill_feeitem set del_flag='1' where id = #{id}
</delete>
<delete id="deleteEmisWaybillFeeitemByIds" parameterType="String">
update emis_waybill_feeitem set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteEmisWaybillFeeitemByWaybillId" parameterType="Long">
update emis_waybill_feeitem set del_flag='1' where waybill_id = #{waybillId}
</delete>
</mapper>