emis-service/emis-biz/src/main/resources/mapper/EmisWaybillCargoMapper.xml
2024-02-29 16:23:35 +08:00

211 lines
15 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.EmisWaybillCargoMapper">
<resultMap type="EmisWaybillCargo" id="EmisWaybillCargoResult">
<result property="id" column="id" />
<result property="waybillId" column="waybill_id" />
<result property="goodsCode" column="goods_code" />
<result property="goodsName" column="goods_name" />
<result property="cargoQty" column="cargo_qty" />
<result property="unit" column="unit" />
<result property="weight" column="weight" />
<result property="price" column="price" />
<result property="currency" column="currency" />
<result property="nationArea" column="nation_area" />
<result property="taxNo" column="tax_no" />
<result property="hscode" column="hscode" />
<result property="brand" column="brand" />
<result property="purpose" column="purpose" />
<result property="ingredients" column="ingredients" />
<result property="function" column="function" />
<result property="goodsModel" column="goods_model" />
<result property="manufacturer" column="manufacturer" />
<result property="grossWeight" column="gross_weight" />
<result property="length" column="length" />
<result property="width" column="width" />
<result property="declaredValue" column="declared_value" />
<result property="declaredValueCurrency" column="declared_value_currency" />
<result property="barcode" column="barcode" />
<result property="height" column="height" />
<result property="volume" column="volume" />
<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="selectEmisWaybillCargoVo">
select id, waybill_id, goods_code, goods_name, cargo_qty, unit, weight, price, currency, nation_area, tax_no, hscode, brand, purpose, ingredients, function, goods_model, manufacturer, gross_weight, length, width, declared_value, declared_value_currency, barcode, height, volume, del_flag, create_by, create_time, update_by, update_time, remark from emis_waybill_cargo
</sql>
<select id="selectEmisWaybillCargoList" parameterType="EmisWaybillCargo" resultMap="EmisWaybillCargoResult">
<include refid="selectEmisWaybillCargoVo"/>
<where>
<if test="id != null "> and id = #{id}</if>
<if test="waybillId != null "> and waybill_id = #{waybillId}</if>
<if test="goodsCode != null and goodsCode != ''"> and goods_code like concat('%', #{goodsCode}, '%')</if>
<if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
<if test="cargoQty != null and cargoQty != ''"> and cargo_qty like concat('%', #{cargoQty}, '%')</if>
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
<if test="weight != null and weight != ''"> and weight like concat('%', #{weight}, '%')</if>
<if test="price != null and price != ''"> and price like concat('%', #{price}, '%')</if>
<if test="currency != null and currency != ''"> and currency like concat('%', #{currency}, '%')</if>
<if test="nationArea != null and nationArea != ''"> and nation_area like concat('%', #{nationArea}, '%')</if>
<if test="taxNo != null and taxNo != ''"> and tax_no like concat('%', #{taxNo}, '%')</if>
<if test="hscode != null and hscode != ''"> and hscode like concat('%', #{hscode}, '%')</if>
<if test="brand != null and brand != ''"> and brand like concat('%', #{brand}, '%')</if>
<if test="purpose != null and purpose != ''"> and purpose like concat('%', #{purpose}, '%')</if>
<if test="ingredients != null and ingredients != ''"> and ingredients like concat('%', #{ingredients}, '%')</if>
<if test="function != null and function != ''"> and function like concat('%', #{function}, '%')</if>
<if test="goodsModel != null and goodsModel != ''"> and goods_model like concat('%', #{goodsModel}, '%')</if>
<if test="manufacturer != null and manufacturer != ''"> and manufacturer like concat('%', #{manufacturer}, '%')</if>
<if test="grossWeight != null and grossWeight != ''"> and gross_weight like concat('%', #{grossWeight}, '%')</if>
<if test="length != null and length != ''"> and length like concat('%', #{length}, '%')</if>
<if test="width != null and width != ''"> and width like concat('%', #{width}, '%')</if>
<if test="declaredValue != null and declaredValue != ''"> and declared_value like concat('%', #{declaredValue}, '%')</if>
<if test="declaredValueCurrency != null and declaredValueCurrency != ''"> and declared_value_currency like concat('%', #{declaredValueCurrency}, '%')</if>
<if test="barcode != null and barcode != ''"> and barcode like concat('%', #{barcode}, '%')</if>
<if test="height != null and height != ''"> and height like concat('%', #{height}, '%')</if>
<if test="volume != null and volume != ''"> and volume like concat('%', #{volume}, '%')</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="selectEmisWaybillCargoById" parameterType="Long" resultMap="EmisWaybillCargoResult">
select id, waybill_id, goods_code, goods_name, cargo_qty, unit, weight, price, currency, nation_area, tax_no, hscode, brand, purpose, ingredients, function, goods_model, manufacturer, gross_weight, length, width, declared_value, declared_value_currency, barcode, height, volume, del_flag, create_by, create_time, update_by, update_time, remark
from emis_waybill_cargo a
where a.id = #{id}
</select>
<insert id="insertEmisWaybillCargo" parameterType="EmisWaybillCargo">
insert into emis_waybill_cargo
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="waybillId != null">waybill_id,</if>
<if test="goodsCode != null and goodsCode != ''">goods_code,</if>
<if test="goodsName != null and goodsName != ''">goods_name,</if>
<if test="cargoQty != null and cargoQty != ''">cargo_qty,</if>
<if test="unit != null and unit != ''">unit,</if>
<if test="weight != null and weight != ''">weight,</if>
<if test="price != null and price != ''">price,</if>
<if test="currency != null and currency != ''">currency,</if>
<if test="nationArea != null and nationArea != ''">nation_area,</if>
<if test="taxNo != null and taxNo != ''">tax_no,</if>
<if test="hscode != null and hscode != ''">hscode,</if>
<if test="brand != null and brand != ''">brand,</if>
<if test="purpose != null and purpose != ''">purpose,</if>
<if test="ingredients != null and ingredients != ''">ingredients,</if>
<if test="function != null and function != ''">function,</if>
<if test="goodsModel != null and goodsModel != ''">goods_model,</if>
<if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
<if test="grossWeight != null and grossWeight != ''">gross_weight,</if>
<if test="length != null and length != ''">length,</if>
<if test="width != null and width != ''">width,</if>
<if test="declaredValue != null and declaredValue != ''">declared_value,</if>
<if test="declaredValueCurrency != null and declaredValueCurrency != ''">declared_value_currency,</if>
<if test="barcode != null and barcode != ''">barcode,</if>
<if test="height != null and height != ''">height,</if>
<if test="volume != null and volume != ''">volume,</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="waybillId != null">#{waybillId},</if>
<if test="goodsCode != null and goodsCode != ''">#{goodsCode},</if>
<if test="goodsName != null and goodsName != ''">#{goodsName},</if>
<if test="cargoQty != null and cargoQty != ''">#{cargoQty},</if>
<if test="unit != null and unit != ''">#{unit},</if>
<if test="weight != null and weight != ''">#{weight},</if>
<if test="price != null and price != ''">#{price},</if>
<if test="currency != null and currency != ''">#{currency},</if>
<if test="nationArea != null and nationArea != ''">#{nationArea},</if>
<if test="taxNo != null and taxNo != ''">#{taxNo},</if>
<if test="hscode != null and hscode != ''">#{hscode},</if>
<if test="brand != null and brand != ''">#{brand},</if>
<if test="purpose != null and purpose != ''">#{purpose},</if>
<if test="ingredients != null and ingredients != ''">#{ingredients},</if>
<if test="function != null and function != ''">#{function},</if>
<if test="goodsModel != null and goodsModel != ''">#{goodsModel},</if>
<if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
<if test="grossWeight != null and grossWeight != ''">#{grossWeight},</if>
<if test="length != null and length != ''">#{length},</if>
<if test="width != null and width != ''">#{width},</if>
<if test="declaredValue != null and declaredValue != ''">#{declaredValue},</if>
<if test="declaredValueCurrency != null and declaredValueCurrency != ''">#{declaredValueCurrency},</if>
<if test="barcode != null and barcode != ''">#{barcode},</if>
<if test="height != null and height != ''">#{height},</if>
<if test="volume != null and volume != ''">#{volume},</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="updateEmisWaybillCargo" parameterType="EmisWaybillCargo">
update emis_waybill_cargo
<trim prefix="SET" suffixOverrides=",">
<if test="waybillId != null">waybill_id = #{waybillId},</if>
<if test="goodsCode != null and goodsCode != ''">goods_code = #{goodsCode},</if>
<if test="goodsName != null and goodsName != ''">goods_name = #{goodsName},</if>
<if test="cargoQty != null and cargoQty != ''">cargo_qty = #{cargoQty},</if>
<if test="unit != null and unit != ''">unit = #{unit},</if>
<if test="weight != null and weight != ''">weight = #{weight},</if>
<if test="price != null and price != ''">price = #{price},</if>
<if test="currency != null and currency != ''">currency = #{currency},</if>
<if test="nationArea != null and nationArea != ''">nation_area = #{nationArea},</if>
<if test="taxNo != null and taxNo != ''">tax_no = #{taxNo},</if>
<if test="hscode != null and hscode != ''">hscode = #{hscode},</if>
<if test="brand != null and brand != ''">brand = #{brand},</if>
<if test="purpose != null and purpose != ''">purpose = #{purpose},</if>
<if test="ingredients != null and ingredients != ''">ingredients = #{ingredients},</if>
<if test="function != null and function != ''">function = #{function},</if>
<if test="goodsModel != null and goodsModel != ''">goods_model = #{goodsModel},</if>
<if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
<if test="grossWeight != null and grossWeight != ''">gross_weight = #{grossWeight},</if>
<if test="length != null and length != ''">length = #{length},</if>
<if test="width != null and width != ''">width = #{width},</if>
<if test="declaredValue != null and declaredValue != ''">declared_value = #{declaredValue},</if>
<if test="declaredValueCurrency != null and declaredValueCurrency != ''">declared_value_currency = #{declaredValueCurrency},</if>
<if test="barcode != null and barcode != ''">barcode = #{barcode},</if>
<if test="height != null and height != ''">height = #{height},</if>
<if test="volume != null and volume != ''">volume = #{volume},</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="deleteEmisWaybillCargoById" parameterType="Long">
delete from emis_waybill_cargo where id = #{id}
</delete>
<delete id="deleteEmisWaybillCargoByIds" parameterType="String">
delete from emis_waybill_cargo where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>