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

116 lines
6.7 KiB
XML
Raw Normal View History

2024-02-29 08:23:35 +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.EmisWaybillFeeitemMapper">
<resultMap type="EmisWaybillFeeitem" id="EmisWaybillFeeitemResult">
<result property="id" column="id" />
<result property="feeId" column="fee_id" />
<result property="feeName" column="fee_name" />
<result property="fee" column="fee" />
<result property="currency" column="currency" />
<result property="waybillId" column="waybill_id" />
<result property="orderNum" column="order_num" />
<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="remark" column="remark" />
</resultMap>
<sql id="selectEmisWaybillFeeitemVo">
select id, fee_id, fee_name, fee, currency, waybill_id, 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>
<if test="id != null "> and id = #{id}</if>
<if test="feeId != null and feeId != ''"> and fee_id like concat('%', #{feeId}, '%')</if>
<if test="feeName != null and feeName != ''"> and fee_name like concat('%', #{feeName}, '%')</if>
<if test="fee != null and fee != ''"> and fee like concat('%', #{fee}, '%')</if>
<if test="currency != null and currency != ''"> and currency like concat('%', #{currency}, '%')</if>
<if test="waybillId != null "> and waybill_id = #{waybillId}</if>
<if test="orderNum != null and orderNum != ''"> 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, fee_id, fee_name, fee, currency, waybill_id, 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="id != null">id,</if>
<if test="feeId != null and feeId != ''">fee_id,</if>
<if test="feeName != null and feeName != ''">fee_name,</if>
<if test="fee != null and fee != ''">fee,</if>
<if test="currency != null and currency != ''">currency,</if>
<if test="waybillId != null">waybill_id,</if>
<if test="orderNum != null and orderNum != ''">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="id != null">#{id},</if>
<if test="feeId != null and feeId != ''">#{feeId},</if>
<if test="feeName != null and feeName != ''">#{feeName},</if>
<if test="fee != null and fee != ''">#{fee},</if>
<if test="currency != null and currency != ''">#{currency},</if>
<if test="waybillId != null">#{waybillId},</if>
<if test="orderNum != null and orderNum != ''">#{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="feeId != null and feeId != ''">fee_id = #{feeId},</if>
<if test="feeName != null and feeName != ''">fee_name = #{feeName},</if>
<if test="fee != null and fee != ''">fee = #{fee},</if>
<if test="currency != null and currency != ''">currency = #{currency},</if>
<if test="waybillId != null">waybill_id = #{waybillId},</if>
<if test="orderNum != null and orderNum != ''">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="deleteEmisWaybillFeeitemById" parameterType="Long">
delete from emis_waybill_feeitem where id = #{id}
</delete>
<delete id="deleteEmisWaybillFeeitemByIds" parameterType="String">
delete from emis_waybill_feeitem where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>