2024-02-29 08:23:35 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
< !DOCTYPE mapper
2024-04-25 09:42:49 +00:00
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2024-02-29 08:23:35 +00:00
<mapper namespace= "com.xdadan.erp.emis.mapper.EmisWaybillCargoMapper" >
2024-04-25 09:42:49 +00:00
2024-02-29 08:23:35 +00:00
<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" />
2024-04-25 09:42:49 +00:00
<result property= "height" column= "height" />
<result property= "volume" column= "volume" />
2024-02-29 08:23:35 +00:00
<result property= "declaredValue" column= "declared_value" />
<result property= "declaredValueCurrency" column= "declared_value_currency" />
<result property= "barcode" column= "barcode" />
2024-04-25 09:42:49 +00:00
<result property= "orderNum" column= "order_num" />
2024-02-29 08:23:35 +00:00
<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" >
2024-04-25 09:42:49 +00:00
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, height, volume, declared_value, declared_value_currency, barcode, order_num, del_flag, create_by, create_time, update_by, update_time, remark from emis_waybill_cargo
2024-02-29 08:23:35 +00:00
</sql>
<select id= "selectEmisWaybillCargoList" parameterType= "EmisWaybillCargo" resultMap= "EmisWaybillCargoResult" >
<include refid= "selectEmisWaybillCargoVo" />
2024-04-25 09:42:49 +00:00
<where >
2024-02-29 08:23:35 +00:00
<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>
2024-04-25 09:42:49 +00:00
<if test= "cargoQty != null " > and cargo_qty like concat('%', #{cargoQty}, '%')</if>
2024-02-29 08:23:35 +00:00
<if test= "unit != null and unit != ''" > and unit like concat('%', #{unit}, '%')</if>
2024-04-25 09:42:49 +00:00
<if test= "weight != null " > and weight like concat('%', #{weight}, '%')</if>
<if test= "price != null " > and price like concat('%', #{price}, '%')</if>
2024-02-29 08:23:35 +00:00
<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>
2024-04-25 09:42:49 +00:00
<if test= "grossWeight != null " > and gross_weight like concat('%', #{grossWeight}, '%')</if>
<if test= "length != null " > and length like concat('%', #{length}, '%')</if>
<if test= "width != null " > and width like concat('%', #{width}, '%')</if>
<if test= "height != null " > and height like concat('%', #{height}, '%')</if>
<if test= "volume != null " > and volume like concat('%', #{volume}, '%')</if>
<if test= "declaredValue != null " > and declared_value like concat('%', #{declaredValue}, '%')</if>
2024-02-29 08:23:35 +00:00
<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>
2024-04-25 09:42:49 +00:00
<if test= "orderNum != null " > and order_num = #{orderNum}</if>
2024-02-29 08:23:35 +00:00
<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>
2024-04-25 09:42:49 +00:00
2024-02-29 08:23:35 +00:00
<select id= "selectEmisWaybillCargoById" parameterType= "Long" resultMap= "EmisWaybillCargoResult" >
2024-04-25 09:42:49 +00:00
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, height, volume, declared_value, declared_value_currency, barcode, order_num, del_flag, create_by, create_time, update_by, update_time, remark
2024-02-29 08:23:35 +00:00
from emis_waybill_cargo a
where a.id = #{id}
</select>
2024-04-25 09:42:49 +00:00
2024-02-29 08:23:35 +00:00
<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>
2024-04-25 09:42:49 +00:00
<if test= "cargoQty != null" > cargo_qty,</if>
2024-02-29 08:23:35 +00:00
<if test= "unit != null and unit != ''" > unit,</if>
2024-04-25 09:42:49 +00:00
<if test= "weight != null" > weight,</if>
<if test= "price != null" > price,</if>
2024-02-29 08:23:35 +00:00
<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>
2024-04-25 09:42:49 +00:00
<if test= "grossWeight != null" > gross_weight,</if>
<if test= "length != null" > length,</if>
<if test= "width != null" > width,</if>
<if test= "height != null" > height,</if>
<if test= "volume != null" > volume,</if>
<if test= "declaredValue != null" > declared_value,</if>
2024-02-29 08:23:35 +00:00
<if test= "declaredValueCurrency != null and declaredValueCurrency != ''" > declared_value_currency,</if>
<if test= "barcode != null and barcode != ''" > barcode,</if>
2024-04-25 09:42:49 +00:00
<if test= "orderNum != null" > order_num,</if>
2024-02-29 08:23:35 +00:00
<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>
2024-04-25 09:42:49 +00:00
</trim>
2024-02-29 08:23:35 +00:00
<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>
2024-04-25 09:42:49 +00:00
<if test= "cargoQty != null" > #{cargoQty},</if>
2024-02-29 08:23:35 +00:00
<if test= "unit != null and unit != ''" > #{unit},</if>
2024-04-25 09:42:49 +00:00
<if test= "weight != null" > #{weight},</if>
<if test= "price != null" > #{price},</if>
2024-02-29 08:23:35 +00:00
<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>
2024-04-25 09:42:49 +00:00
<if test= "grossWeight != null" > #{grossWeight},</if>
<if test= "length != null" > #{length},</if>
<if test= "width != null" > #{width},</if>
<if test= "height != null" > #{height},</if>
<if test= "volume != null" > #{volume},</if>
<if test= "declaredValue != null" > #{declaredValue},</if>
2024-02-29 08:23:35 +00:00
<if test= "declaredValueCurrency != null and declaredValueCurrency != ''" > #{declaredValueCurrency},</if>
<if test= "barcode != null and barcode != ''" > #{barcode},</if>
2024-04-25 09:42:49 +00:00
<if test= "orderNum != null" > #{orderNum},</if>
2024-02-29 08:23:35 +00:00
<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>
2024-04-25 09:42:49 +00:00
</trim>
2024-02-29 08:23:35 +00:00
</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>
2024-04-25 09:42:49 +00:00
<if test= "cargoQty != null" > cargo_qty = #{cargoQty},</if>
2024-02-29 08:23:35 +00:00
<if test= "unit != null and unit != ''" > unit = #{unit},</if>
2024-04-25 09:42:49 +00:00
<if test= "weight != null" > weight = #{weight},</if>
<if test= "price != null" > price = #{price},</if>
2024-02-29 08:23:35 +00:00
<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>
2024-04-25 09:42:49 +00:00
<if test= "grossWeight != null" > gross_weight = #{grossWeight},</if>
<if test= "length != null" > length = #{length},</if>
<if test= "width != null" > width = #{width},</if>
<if test= "height != null" > height = #{height},</if>
<if test= "volume != null" > volume = #{volume},</if>
<if test= "declaredValue != null" > declared_value = #{declaredValue},</if>
2024-02-29 08:23:35 +00:00
<if test= "declaredValueCurrency != null and declaredValueCurrency != ''" > declared_value_currency = #{declaredValueCurrency},</if>
<if test= "barcode != null and barcode != ''" > barcode = #{barcode},</if>
2024-04-25 09:42:49 +00:00
<if test= "orderNum != null" > order_num = #{orderNum},</if>
2024-02-29 08:23:35 +00:00
<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" >
2024-04-25 09:42:49 +00:00
delete from emis_waybill_cargo where id in
2024-02-29 08:23:35 +00:00
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
</delete>
</mapper>