<?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.TmsProductInfoMapper">
|
|
<resultMap type="com.ruoyi.tms.domain.TmsProductInfo" id="TmsProductInfoResult">
|
<result property="id" column="id" />
|
<result property="customerId" column="customer_id" />
|
<result property="customer" column="customer" />
|
<result property="productCode" column="product_code" />
|
<result property="productName" column="product_name" />
|
<result property="grossWeight" column="gross_weight" />
|
<result property="netWeight" column="net_weight" />
|
<result property="volume" column="volume" />
|
<result property="specModel" column="spec_model" />
|
<result property="productType" column="product_type" />
|
<result property="packUnit" column="pack_unit" />
|
<result property="packLength" column="pack_length" />
|
<result property="packWidth" column="pack_width" />
|
<result property="packHeight" column="pack_height" />
|
<result property="temperatureRequired" column="temperature_required" />
|
<result property="maxTemperature" column="max_temperature" />
|
<result property="minTemperature" column="min_temperature" />
|
<result property="maxHumidity" column="max_humidity" />
|
<result property="minHumidity" column="min_humidity" />
|
<result property="isHazardous" column="is_hazardous" />
|
<result property="status" column="status" />
|
<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="selectTmsProductInfoVo">
|
select thisTab.id, thisTab.customer_id, thisTab.customer, thisTab.product_code, thisTab.product_name, thisTab.gross_weight, thisTab.net_weight, thisTab.volume, thisTab.spec_model, thisTab.product_type, thisTab.pack_unit, thisTab.pack_length, thisTab.pack_width, thisTab.pack_height, thisTab.temperature_required, thisTab.max_temperature, thisTab.min_temperature, thisTab.max_humidity, thisTab.min_humidity, thisTab.is_hazardous, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark from tms_product_info AS thisTab
|
</sql>
|
<sql id="selectTmsProductInfoVoCount">
|
select count(0) from tms_product_info as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="customerId != null "> and thisTab.customer_id = #{customerId}</if>
|
<if test="customer != null and customer != ''"> and thisTab.customer = #{customer}</if>
|
<if test="productCode != null and productCode != ''"> and thisTab.product_code = #{productCode}</if>
|
<if test="status != null "> and thisTab.status = #{status}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectTmsProductInfoById" parameterType="Integer" resultMap="TmsProductInfoResult">
|
<include refid="selectTmsProductInfoVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectTmsProductInfoCount" parameterType="com.ruoyi.tms.domain.TmsProductInfo" resultType="int">
|
<include refid="selectTmsProductInfoVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectTmsProductInfoList" parameterType="com.ruoyi.tms.domain.TmsProductInfo" resultMap="TmsProductInfoResult">
|
<include refid="selectTmsProductInfoVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertTmsProductInfo" parameterType="com.ruoyi.tms.domain.TmsProductInfo" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_product_info
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="customerId != null">customer_id,</if>
|
<if test="customer != null and customer != ''">customer,</if>
|
<if test="productCode != null and productCode != ''">product_code,</if>
|
<if test="productName != null and productName != ''">product_name,</if>
|
<if test="grossWeight != null">gross_weight,</if>
|
<if test="netWeight != null">net_weight,</if>
|
<if test="volume != null">volume,</if>
|
<if test="specModel != null">spec_model,</if>
|
<if test="productType != null">product_type,</if>
|
<if test="packUnit != null">pack_unit,</if>
|
<if test="packLength != null">pack_length,</if>
|
<if test="packWidth != null">pack_width,</if>
|
<if test="packHeight != null">pack_height,</if>
|
<if test="temperatureRequired != null">temperature_required,</if>
|
<if test="maxTemperature != null">max_temperature,</if>
|
<if test="minTemperature != null">min_temperature,</if>
|
<if test="maxHumidity != null">max_humidity,</if>
|
<if test="minHumidity != null">min_humidity,</if>
|
<if test="isHazardous != null">is_hazardous,</if>
|
<if test="status != null">status,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="remark != null">remark,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="customerId != null">#{customerId},</if>
|
<if test="customer != null and customer != ''">#{customer},</if>
|
<if test="productCode != null and productCode != ''">#{productCode},</if>
|
<if test="productName != null and productName != ''">#{productName},</if>
|
<if test="grossWeight != null">#{grossWeight},</if>
|
<if test="netWeight != null">#{netWeight},</if>
|
<if test="volume != null">#{volume},</if>
|
<if test="specModel != null">#{specModel},</if>
|
<if test="productType != null">#{productType},</if>
|
<if test="packUnit != null">#{packUnit},</if>
|
<if test="packLength != null">#{packLength},</if>
|
<if test="packWidth != null">#{packWidth},</if>
|
<if test="packHeight != null">#{packHeight},</if>
|
<if test="temperatureRequired != null">#{temperatureRequired},</if>
|
<if test="maxTemperature != null">#{maxTemperature},</if>
|
<if test="minTemperature != null">#{minTemperature},</if>
|
<if test="maxHumidity != null">#{maxHumidity},</if>
|
<if test="minHumidity != null">#{minHumidity},</if>
|
<if test="isHazardous != null">#{isHazardous},</if>
|
<if test="status != null">#{status},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="remark != null">#{remark},</if>
|
</trim>
|
</insert>
|
|
<insert id="insertTmsProductInfoBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_product_info
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
id,customer_id,customer,product_code,product_name,gross_weight,net_weight,volume,spec_model,product_type,pack_unit,pack_length,pack_width,pack_height,temperature_required,max_temperature,min_temperature,max_humidity,min_humidity,is_hazardous,status,create_by,create_time,update_by,update_time,remark,
|
</trim>
|
<foreach item="item" index="index" collection="list" separator=",">
|
<trim prefix="(" suffix=") " suffixOverrides=",">
|
#{item.id},#{item.customerId},#{item.customer},#{item.productCode},#{item.productName},#{item.grossWeight},#{item.netWeight},#{item.volume},#{item.specModel},#{item.productType},#{item.packUnit},#{item.packLength},#{item.packWidth},#{item.packHeight},#{item.temperatureRequired},#{item.maxTemperature},#{item.minTemperature},#{item.maxHumidity},#{item.minHumidity},#{item.isHazardous},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updateTmsProductInfo" parameterType="com.ruoyi.tms.domain.TmsProductInfo">
|
update tms_product_info
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="customerId != null">customer_id = #{customerId},</if>
|
<if test="customer != null and customer != ''">customer = #{customer},</if>
|
<if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
|
<if test="productName != null and productName != ''">product_name = #{productName},</if>
|
<if test="grossWeight != null">gross_weight = #{grossWeight},</if>
|
<if test="netWeight != null">net_weight = #{netWeight},</if>
|
<if test="volume != null">volume = #{volume},</if>
|
<if test="specModel != null">spec_model = #{specModel},</if>
|
<if test="productType != null">product_type = #{productType},</if>
|
<if test="packUnit != null">pack_unit = #{packUnit},</if>
|
<if test="packLength != null">pack_length = #{packLength},</if>
|
<if test="packWidth != null">pack_width = #{packWidth},</if>
|
<if test="packHeight != null">pack_height = #{packHeight},</if>
|
<if test="temperatureRequired != null">temperature_required = #{temperatureRequired},</if>
|
<if test="maxTemperature != null">max_temperature = #{maxTemperature},</if>
|
<if test="minTemperature != null">min_temperature = #{minTemperature},</if>
|
<if test="maxHumidity != null">max_humidity = #{maxHumidity},</if>
|
<if test="minHumidity != null">min_humidity = #{minHumidity},</if>
|
<if test="isHazardous != null">is_hazardous = #{isHazardous},</if>
|
<if test="status != null">status = #{status},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updateTmsProductInfoBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update tms_product_info
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.customerId != null">customer_id = #{item.customerId},</if>
|
<if test="item.customer != null and item.customer != ''">customer = #{item.customer},</if>
|
<if test="item.productCode != null and item.productCode != ''">product_code = #{item.productCode},</if>
|
<if test="item.productName != null and item.productName != ''">product_name = #{item.productName},</if>
|
<if test="item.grossWeight != null">gross_weight = #{item.grossWeight},</if>
|
<if test="item.netWeight != null">net_weight = #{item.netWeight},</if>
|
<if test="item.volume != null">volume = #{item.volume},</if>
|
<if test="item.specModel != null">spec_model = #{item.specModel},</if>
|
<if test="item.productType != null">product_type = #{item.productType},</if>
|
<if test="item.packUnit != null">pack_unit = #{item.packUnit},</if>
|
<if test="item.packLength != null">pack_length = #{item.packLength},</if>
|
<if test="item.packWidth != null">pack_width = #{item.packWidth},</if>
|
<if test="item.packHeight != null">pack_height = #{item.packHeight},</if>
|
<if test="item.temperatureRequired != null">temperature_required = #{item.temperatureRequired},</if>
|
<if test="item.maxTemperature != null">max_temperature = #{item.maxTemperature},</if>
|
<if test="item.minTemperature != null">min_temperature = #{item.minTemperature},</if>
|
<if test="item.maxHumidity != null">max_humidity = #{item.maxHumidity},</if>
|
<if test="item.minHumidity != null">min_humidity = #{item.minHumidity},</if>
|
<if test="item.isHazardous != null">is_hazardous = #{item.isHazardous},</if>
|
<if test="item.status != null">status = #{item.status},</if>
|
<if test="item.createBy != null">create_by = #{item.createBy},</if>
|
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
<if test="item.updateBy != null">update_by = #{item.updateBy},</if>
|
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
|
<if test="item.remark != null">remark = #{item.remark},</if>
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<!--删除-->
|
<delete id="deleteTmsProductInfoById" parameterType="Integer">
|
delete from tms_product_info where id = #{id}
|
</delete>
|
<delete id="deleteTmsProductInfoByIds" parameterType="Integer">
|
delete from tms_product_info where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|