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

243 lines
17 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.EmisWarehouseInDtlMapper">
<resultMap type="EmisWarehouseInDtl" id="EmisWarehouseInDtlResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" />
<result property="inNo" column="in_no" />
<result property="inChildNo" column="in_child_no" />
<result property="goodsCode" column="goods_code" />
<result property="goodsName" column="goods_name" />
<result property="cargoQty" column="cargo_qty" />
<result property="abnormalQty" column="abnormal_qty" />
<result property="outQty" column="out_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="material" column="material" />
<result property="purpose" column="purpose" />
<result property="ingredients" column="ingredients" />
<result property="manufacturer" column="manufacturer" />
<result property="supplier" column="supplier" />
<result property="function" column="function" />
<result property="goodsModel" column="goods_model" />
<result property="grossWeight" column="gross_weight" />
<result property="netWeight" column="net_weight" />
<result property="length" column="length" />
<result property="width" column="width" />
<result property="height" column="height" />
<result property="volume" column="volume" />
<result property="barcode" column="barcode" />
<result property="orderNum" column="order_num" />
</resultMap>
<sql id="selectEmisWarehouseInDtlVo">
select id, in_no, in_child_no, goods_code, goods_name, cargo_qty, abnormal_qty, out_qty, unit, weight, price, currency, nation_area, tax_no, hscode, brand, material, purpose, ingredients, manufacturer, supplier, function, goods_model, gross_weight, net_weight, length, width, height, volume, barcode, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_warehouse_in_dtl
</sql>
<select id="selectEmisWarehouseInDtlList" parameterType="EmisWarehouseInDtl" resultMap="EmisWarehouseInDtlResult">
<include refid="selectEmisWarehouseInDtlVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="inNo != null and inNo != ''"> and in_no like concat('%', #{inNo}, '%')</if>
<if test="inChildNo != null and inChildNo != ''"> and in_child_no like concat('%', #{inChildNo}, '%')</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 cargo_qty = #{cargoQty}</if>
<if test="abnormalQty != null "> and abnormal_qty = #{abnormalQty}</if>
<if test="outQty != null "> and out_qty = #{outQty}</if>
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
<if test="weight != null "> and weight = #{weight}</if>
<if test="price != null "> and price = #{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="material != null and material != ''"> and material like concat('%', #{material}, '%')</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="manufacturer != null and manufacturer != ''"> and manufacturer like concat('%', #{manufacturer}, '%')</if>
<if test="supplier != null and supplier != ''"> and supplier like concat('%', #{supplier}, '%')</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="grossWeight != null "> and gross_weight = #{grossWeight}</if>
<if test="netWeight != null "> and net_weight = #{netWeight}</if>
<if test="length != null "> and length = #{length}</if>
<if test="width != null "> and width = #{width}</if>
<if test="height != null "> and height = #{height}</if>
<if test="volume != null "> and volume = #{volume}</if>
<if test="barcode != null and barcode != ''"> and barcode like concat('%', #{barcode}, '%')</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</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="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
</where>
order by create_time desc
</select>
<select id="selectEmisWarehouseInDtlById" parameterType="Long" resultMap="EmisWarehouseInDtlResult">
select id, in_no, in_child_no, goods_code, goods_name, cargo_qty, abnormal_qty, out_qty, unit, weight, price, currency, nation_area, tax_no, hscode, brand, material, purpose, ingredients, manufacturer, supplier, function, goods_model, gross_weight, net_weight, length, width, height, volume, barcode, order_num, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_warehouse_in_dtl a
where a.id = #{id}
</select>
<insert id="insertEmisWarehouseInDtl" parameterType="EmisWarehouseInDtl" useGeneratedKeys="true" keyProperty="id">
insert into emis_warehouse_in_dtl
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="inNo != null and inNo != ''">in_no,</if>
<if test="inChildNo != null and inChildNo != ''">in_child_no,</if>
<if test="goodsCode != null and goodsCode != ''">goods_code,</if>
<if test="goodsName != null and goodsName != ''">goods_name,</if>
<if test="cargoQty != null">cargo_qty,</if>
<if test="abnormalQty != null">abnormal_qty,</if>
<if test="outQty != null">out_qty,</if>
<if test="unit != null and unit != ''">unit,</if>
<if test="weight != null">weight,</if>
<if test="price != null">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="material != null and material != ''">material,</if>
<if test="purpose != null and purpose != ''">purpose,</if>
<if test="ingredients != null and ingredients != ''">ingredients,</if>
<if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
<if test="supplier != null and supplier != ''">supplier,</if>
<if test="function != null and function != ''">function,</if>
<if test="goodsModel != null and goodsModel != ''">goods_model,</if>
<if test="grossWeight != null">gross_weight,</if>
<if test="netWeight != null">net_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="barcode != null and barcode != ''">barcode,</if>
<if test="orderNum != null">order_num,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="tenantId != null and tenantId != ''">tenant_id,</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="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="inNo != null and inNo != ''">#{inNo},</if>
<if test="inChildNo != null and inChildNo != ''">#{inChildNo},</if>
<if test="goodsCode != null and goodsCode != ''">#{goodsCode},</if>
<if test="goodsName != null and goodsName != ''">#{goodsName},</if>
<if test="cargoQty != null">#{cargoQty},</if>
<if test="abnormalQty != null">#{abnormalQty},</if>
<if test="outQty != null">#{outQty},</if>
<if test="unit != null and unit != ''">#{unit},</if>
<if test="weight != null">#{weight},</if>
<if test="price != null">#{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="material != null and material != ''">#{material},</if>
<if test="purpose != null and purpose != ''">#{purpose},</if>
<if test="ingredients != null and ingredients != ''">#{ingredients},</if>
<if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
<if test="supplier != null and supplier != ''">#{supplier},</if>
<if test="function != null and function != ''">#{function},</if>
<if test="goodsModel != null and goodsModel != ''">#{goodsModel},</if>
<if test="grossWeight != null">#{grossWeight},</if>
<if test="netWeight != null">#{netWeight},</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="barcode != null and barcode != ''">#{barcode},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="tenantId != null and tenantId != ''">#{tenantId},</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="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim>
</insert>
<update id="updateEmisWarehouseInDtl" parameterType="EmisWarehouseInDtl">
update emis_warehouse_in_dtl
<trim prefix="SET" suffixOverrides=",">
<if test="inNo != null and inNo != ''">in_no = #{inNo},</if>
<if test="inChildNo != null and inChildNo != ''">in_child_no = #{inChildNo},</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">cargo_qty = #{cargoQty},</if>
<if test="abnormalQty != null">abnormal_qty = #{abnormalQty},</if>
<if test="outQty != null">out_qty = #{outQty},</if>
<if test="unit != null and unit != ''">unit = #{unit},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="price != null">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="material != null and material != ''">material = #{material},</if>
<if test="purpose != null and purpose != ''">purpose = #{purpose},</if>
<if test="ingredients != null and ingredients != ''">ingredients = #{ingredients},</if>
<if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
<if test="supplier != null and supplier != ''">supplier = #{supplier},</if>
<if test="function != null and function != ''">function = #{function},</if>
<if test="goodsModel != null and goodsModel != ''">goods_model = #{goodsModel},</if>
<if test="grossWeight != null">gross_weight = #{grossWeight},</if>
<if test="netWeight != null">net_weight = #{netWeight},</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="barcode != null and barcode != ''">barcode = #{barcode},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</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="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEmisWarehouseInDtlById" parameterType="Long">
delete from emis_warehouse_in_dtl where id = #{id}
</delete>
<delete id="deleteEmisWarehouseInDtlByIds" parameterType="String">
delete from emis_warehouse_in_dtl where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>