|
@@ -0,0 +1,301 @@
|
|
|
+<?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.steerinfo.dil.mapper.TmstruckWeightBatchMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckWeightBatch">
|
|
|
+ <id column="WEIGHT_BATCH_ID" jdbcType="DECIMAL" property="weightBatchId" />
|
|
|
+ <result column="BATCH_NET_WEIGHT" jdbcType="DECIMAL" property="batchNetWeight" />
|
|
|
+ <result column="BATCH_GROSS_WEIGHT" jdbcType="DECIMAL" property="batchGrossWeight" />
|
|
|
+ <result column="BATCH_TARE_WEIGHT" jdbcType="DECIMAL" property="batchTareWeight" />
|
|
|
+ <result column="BATCH_TARE_WEIGHT_TIME" jdbcType="TIMESTAMP" property="batchTareWeightTime" />
|
|
|
+ <result column="BATCH_REMARK" jdbcType="VARCHAR" property="batchRemark" />
|
|
|
+ <result column="BATCH_GROSS_WEIGHT_TIME" jdbcType="TIMESTAMP" property="batchGrossWeightTime" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="columns">
|
|
|
+ WEIGHT_BATCH_ID, BATCH_NET_WEIGHT, BATCH_GROSS_WEIGHT, BATCH_TARE_WEIGHT, BATCH_TARE_WEIGHT_TIME,
|
|
|
+ BATCH_REMARK, BATCH_GROSS_WEIGHT_TIME
|
|
|
+ </sql>
|
|
|
+ <sql id="columns_alias">
|
|
|
+ t.WEIGHT_BATCH_ID, t.BATCH_NET_WEIGHT, t.BATCH_GROSS_WEIGHT, t.BATCH_TARE_WEIGHT,
|
|
|
+ t.BATCH_TARE_WEIGHT_TIME, t.BATCH_REMARK, t.BATCH_GROSS_WEIGHT_TIME
|
|
|
+ </sql>
|
|
|
+ <sql id="select">
|
|
|
+ SELECT <include refid="columns" /> FROM TMSTRUCK_WEIGHT_BATCH
|
|
|
+ </sql>
|
|
|
+ <sql id="select_alias">
|
|
|
+ SELECT <include refid="columns_alias" /> FROM TMSTRUCK_WEIGHT_BATCH t
|
|
|
+ </sql>
|
|
|
+ <sql id="where">
|
|
|
+ <where>
|
|
|
+ <if test="weightBatchId != null">
|
|
|
+ and WEIGHT_BATCH_ID = #{weightBatchId}
|
|
|
+ </if>
|
|
|
+ <if test="batchNetWeight != null">
|
|
|
+ and BATCH_NET_WEIGHT = #{batchNetWeight}
|
|
|
+ </if>
|
|
|
+ <if test="batchGrossWeight != null">
|
|
|
+ and BATCH_GROSS_WEIGHT = #{batchGrossWeight}
|
|
|
+ </if>
|
|
|
+ <if test="batchTareWeight != null">
|
|
|
+ and BATCH_TARE_WEIGHT = #{batchTareWeight}
|
|
|
+ </if>
|
|
|
+ <if test="batchTareWeightTime != null">
|
|
|
+ and TO_CHAR(BATCH_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{batchTareWeightTime}
|
|
|
+ </if>
|
|
|
+ <if test="batchRemark != null and batchRemark != ''">
|
|
|
+ and BATCH_REMARK = #{batchRemark}
|
|
|
+ </if>
|
|
|
+ <if test="batchGrossWeightTime != null">
|
|
|
+ and TO_CHAR(BATCH_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{batchGrossWeightTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="whereLike">
|
|
|
+ <where>
|
|
|
+ <if test="weightBatchId != null">
|
|
|
+ and WEIGHT_BATCH_ID = #{weightBatchId}
|
|
|
+ </if>
|
|
|
+ <if test="batchNetWeight != null">
|
|
|
+ and BATCH_NET_WEIGHT = #{batchNetWeight}
|
|
|
+ </if>
|
|
|
+ <if test="batchGrossWeight != null">
|
|
|
+ and BATCH_GROSS_WEIGHT = #{batchGrossWeight}
|
|
|
+ </if>
|
|
|
+ <if test="batchTareWeight != null">
|
|
|
+ and BATCH_TARE_WEIGHT = #{batchTareWeight}
|
|
|
+ </if>
|
|
|
+ <if test="batchTareWeightTime != null">
|
|
|
+ and TO_CHAR(BATCH_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{batchTareWeightTime}
|
|
|
+ </if>
|
|
|
+ <if test="batchRemark != null and batchRemark != ''">
|
|
|
+ and BATCH_REMARK LIKE '%${batchRemark}%'
|
|
|
+ </if>
|
|
|
+ <if test="batchGrossWeightTime != null">
|
|
|
+ and TO_CHAR(BATCH_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{batchGrossWeightTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
|
+ delete from TMSTRUCK_WEIGHT_BATCH
|
|
|
+ where WEIGHT_BATCH_ID = #{weightBatchId,jdbcType=DECIMAL}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
+ delete from TMSTRUCK_WEIGHT_BATCH
|
|
|
+ where 1!=1
|
|
|
+ <if test="batchNetWeight != null">
|
|
|
+ or BATCH_NET_WEIGHT = #{batchNetWeight}
|
|
|
+ </if>
|
|
|
+ <if test="batchGrossWeight != null">
|
|
|
+ or BATCH_GROSS_WEIGHT = #{batchGrossWeight}
|
|
|
+ </if>
|
|
|
+ <if test="batchTareWeight != null">
|
|
|
+ or BATCH_TARE_WEIGHT = #{batchTareWeight}
|
|
|
+ </if>
|
|
|
+ <if test="batchTareWeightTime != null">
|
|
|
+ or TO_CHAR(BATCH_TARE_WEIGHT_TIME,'yyyy-MM-dd') = '#{batchTareWeightTime}'
|
|
|
+ </if>
|
|
|
+ <if test="batchRemark != null and batchRemark != ''">
|
|
|
+ or BATCH_REMARK = #{batchRemark}
|
|
|
+ </if>
|
|
|
+ <if test="batchGrossWeightTime != null">
|
|
|
+ or TO_CHAR(BATCH_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = '#{batchGrossWeightTime}'
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckWeightBatch">
|
|
|
+ insert into TMSTRUCK_WEIGHT_BATCH (WEIGHT_BATCH_ID, BATCH_NET_WEIGHT, BATCH_GROSS_WEIGHT,
|
|
|
+ BATCH_TARE_WEIGHT, BATCH_TARE_WEIGHT_TIME,
|
|
|
+ BATCH_REMARK, BATCH_GROSS_WEIGHT_TIME)
|
|
|
+ values (#{weightBatchId,jdbcType=DECIMAL}, #{batchNetWeight,jdbcType=DECIMAL}, #{batchGrossWeight,jdbcType=DECIMAL},
|
|
|
+ #{batchTareWeight,jdbcType=DECIMAL}, #{batchTareWeightTime,jdbcType=TIMESTAMP},
|
|
|
+ #{batchRemark,jdbcType=VARCHAR}, #{batchGrossWeightTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckWeightBatch">
|
|
|
+ insert into TMSTRUCK_WEIGHT_BATCH
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="weightBatchId != null">
|
|
|
+ WEIGHT_BATCH_ID,
|
|
|
+ </if>
|
|
|
+ <if test="batchNetWeight != null">
|
|
|
+ BATCH_NET_WEIGHT,
|
|
|
+ </if>
|
|
|
+ <if test="batchGrossWeight != null">
|
|
|
+ BATCH_GROSS_WEIGHT,
|
|
|
+ </if>
|
|
|
+ <if test="batchTareWeight != null">
|
|
|
+ BATCH_TARE_WEIGHT,
|
|
|
+ </if>
|
|
|
+ <if test="batchTareWeightTime != null">
|
|
|
+ BATCH_TARE_WEIGHT_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="batchRemark != null">
|
|
|
+ BATCH_REMARK,
|
|
|
+ </if>
|
|
|
+ <if test="batchGrossWeightTime != null">
|
|
|
+ BATCH_GROSS_WEIGHT_TIME,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="weightBatchId != null">
|
|
|
+ #{weightBatchId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="batchNetWeight != null">
|
|
|
+ #{batchNetWeight,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="batchGrossWeight != null">
|
|
|
+ #{batchGrossWeight,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="batchTareWeight != null">
|
|
|
+ #{batchTareWeight,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="batchTareWeightTime != null">
|
|
|
+ #{batchTareWeightTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="batchRemark != null">
|
|
|
+ #{batchRemark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="batchGrossWeightTime != null">
|
|
|
+ #{batchGrossWeightTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckWeightBatch">
|
|
|
+ update TMSTRUCK_WEIGHT_BATCH
|
|
|
+ set BATCH_NET_WEIGHT = #{batchNetWeight,jdbcType=DECIMAL},
|
|
|
+ BATCH_GROSS_WEIGHT = #{batchGrossWeight,jdbcType=DECIMAL},
|
|
|
+ BATCH_TARE_WEIGHT = #{batchTareWeight,jdbcType=DECIMAL},
|
|
|
+ BATCH_TARE_WEIGHT_TIME = #{batchTareWeightTime,jdbcType=TIMESTAMP},
|
|
|
+ BATCH_REMARK = #{batchRemark,jdbcType=VARCHAR},
|
|
|
+ BATCH_GROSS_WEIGHT_TIME = #{batchGrossWeightTime,jdbcType=TIMESTAMP}
|
|
|
+ where WEIGHT_BATCH_ID = #{weightBatchId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckWeightBatch">
|
|
|
+ update TMSTRUCK_WEIGHT_BATCH
|
|
|
+ <set>
|
|
|
+ <if test="batchNetWeight != null">
|
|
|
+ BATCH_NET_WEIGHT = #{batchNetWeight,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="batchGrossWeight != null">
|
|
|
+ BATCH_GROSS_WEIGHT = #{batchGrossWeight,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="batchTareWeight != null">
|
|
|
+ BATCH_TARE_WEIGHT = #{batchTareWeight,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="batchTareWeightTime != null">
|
|
|
+ BATCH_TARE_WEIGHT_TIME = #{batchTareWeightTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="batchRemark != null">
|
|
|
+ BATCH_REMARK = #{batchRemark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="batchGrossWeightTime != null">
|
|
|
+ BATCH_GROSS_WEIGHT_TIME = #{batchGrossWeightTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where WEIGHT_BATCH_ID = #{weightBatchId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
|
|
|
+ <include refid="select" />
|
|
|
+ where WEIGHT_BATCH_ID = #{weightBatchId,jdbcType=DECIMAL}
|
|
|
+ </select>
|
|
|
+ <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
+ <include refid="select" />
|
|
|
+ <include refid="where" />
|
|
|
+ </select>
|
|
|
+ <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
+ <include refid="select" />
|
|
|
+ <include refid="whereLike" />
|
|
|
+ </select>
|
|
|
+ <insert id="batchInsert" parameterType="java.util.List">
|
|
|
+ insert into TMSTRUCK_WEIGHT_BATCH
|
|
|
+ (WEIGHT_BATCH_ID,
|
|
|
+ BATCH_NET_WEIGHT, BATCH_GROSS_WEIGHT,
|
|
|
+ BATCH_TARE_WEIGHT, BATCH_TARE_WEIGHT_TIME,
|
|
|
+ BATCH_REMARK, BATCH_GROSS_WEIGHT_TIME
|
|
|
+ )
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
+ select
|
|
|
+ #{item.weightBatchId,jdbcType=DECIMAL},
|
|
|
+ #{item.batchNetWeight,jdbcType=DECIMAL}, #{item.batchGrossWeight,jdbcType=DECIMAL},
|
|
|
+ #{item.batchTareWeight,jdbcType=DECIMAL}, #{item.batchTareWeightTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.batchRemark,jdbcType=VARCHAR}, #{item.batchGrossWeightTime,jdbcType=TIMESTAMP}
|
|
|
+ from dual
|
|
|
+ </foreach> )
|
|
|
+ </insert>
|
|
|
+ <update id="batchUpdate" parameterType="java.util.List">
|
|
|
+ update TMSTRUCK_WEIGHT_BATCH
|
|
|
+ set
|
|
|
+ WEIGHT_BATCH_ID=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_BATCH_ID" separator=" ">
|
|
|
+ when #{item.weightBatchId,jdbcType=DECIMAL} then #{item.weightBatchId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,BATCH_NET_WEIGHT=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_BATCH_ID" separator=" ">
|
|
|
+ when #{item.weightBatchId,jdbcType=DECIMAL} then #{item.batchNetWeight,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,BATCH_GROSS_WEIGHT=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_BATCH_ID" separator=" ">
|
|
|
+ when #{item.weightBatchId,jdbcType=DECIMAL} then #{item.batchGrossWeight,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,BATCH_TARE_WEIGHT=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_BATCH_ID" separator=" ">
|
|
|
+ when #{item.weightBatchId,jdbcType=DECIMAL} then #{item.batchTareWeight,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,BATCH_TARE_WEIGHT_TIME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_BATCH_ID" separator=" ">
|
|
|
+ when #{item.weightBatchId,jdbcType=DECIMAL} then #{item.batchTareWeightTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,BATCH_REMARK=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_BATCH_ID" separator=" ">
|
|
|
+ when #{item.weightBatchId,jdbcType=DECIMAL} then #{item.batchRemark,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,BATCH_GROSS_WEIGHT_TIME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_BATCH_ID" separator=" ">
|
|
|
+ when #{item.weightBatchId,jdbcType=DECIMAL} then #{item.batchGrossWeightTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ where WEIGHT_BATCH_ID in
|
|
|
+ <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
|
|
|
+ #{item.weightBatchId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="batchDelete" parameterType="java.util.List">
|
|
|
+ delete from TMSTRUCK_WEIGHT_BATCH
|
|
|
+ where WEIGHT_BATCH_ID in
|
|
|
+ <foreach close=")" collection="list" item="id" open="(" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <!-- 友情提示!!!-->
|
|
|
+ <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
+ <update id="updateFluMes">
|
|
|
+ UPDATE AMS_SALE_MATERIAL ASM
|
|
|
+ SET ASM.INSERT_UPDATE_REMARK = '绑定计量批次ID'
|
|
|
+ <if test="goodNum != null">
|
|
|
+ ,ASM.MATERIAL_NUMBER = #{goodNum}
|
|
|
+ </if>
|
|
|
+ <if test="theoryWeight != null">
|
|
|
+ ,ASM.MATERIAL_WEIGHT = #{theoryWeight}
|
|
|
+ </if>
|
|
|
+ <if test="weightBatchId != null">
|
|
|
+ ,ASM.weight_batch_id = #{weightBatchId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ WHERE ASM.EAS_PRIMARY_ID = #{FLID}
|
|
|
+ </update>
|
|
|
+ <update id="updateOmMes">
|
|
|
+ UPDATE OMSTRUCK_ORDER_MATERIAL OOM
|
|
|
+ SET OOM.INSERT_UPDATE_REMARK = '修改理重、件数'
|
|
|
+ <if test="goodNum != null">
|
|
|
+ ,OOM.ORDER_MATERIAL_NUMBER = #{goodNum}
|
|
|
+ </if>
|
|
|
+ <if test="theoryWeight != null">
|
|
|
+ ,OOM.ORDER_MATERIAL_WEIGHT = #{theoryWeight}
|
|
|
+ </if>
|
|
|
+ WHERE OOM.SALE_MATERIAL_ID = (SELECT ASM.SALE_MATERIAL_ID FROM AMS_SALE_MATERIAL ASM
|
|
|
+ WHERE ASM.EAS_PRIMARY_ID = #{FLID})
|
|
|
+ </update>
|
|
|
+ <update id="updateAmsFluToNull">
|
|
|
+ UPDATE AMS_SALE_MATERIAL ASM
|
|
|
+ SET ASM.WEIGHT_BATCH_ID = NULL,
|
|
|
+ ASM.SALE_MAKE_DATE = NULL
|
|
|
+ WHERE ASM.WEIGHT_BATCH_ID = #{weightBatchId}
|
|
|
+ </update>
|
|
|
+</mapper>
|