|
@@ -0,0 +1,588 @@
|
|
|
+<?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.AmstruckPurplanMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmstruckPurplan">
|
|
|
+ <id column="PLAN_ID" jdbcType="DECIMAL" property="planId" />
|
|
|
+ <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId" />
|
|
|
+ <result column="PLAN_NO" jdbcType="VARCHAR" property="planNo" />
|
|
|
+ <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
|
|
|
+ <result column="PLAN_TRUCK_NUMBER" jdbcType="DECIMAL" property="planTruckNumber" />
|
|
|
+ <result column="CAPACITY_TYPE_ID" jdbcType="DECIMAL" property="capacityTypeId" />
|
|
|
+ <result column="PLAN_TRUCK_TIME" jdbcType="TIMESTAMP" property="planTruckTime" />
|
|
|
+ <result column="PLAN_STATUS" jdbcType="DECIMAL" property="planStatus" />
|
|
|
+ <result column="MATERIAL_TOTAL_WEIGHT" jdbcType="DECIMAL" property="materialTotalWeight" />
|
|
|
+ <result column="PLAN_INCOMING_TIME" jdbcType="TIMESTAMP" property="planIncomingTime" />
|
|
|
+ <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
|
|
|
+ <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
|
|
|
+ <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
|
|
|
+ <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
+ <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="columns">
|
|
|
+ PLAN_ID, BATCH_ID, PLAN_NO, CARRIER_ID, PLAN_TRUCK_NUMBER, CAPACITY_TYPE_ID, PLAN_TRUCK_TIME,
|
|
|
+ PLAN_STATUS, MATERIAL_TOTAL_WEIGHT, PLAN_INCOMING_TIME, INSERT_USERNAME, INSERT_TIME,
|
|
|
+ UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
|
|
|
+ </sql>
|
|
|
+ <sql id="columns_alias">
|
|
|
+ t.PLAN_ID, t.BATCH_ID, t.PLAN_NO, t.CARRIER_ID, t.PLAN_TRUCK_NUMBER, t.CAPACITY_TYPE_ID,
|
|
|
+ t.PLAN_TRUCK_TIME, t.PLAN_STATUS, t.MATERIAL_TOTAL_WEIGHT, t.PLAN_INCOMING_TIME,
|
|
|
+ t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
|
|
|
+ </sql>
|
|
|
+ <sql id="select">
|
|
|
+ SELECT <include refid="columns" /> FROM AMSTRUCK_PURPLAN
|
|
|
+ </sql>
|
|
|
+ <sql id="select_alias">
|
|
|
+ SELECT <include refid="columns_alias" /> FROM AMSTRUCK_PURPLAN t
|
|
|
+ </sql>
|
|
|
+ <sql id="where">
|
|
|
+ <where>
|
|
|
+ <if test="planId != null">
|
|
|
+ and PLAN_ID = #{planId}
|
|
|
+ </if>
|
|
|
+ <if test="batchId != null">
|
|
|
+ and BATCH_ID = #{batchId}
|
|
|
+ </if>
|
|
|
+ <if test="planNo != null and planNo != ''">
|
|
|
+ and PLAN_NO = #{planNo}
|
|
|
+ </if>
|
|
|
+ <if test="carrierId != null">
|
|
|
+ and CARRIER_ID = #{carrierId}
|
|
|
+ </if>
|
|
|
+ <if test="planTruckNumber != null">
|
|
|
+ and PLAN_TRUCK_NUMBER = #{planTruckNumber}
|
|
|
+ </if>
|
|
|
+ <if test="capacityTypeId != null">
|
|
|
+ and CAPACITY_TYPE_ID = #{capacityTypeId}
|
|
|
+ </if>
|
|
|
+ <if test="planTruckTime != null">
|
|
|
+ and TO_CHAR(PLAN_TRUCK_TIME,'yyyy-MM-dd') = #{planTruckTime}
|
|
|
+ </if>
|
|
|
+ <if test="planStatus != null">
|
|
|
+ and PLAN_STATUS = #{planStatus}
|
|
|
+ </if>
|
|
|
+ <if test="materialTotalWeight != null">
|
|
|
+ and MATERIAL_TOTAL_WEIGHT = #{materialTotalWeight}
|
|
|
+ </if>
|
|
|
+ <if test="planIncomingTime != null">
|
|
|
+ and TO_CHAR(PLAN_INCOMING_TIME,'yyyy-MM-dd') = #{planIncomingTime}
|
|
|
+ </if>
|
|
|
+ <if test="insertUsername != null and insertUsername != ''">
|
|
|
+ and INSERT_USERNAME = #{insertUsername}
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
|
|
|
+ </if>
|
|
|
+ <if test="updateUsername != null and updateUsername != ''">
|
|
|
+ and UPDATE_USERNAME = #{updateUsername}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
|
|
|
+ </if>
|
|
|
+ <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
|
|
|
+ and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="whereLike">
|
|
|
+ <where>
|
|
|
+ <if test="planId != null">
|
|
|
+ and PLAN_ID = #{planId}
|
|
|
+ </if>
|
|
|
+ <if test="batchId != null">
|
|
|
+ and BATCH_ID = #{batchId}
|
|
|
+ </if>
|
|
|
+ <if test="planNo != null and planNo != ''">
|
|
|
+ and PLAN_NO LIKE '%${planNo}%'
|
|
|
+ </if>
|
|
|
+ <if test="carrierId != null">
|
|
|
+ and CARRIER_ID = #{carrierId}
|
|
|
+ </if>
|
|
|
+ <if test="planTruckNumber != null">
|
|
|
+ and PLAN_TRUCK_NUMBER = #{planTruckNumber}
|
|
|
+ </if>
|
|
|
+ <if test="capacityTypeId != null">
|
|
|
+ and CAPACITY_TYPE_ID = #{capacityTypeId}
|
|
|
+ </if>
|
|
|
+ <if test="planTruckTime != null">
|
|
|
+ and TO_CHAR(PLAN_TRUCK_TIME,'yyyy-MM-dd') = #{planTruckTime}
|
|
|
+ </if>
|
|
|
+ <if test="planStatus != null">
|
|
|
+ and PLAN_STATUS = #{planStatus}
|
|
|
+ </if>
|
|
|
+ <if test="materialTotalWeight != null">
|
|
|
+ and MATERIAL_TOTAL_WEIGHT = #{materialTotalWeight}
|
|
|
+ </if>
|
|
|
+ <if test="planIncomingTime != null">
|
|
|
+ and TO_CHAR(PLAN_INCOMING_TIME,'yyyy-MM-dd') = #{planIncomingTime}
|
|
|
+ </if>
|
|
|
+ <if test="insertUsername != null and insertUsername != ''">
|
|
|
+ and INSERT_USERNAME LIKE '%${insertUsername}%'
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
|
|
|
+ </if>
|
|
|
+ <if test="updateUsername != null and updateUsername != ''">
|
|
|
+ and UPDATE_USERNAME LIKE '%${updateUsername}%'
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
|
|
|
+ </if>
|
|
|
+ <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
|
|
|
+ and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
|
+ delete from AMSTRUCK_PURPLAN
|
|
|
+ where PLAN_ID = #{planId,jdbcType=DECIMAL}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
+ delete from AMSTRUCK_PURPLAN
|
|
|
+ where 1!=1
|
|
|
+ <if test="batchId != null">
|
|
|
+ or BATCH_ID = #{batchId}
|
|
|
+ </if>
|
|
|
+ <if test="planNo != null and planNo != ''">
|
|
|
+ or PLAN_NO = #{planNo}
|
|
|
+ </if>
|
|
|
+ <if test="carrierId != null">
|
|
|
+ or CARRIER_ID = #{carrierId}
|
|
|
+ </if>
|
|
|
+ <if test="planTruckNumber != null">
|
|
|
+ or PLAN_TRUCK_NUMBER = #{planTruckNumber}
|
|
|
+ </if>
|
|
|
+ <if test="capacityTypeId != null">
|
|
|
+ or CAPACITY_TYPE_ID = #{capacityTypeId}
|
|
|
+ </if>
|
|
|
+ <if test="planTruckTime != null">
|
|
|
+ or TO_CHAR(PLAN_TRUCK_TIME,'yyyy-MM-dd') = '#{planTruckTime}'
|
|
|
+ </if>
|
|
|
+ <if test="planStatus != null">
|
|
|
+ or PLAN_STATUS = #{planStatus}
|
|
|
+ </if>
|
|
|
+ <if test="materialTotalWeight != null">
|
|
|
+ or MATERIAL_TOTAL_WEIGHT = #{materialTotalWeight}
|
|
|
+ </if>
|
|
|
+ <if test="planIncomingTime != null">
|
|
|
+ or TO_CHAR(PLAN_INCOMING_TIME,'yyyy-MM-dd') = '#{planIncomingTime}'
|
|
|
+ </if>
|
|
|
+ <if test="insertUsername != null and insertUsername != ''">
|
|
|
+ or INSERT_USERNAME = #{insertUsername}
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
|
|
|
+ </if>
|
|
|
+ <if test="updateUsername != null and updateUsername != ''">
|
|
|
+ or UPDATE_USERNAME = #{updateUsername}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
|
|
|
+ </if>
|
|
|
+ <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
|
|
|
+ or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.steerinfo.dil.model.AmstruckPurplan">
|
|
|
+ insert into AMSTRUCK_PURPLAN (PLAN_ID, BATCH_ID, PLAN_NO,
|
|
|
+ CARRIER_ID, PLAN_TRUCK_NUMBER, CAPACITY_TYPE_ID,
|
|
|
+ PLAN_TRUCK_TIME, PLAN_STATUS, MATERIAL_TOTAL_WEIGHT,
|
|
|
+ PLAN_INCOMING_TIME, INSERT_USERNAME, INSERT_TIME,
|
|
|
+ UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
|
|
|
+ )
|
|
|
+ values (#{planId,jdbcType=DECIMAL}, #{batchId,jdbcType=DECIMAL}, #{planNo,jdbcType=VARCHAR},
|
|
|
+ #{carrierId,jdbcType=DECIMAL}, #{planTruckNumber,jdbcType=DECIMAL}, #{capacityTypeId,jdbcType=DECIMAL},
|
|
|
+ #{planTruckTime,jdbcType=TIMESTAMP}, #{planStatus,jdbcType=DECIMAL}, #{materialTotalWeight,jdbcType=DECIMAL},
|
|
|
+ #{planIncomingTime,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
|
|
|
+ #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmstruckPurplan">
|
|
|
+ insert into AMSTRUCK_PURPLAN
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="planId != null">
|
|
|
+ PLAN_ID,
|
|
|
+ </if>
|
|
|
+ <if test="batchId != null">
|
|
|
+ BATCH_ID,
|
|
|
+ </if>
|
|
|
+ <if test="planNo != null">
|
|
|
+ PLAN_NO,
|
|
|
+ </if>
|
|
|
+ <if test="carrierId != null">
|
|
|
+ CARRIER_ID,
|
|
|
+ </if>
|
|
|
+ <if test="planTruckNumber != null">
|
|
|
+ PLAN_TRUCK_NUMBER,
|
|
|
+ </if>
|
|
|
+ <if test="capacityTypeId != null">
|
|
|
+ CAPACITY_TYPE_ID,
|
|
|
+ </if>
|
|
|
+ <if test="planTruckTime != null">
|
|
|
+ PLAN_TRUCK_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="planStatus != null">
|
|
|
+ PLAN_STATUS,
|
|
|
+ </if>
|
|
|
+ <if test="materialTotalWeight != null">
|
|
|
+ MATERIAL_TOTAL_WEIGHT,
|
|
|
+ </if>
|
|
|
+ <if test="planIncomingTime != null">
|
|
|
+ PLAN_INCOMING_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="insertUsername != null">
|
|
|
+ INSERT_USERNAME,
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ INSERT_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="updateUsername != null">
|
|
|
+ UPDATE_USERNAME,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ UPDATE_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="insertUpdateRemark != null">
|
|
|
+ INSERT_UPDATE_REMARK,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="planId != null">
|
|
|
+ #{planId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="batchId != null">
|
|
|
+ #{batchId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="planNo != null">
|
|
|
+ #{planNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="carrierId != null">
|
|
|
+ #{carrierId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="planTruckNumber != null">
|
|
|
+ #{planTruckNumber,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="capacityTypeId != null">
|
|
|
+ #{capacityTypeId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="planTruckTime != null">
|
|
|
+ #{planTruckTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="planStatus != null">
|
|
|
+ #{planStatus,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="materialTotalWeight != null">
|
|
|
+ #{materialTotalWeight,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="planIncomingTime != null">
|
|
|
+ #{planIncomingTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="insertUsername != null">
|
|
|
+ #{insertUsername,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ #{insertTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updateUsername != null">
|
|
|
+ #{updateUsername,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="insertUpdateRemark != null">
|
|
|
+ #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmstruckPurplan">
|
|
|
+ update AMSTRUCK_PURPLAN
|
|
|
+ set BATCH_ID = #{batchId,jdbcType=DECIMAL},
|
|
|
+ PLAN_NO = #{planNo,jdbcType=VARCHAR},
|
|
|
+ CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
|
|
|
+ PLAN_TRUCK_NUMBER = #{planTruckNumber,jdbcType=DECIMAL},
|
|
|
+ CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
|
|
|
+ PLAN_TRUCK_TIME = #{planTruckTime,jdbcType=TIMESTAMP},
|
|
|
+ PLAN_STATUS = #{planStatus,jdbcType=DECIMAL},
|
|
|
+ MATERIAL_TOTAL_WEIGHT = #{materialTotalWeight,jdbcType=DECIMAL},
|
|
|
+ PLAN_INCOMING_TIME = #{planIncomingTime,jdbcType=TIMESTAMP},
|
|
|
+ INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
|
|
|
+ INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
|
|
|
+ UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
|
|
|
+ UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
|
|
|
+ where PLAN_ID = #{planId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmstruckPurplan">
|
|
|
+ update AMSTRUCK_PURPLAN
|
|
|
+ <set>
|
|
|
+ <if test="batchId != null">
|
|
|
+ BATCH_ID = #{batchId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="planNo != null">
|
|
|
+ PLAN_NO = #{planNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="carrierId != null">
|
|
|
+ CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="planTruckNumber != null">
|
|
|
+ PLAN_TRUCK_NUMBER = #{planTruckNumber,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="capacityTypeId != null">
|
|
|
+ CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="planTruckTime != null">
|
|
|
+ PLAN_TRUCK_TIME = #{planTruckTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="planStatus != null">
|
|
|
+ PLAN_STATUS = #{planStatus,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="materialTotalWeight != null">
|
|
|
+ MATERIAL_TOTAL_WEIGHT = #{materialTotalWeight,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="planIncomingTime != null">
|
|
|
+ PLAN_INCOMING_TIME = #{planIncomingTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="insertUsername != null">
|
|
|
+ INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updateUsername != null">
|
|
|
+ UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="insertUpdateRemark != null">
|
|
|
+ INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where PLAN_ID = #{planId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
|
|
|
+ <include refid="select" />
|
|
|
+ where PLAN_ID = #{planId,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 AMSTRUCK_PURPLAN
|
|
|
+ (PLAN_ID,
|
|
|
+ BATCH_ID, PLAN_NO, CARRIER_ID,
|
|
|
+ PLAN_TRUCK_NUMBER, CAPACITY_TYPE_ID,
|
|
|
+ PLAN_TRUCK_TIME, PLAN_STATUS,
|
|
|
+ MATERIAL_TOTAL_WEIGHT, PLAN_INCOMING_TIME,
|
|
|
+ INSERT_USERNAME, INSERT_TIME,
|
|
|
+ UPDATE_USERNAME, UPDATE_TIME,
|
|
|
+ INSERT_UPDATE_REMARK)
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
+ select
|
|
|
+ #{item.planId,jdbcType=DECIMAL},
|
|
|
+ #{item.batchId,jdbcType=DECIMAL}, #{item.planNo,jdbcType=VARCHAR}, #{item.carrierId,jdbcType=DECIMAL},
|
|
|
+ #{item.planTruckNumber,jdbcType=DECIMAL}, #{item.capacityTypeId,jdbcType=DECIMAL},
|
|
|
+ #{item.planTruckTime,jdbcType=TIMESTAMP}, #{item.planStatus,jdbcType=DECIMAL},
|
|
|
+ #{item.materialTotalWeight,jdbcType=DECIMAL}, #{item.planIncomingTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
|
|
|
+ </foreach> )
|
|
|
+ </insert>
|
|
|
+ <update id="batchUpdate" parameterType="java.util.List">
|
|
|
+ update AMSTRUCK_PURPLAN
|
|
|
+ set
|
|
|
+ PLAN_ID=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.planId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,BATCH_ID=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,PLAN_NO=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.planNo,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,CARRIER_ID=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,PLAN_TRUCK_NUMBER=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.planTruckNumber,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,CAPACITY_TYPE_ID=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.capacityTypeId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,PLAN_TRUCK_TIME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.planTruckTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,PLAN_STATUS=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.planStatus,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,MATERIAL_TOTAL_WEIGHT=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.materialTotalWeight,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,PLAN_INCOMING_TIME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.planIncomingTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_USERNAME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_TIME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_USERNAME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_TIME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_UPDATE_REMARK=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case PLAN_ID" separator=" ">
|
|
|
+ when #{item.planId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ where PLAN_ID in
|
|
|
+ <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
|
|
|
+ #{item.planId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+ <delete id="batchDelete" parameterType="java.util.List">
|
|
|
+ delete from AMSTRUCK_PURPLAN
|
|
|
+ where PLAN_ID in
|
|
|
+ <foreach close=")" collection="list" item="id" open="(" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <!-- 友情提示!!!-->
|
|
|
+ <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
+
|
|
|
+ <sql id="orderBy">
|
|
|
+ <if test="orderField != null and orderField != ''">
|
|
|
+ order by "${orderField}"
|
|
|
+ <if test="orderType != null and orderType != ''">
|
|
|
+ ${orderType}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 通过状态 0:未下发 1:已下发 查询运输计划 -->
|
|
|
+ <select id="getAllPurPlan" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from (
|
|
|
+ select
|
|
|
+ AP.PLAN_ID "planId",
|
|
|
+ APO.PURCHASE_ORDER_NO "purchaseOrderNo",
|
|
|
+ DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
|
|
|
+ RM.MATERIAL_NAME "materialName",
|
|
|
+ AP.PLAN_NO "planNo",
|
|
|
+ RC.CARRIER_NAME "carrierName",
|
|
|
+ AP.MATERIAL_TOTAL_WEIGHT "materialTotalWeight",
|
|
|
+ AP.PLAN_TRUCK_TIME "planTruckTime",
|
|
|
+ AP.PLAN_INCOMING_TIME "planIncomingTime"
|
|
|
+ from AMSTRUCK_PURPLAN AP
|
|
|
+ left join AMS_PURCHASE_ORDER APO
|
|
|
+ on AP.BATCH_ID = APO.BATCH_ID
|
|
|
+ left join DIL_BATCH DB
|
|
|
+ on AP.BATCH_ID = DB.BATCH_ID
|
|
|
+ left join RMS_MATERIAL RM
|
|
|
+ on RM.MATERIAL_ID = DB.MATERIAL_ID
|
|
|
+ left join RMS_CARRIER RC
|
|
|
+ on AP.CARRIER_ID = RC.CARRIER_ID
|
|
|
+ where AP.PLAN_STATUS = #{planStatus}
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="planId != null">
|
|
|
+ <foreach collection="planId" item="item" open="(" separator="or" close=")">
|
|
|
+ "planId" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="purchaseOrderNo != null">
|
|
|
+ and
|
|
|
+ <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
|
|
|
+ "purchaseOrderNo" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultForeignShipName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
|
|
|
+ "resultForeignShipName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="materialName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="or" close=")">
|
|
|
+ "materialName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="planNo != null">
|
|
|
+ and
|
|
|
+ <foreach collection="planNo" item="item" open="(" separator="or" close=")">
|
|
|
+ "planNo" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="carrierName != null">
|
|
|
+ and
|
|
|
+ <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
|
|
|
+ "carrierName" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="materialTotalWeight != null">
|
|
|
+ and
|
|
|
+ <foreach collection="materialTotalWeight" item="item" open="(" separator="or" close=")">
|
|
|
+ "materialTotalWeight" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="planTruckTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="planTruckTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "planTruckTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="planIncomingTime != null">
|
|
|
+ and
|
|
|
+ <foreach collection="planIncomingTime" item="item" open="(" separator="or" close=")">
|
|
|
+ "planIncomingTime" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "planIncomingTime" desc
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 通过ID查询运输计划 -->
|
|
|
+ <select id="getPurPlanById" parameterType="int" resultType="java.util.Map">
|
|
|
+ select DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
|
|
|
+ DB.MATERIAL_ID "materialId",
|
|
|
+ AP.CARRIER_ID "carrierId",
|
|
|
+ AP.MATERIAL_TOTAL_WEIGHT "materialTotalWeight",
|
|
|
+ AP.PLAN_TRUCK_TIME "planTruckTime",
|
|
|
+ AP.PLAN_INCOMING_TIME "planIncomingTime",
|
|
|
+ AP.BATCH_ID "batchId",
|
|
|
+ AP.PLAN_ID "planId"
|
|
|
+ from AMSTRUCK_PURPLAN AP
|
|
|
+ left join DIL_BATCH DB
|
|
|
+ on AP.BATCH_ID = DB.BATCH_ID
|
|
|
+ where PLAN_ID = #{planId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+</mapper>
|