<?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.ruoyi.tms.mapper.TmsGoodsDetailMapper">
|
|
<resultMap type="com.ruoyi.tms.domain.TmsGoodsDetail" id="TmsGoodsDetailResult">
|
<result property="id" column="id" />
|
<result property="dispatchId" column="dispatch_id" />
|
<result property="dispatchNo" column="dispatch_no" />
|
<result property="productId" column="product_id" />
|
<result property="quantity" column="quantity" />
|
<result property="productName" column="product_name" />
|
<result property="productType" column="product_type" />
|
<result property="sumWeight" column="sum_weight" />
|
<result property="netWeight" column="net_weight" />
|
<result property="sumNetWeight" column="sum_net_weight" />
|
<result property="volume" column="volume" />
|
<result property="sumVolume" column="sum_volume" />
|
<result property="loosePieces" column="loose_pieces" />
|
<result property="fullContainers" column="full_containers" />
|
<result property="containerNo" column="container_no" />
|
<result property="palletCount" column="pallet_count" />
|
<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" />
|
<result property="recordStatus" column="record_status" />
|
<result property="packUnit" column="pack_unit" />
|
<result property="grossWeight" column="gross_weight" />
|
</resultMap>
|
|
<sql id="selectTmsGoodsDetailVo">
|
select thisTab.id, thisTab.dispatch_id, thisTab.dispatch_no, thisTab.product_id, thisTab.quantity, thisTab.product_name, thisTab.product_type, thisTab.sum_weight, thisTab.net_weight, thisTab.sum_net_weight, thisTab.volume, thisTab.sum_volume, thisTab.loose_pieces, thisTab.full_containers, thisTab.container_no, thisTab.pallet_count, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark, thisTab.record_status, thisTab.pack_unit, thisTab.gross_weight from tms_goods_detail AS thisTab
|
</sql>
|
<sql id="selectTmsGoodsDetailVoCount">
|
select count(0) from tms_goods_detail as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="dispatchId != null "> and thisTab.dispatch_id = #{dispatchId}</if>
|
<if test="dispatchNo != null and dispatchNo != ''"> and thisTab.dispatch_no = #{dispatchNo}</if>
|
<if test="productId != null "> and thisTab.product_id = #{productId}</if>
|
<if test="quantity != null "> and thisTab.quantity = #{quantity}</if>
|
<if test="productName != null and productName != ''"> and thisTab.product_name like concat('%', #{productName}, '%')</if>
|
<if test="productType != null and productType != ''"> and thisTab.product_type = #{productType}</if>
|
<if test="sumWeight != null "> and thisTab.sum_weight = #{sumWeight}</if>
|
<if test="netWeight != null "> and thisTab.net_weight = #{netWeight}</if>
|
<if test="sumNetWeight != null "> and thisTab.sum_net_weight = #{sumNetWeight}</if>
|
<if test="volume != null "> and thisTab.volume = #{volume}</if>
|
<if test="sumVolume != null "> and thisTab.sum_volume = #{sumVolume}</if>
|
<if test="loosePieces != null "> and thisTab.loose_pieces = #{loosePieces}</if>
|
<if test="fullContainers != null "> and thisTab.full_containers = #{fullContainers}</if>
|
<if test="containerNo != null and containerNo != ''"> and thisTab.container_no = #{containerNo}</if>
|
<if test="palletCount != null "> and thisTab.pallet_count = #{palletCount}</if>
|
<if test="recordStatus != null "> and thisTab.record_status = #{recordStatus}</if>
|
<if test="packUnit != null and packUnit != ''"> and thisTab.pack_unit = #{packUnit}</if>
|
<if test="grossWeight != null "> and thisTab.gross_weight = #{grossWeight}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectTmsGoodsDetailById" parameterType="Integer" resultMap="TmsGoodsDetailResult">
|
<include refid="selectTmsGoodsDetailVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectTmsGoodsDetailCount" parameterType="com.ruoyi.tms.domain.TmsGoodsDetail" resultType="int">
|
<include refid="selectTmsGoodsDetailVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectTmsGoodsDetailList" parameterType="com.ruoyi.tms.domain.TmsGoodsDetail" resultMap="TmsGoodsDetailResult">
|
<include refid="selectTmsGoodsDetailVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertTmsGoodsDetail" parameterType="com.ruoyi.tms.domain.TmsGoodsDetail" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_goods_detail
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="dispatchId != null">dispatch_id,</if>
|
<if test="dispatchNo != null and dispatchNo != ''">dispatch_no,</if>
|
<if test="productId != null">product_id,</if>
|
<if test="quantity != null">quantity,</if>
|
<if test="productName != null">product_name,</if>
|
<if test="productType != null">product_type,</if>
|
<if test="sumWeight != null">sum_weight,</if>
|
<if test="netWeight != null">net_weight,</if>
|
<if test="sumNetWeight != null">sum_net_weight,</if>
|
<if test="volume != null">volume,</if>
|
<if test="sumVolume != null">sum_volume,</if>
|
<if test="loosePieces != null">loose_pieces,</if>
|
<if test="fullContainers != null">full_containers,</if>
|
<if test="containerNo != null">container_no,</if>
|
<if test="palletCount != null">pallet_count,</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">remark,</if>
|
<if test="recordStatus != null">record_status,</if>
|
<if test="packUnit != null">pack_unit,</if>
|
<if test="grossWeight != null">gross_weight,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="dispatchId != null">#{dispatchId},</if>
|
<if test="dispatchNo != null and dispatchNo != ''">#{dispatchNo},</if>
|
<if test="productId != null">#{productId},</if>
|
<if test="quantity != null">#{quantity},</if>
|
<if test="productName != null">#{productName},</if>
|
<if test="productType != null">#{productType},</if>
|
<if test="sumWeight != null">#{sumWeight},</if>
|
<if test="netWeight != null">#{netWeight},</if>
|
<if test="sumNetWeight != null">#{sumNetWeight},</if>
|
<if test="volume != null">#{volume},</if>
|
<if test="sumVolume != null">#{sumVolume},</if>
|
<if test="loosePieces != null">#{loosePieces},</if>
|
<if test="fullContainers != null">#{fullContainers},</if>
|
<if test="containerNo != null">#{containerNo},</if>
|
<if test="palletCount != null">#{palletCount},</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">#{remark},</if>
|
<if test="recordStatus != null">#{recordStatus},</if>
|
<if test="packUnit != null">#{packUnit},</if>
|
<if test="grossWeight != null">#{grossWeight},</if>
|
</trim>
|
</insert>
|
|
<insert id="insertTmsGoodsDetailBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_goods_detail
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
id,dispatch_id,dispatch_no,product_id,quantity,product_name,product_type,sum_weight,net_weight,sum_net_weight,volume,sum_volume,loose_pieces,full_containers,container_no,pallet_count,create_by,create_time,update_by,update_time,remark,record_status,pack_unit,gross_weight,
|
</trim>
|
<foreach item="item" index="index" collection="list" separator=",">
|
<trim prefix="(" suffix=") " suffixOverrides=",">
|
#{item.id},#{item.dispatchId},#{item.dispatchNo},#{item.productId},#{item.quantity},#{item.productName},#{item.productType},#{item.sumWeight},#{item.netWeight},#{item.sumNetWeight},#{item.volume},#{item.sumVolume},#{item.loosePieces},#{item.fullContainers},#{item.containerNo},#{item.palletCount},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},#{item.recordStatus},#{item.packUnit},#{item.grossWeight},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updateTmsGoodsDetail" parameterType="com.ruoyi.tms.domain.TmsGoodsDetail">
|
update tms_goods_detail
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="dispatchId != null">dispatch_id = #{dispatchId},</if>
|
<if test="dispatchNo != null and dispatchNo != ''">dispatch_no = #{dispatchNo},</if>
|
<if test="productId != null">product_id = #{productId},</if>
|
<if test="quantity != null">quantity = #{quantity},</if>
|
<if test="productName != null">product_name = #{productName},</if>
|
<if test="productType != null">product_type = #{productType},</if>
|
<if test="sumWeight != null">sum_weight = #{sumWeight},</if>
|
<if test="netWeight != null">net_weight = #{netWeight},</if>
|
<if test="sumNetWeight != null">sum_net_weight = #{sumNetWeight},</if>
|
<if test="volume != null">volume = #{volume},</if>
|
<if test="sumVolume != null">sum_volume = #{sumVolume},</if>
|
<if test="loosePieces != null">loose_pieces = #{loosePieces},</if>
|
<if test="fullContainers != null">full_containers = #{fullContainers},</if>
|
<if test="containerNo != null">container_no = #{containerNo},</if>
|
<if test="palletCount != null">pallet_count = #{palletCount},</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">remark = #{remark},</if>
|
<if test="recordStatus != null">record_status = #{recordStatus},</if>
|
<if test="packUnit != null">pack_unit = #{packUnit},</if>
|
<if test="grossWeight != null">gross_weight = #{grossWeight},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updateTmsGoodsDetailBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update tms_goods_detail
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.dispatchId != null">dispatch_id = #{item.dispatchId},</if>
|
<if test="item.dispatchNo != null and item.dispatchNo != ''">dispatch_no = #{item.dispatchNo},</if>
|
<if test="item.productId != null">product_id = #{item.productId},</if>
|
<if test="item.quantity != null">quantity = #{item.quantity},</if>
|
<if test="item.productName != null">product_name = #{item.productName},</if>
|
<if test="item.productType != null">product_type = #{item.productType},</if>
|
<if test="item.sumWeight != null">sum_weight = #{item.sumWeight},</if>
|
<if test="item.netWeight != null">net_weight = #{item.netWeight},</if>
|
<if test="item.sumNetWeight != null">sum_net_weight = #{item.sumNetWeight},</if>
|
<if test="item.volume != null">volume = #{item.volume},</if>
|
<if test="item.sumVolume != null">sum_volume = #{item.sumVolume},</if>
|
<if test="item.loosePieces != null">loose_pieces = #{item.loosePieces},</if>
|
<if test="item.fullContainers != null">full_containers = #{item.fullContainers},</if>
|
<if test="item.containerNo != null">container_no = #{item.containerNo},</if>
|
<if test="item.palletCount != null">pallet_count = #{item.palletCount},</if>
|
<if test="item.createBy != null and item.createBy != ''">create_by = #{item.createBy},</if>
|
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
<if test="item.updateBy != null and item.updateBy != ''">update_by = #{item.updateBy},</if>
|
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
|
<if test="item.remark != null">remark = #{item.remark},</if>
|
<if test="item.recordStatus != null">record_status = #{item.recordStatus},</if>
|
<if test="item.packUnit != null">pack_unit = #{item.packUnit},</if>
|
<if test="item.grossWeight != null">gross_weight = #{item.grossWeight},</if>
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<!--删除-->
|
<delete id="deleteTmsGoodsDetailById" parameterType="Integer">
|
delete from tms_goods_detail where id = #{id}
|
</delete>
|
<delete id="deleteTmsGoodsDetailByIds" parameterType="Integer">
|
delete from tms_goods_detail where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|