emis-service/emis-biz/src/main/resources/mapper/EmisTmsCostFeeFeeitemMapper.xml

149 lines
8.2 KiB
XML
Raw Normal View History

2025-02-17 11:45:02 +00:00
<?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.EmisTmsCostFeeFeeitemMapper">
<resultMap type="EmisTmsCostFeeFeeitem" id="EmisTmsCostFeeFeeitemResult">
<result property="id" column="id" />
<result property="costNo" column="cost_no" />
<result property="feeType" column="fee_type" />
2025-02-18 07:40:55 +00:00
<result property="price" column="price" />
2025-02-17 11:45:02 +00:00
<result property="fee" column="fee" />
<result property="currency" column="currency" />
<result property="currecyToCnyRate" column="currecy_to_cny_rate" />
<result property="cnyFee" column="cny_fee" />
<result property="orderNum" column="order_num" />
</resultMap>
<sql id="selectEmisTmsCostFeeFeeitemVo">
2025-02-18 07:40:55 +00:00
select id, cost_no, fee_type, price, fee, currency, currecy_to_cny_rate, cny_fee, order_num, del_flag, create_by, create_time, update_by, update_time, remark from emis_tms_cost_fee_feeitem
2025-02-17 11:45:02 +00:00
</sql>
<select id="selectEmisTmsCostFeeFeeitemList" parameterType="EmisTmsCostFeeFeeitem" resultMap="EmisTmsCostFeeFeeitemResult">
<include refid="selectEmisTmsCostFeeFeeitemVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="costNo != null and costNo != ''"> and cost_no like concat('%', #{costNo}, '%')</if>
<if test="feeType != null and feeType != ''"> and fee_type like concat('%', #{feeType}, '%')</if>
2025-02-18 07:40:55 +00:00
<if test="price != null "> and price = #{price}</if>
2025-02-17 11:45:02 +00:00
<if test="fee != null "> and fee = #{fee}</if>
<if test="currency != null and currency != ''"> and currency like concat('%', #{currency}, '%')</if>
<if test="currecyToCnyRate != null "> and currecy_to_cny_rate = #{currecyToCnyRate}</if>
<if test="cnyFee != null "> and cny_fee = #{cnyFee}</if>
<if test="orderNum != null "> and order_num = #{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="checkUnique" parameterType="EmisTmsCostFeeFeeitem" resultType="int">
select count(1) from emis_tms_cost_fee_feeitem
where del_flag='0'
and id = #{id}
and cost_no = #{costNo}
and fee_type = #{feeType}
and fee = #{fee}
and currency = #{currency}
and currecy_to_cny_rate = #{currecyToCnyRate}
and cny_fee = #{cnyFee}
and order_num = #{orderNum}
and del_flag = #{delFlag}
and create_by = #{createBy}
and create_time = #{createTime}
and update_by = #{updateBy}
and update_time = #{updateTime}
and remark = #{remark}
limit 1
</select>
<select id="selectEmisTmsCostFeeFeeitemById" parameterType="Long" resultMap="EmisTmsCostFeeFeeitemResult">
2025-02-18 07:40:55 +00:00
select id, cost_no, fee_type, price, fee, currency, currecy_to_cny_rate, cny_fee, order_num, del_flag, create_by, create_time, update_by, update_time, remark
2025-02-17 11:45:02 +00:00
from emis_tms_cost_fee_feeitem a
where a.id = #{id}
</select>
2025-02-17 12:20:23 +00:00
<select id="selectEmisTmsCostFeeFeeitemByCostNo" parameterType="String" resultMap="EmisTmsCostFeeFeeitemResult">
2025-02-18 07:40:55 +00:00
select id, cost_no, fee_type, price, fee, currency, currecy_to_cny_rate, cny_fee, order_num, del_flag, create_by, create_time, update_by, update_time, remark
2025-02-17 12:20:23 +00:00
from emis_tms_cost_fee_feeitem a
where del_flag='0' and a.cost_no = #{costNo}
</select>
2025-02-17 11:45:02 +00:00
<insert id="insertEmisTmsCostFeeFeeitem" parameterType="EmisTmsCostFeeFeeitem" useGeneratedKeys="true" keyProperty="id">
insert into emis_tms_cost_fee_feeitem
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="costNo != null and costNo != ''">cost_no,</if>
<if test="feeType != null and feeType != ''">fee_type,</if>
2025-02-18 07:40:55 +00:00
<if test="price != null">price,</if>
2025-02-17 11:45:02 +00:00
<if test="fee != null">fee,</if>
<if test="currency != null and currency != ''">currency,</if>
<if test="currecyToCnyRate != null">currecy_to_cny_rate,</if>
<if test="cnyFee != null">cny_fee,</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>
2025-02-18 07:40:55 +00:00
</trim>
2025-02-17 11:45:02 +00:00
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="costNo != null and costNo != ''">#{costNo},</if>
<if test="feeType != null and feeType != ''">#{feeType},</if>
2025-02-18 07:40:55 +00:00
<if test="price != null">#{price},</if>
2025-02-17 11:45:02 +00:00
<if test="fee != null">#{fee},</if>
<if test="currency != null and currency != ''">#{currency},</if>
<if test="currecyToCnyRate != null">#{currecyToCnyRate},</if>
<if test="cnyFee != null">#{cnyFee},</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>
2025-02-18 07:40:55 +00:00
</trim>
2025-02-17 11:45:02 +00:00
</insert>
<update id="updateEmisTmsCostFeeFeeitem" parameterType="EmisTmsCostFeeFeeitem">
update emis_tms_cost_fee_feeitem
<trim prefix="SET" suffixOverrides=",">
<if test="costNo != null and costNo != ''">cost_no = #{costNo},</if>
<if test="feeType != null and feeType != ''">fee_type = #{feeType},</if>
2025-02-18 07:40:55 +00:00
<if test="price != null">price = #{price},</if>
2025-02-17 11:45:02 +00:00
<if test="fee != null">fee = #{fee},</if>
<if test="currency != null and currency != ''">currency = #{currency},</if>
<if test="currecyToCnyRate != null">currecy_to_cny_rate = #{currecyToCnyRate},</if>
<if test="cnyFee != null">cny_fee = #{cnyFee},</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>
<delete id="deleteEmisTmsCostFeeFeeitemByCostNo" parameterType="String">
update emis_tms_cost_fee_feeitem set del_flag='1' where cost_no = #{costNo}
</delete>
<delete id="deleteEmisTmsCostFeeFeeitemById" parameterType="Long">
update emis_tms_cost_fee_feeitem set del_flag='1' where id = #{id}
</delete>
<delete id="deleteEmisTmsCostFeeFeeitemByIds" parameterType="String">
update emis_tms_cost_fee_feeitem set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>