|
@@ -0,0 +1,638 @@
|
|
|
+<?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.BmstruckDetailsOrderMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
|
+ <id column="DETAILS_ID" jdbcType="DECIMAL" property="detailsId"/>
|
|
|
+ <result column="PURCHASE_ORDER_ID" jdbcType="DECIMAL" property="purchaseOrderId"/>
|
|
|
+ <result column="ORDER_ID" jdbcType="DECIMAL" property="orderId"/>
|
|
|
+ <result column="DETAILS_NO" jdbcType="VARCHAR" property="detailsNo"/>
|
|
|
+ <result column="DETAILS_TIME" jdbcType="TIMESTAMP" property="detailsTime"/>
|
|
|
+ <result column="PRICE_ID" jdbcType="DECIMAL" property="priceId"/>
|
|
|
+ <result column="DETAILS_AMOUNT" jdbcType="DECIMAL" property="detailsAmount"/>
|
|
|
+ <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">
|
|
|
+ DETAILS_ID, PURCHASE_ORDER_ID, ORDER_ID, DETAILS_NO, DETAILS_TIME, PRICE_ID, DETAILS_AMOUNT,
|
|
|
+ INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
|
|
|
+ </sql>
|
|
|
+ <sql id="columns_alias">
|
|
|
+ t.DETAILS_ID, t.PURCHASE_ORDER_ID, t.ORDER_ID, t.DETAILS_NO, t.DETAILS_TIME, t.PRICE_ID,
|
|
|
+ t.DETAILS_AMOUNT, 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 BMSTRUCK_DETAILS_ORDER
|
|
|
+ </sql>
|
|
|
+ <sql id="select_alias">
|
|
|
+ SELECT
|
|
|
+ <include refid="columns_alias"/>
|
|
|
+ FROM BMSTRUCK_DETAILS_ORDER t
|
|
|
+ </sql>
|
|
|
+ <sql id="where">
|
|
|
+ <where>
|
|
|
+ <if test="detailsId != null">
|
|
|
+ and DETAILS_ID = #{detailsId}
|
|
|
+ </if>
|
|
|
+ <if test="purchaseOrderId != null">
|
|
|
+ and PURCHASE_ORDER_ID = #{purchaseOrderId}
|
|
|
+ </if>
|
|
|
+ <if test="orderId != null">
|
|
|
+ and ORDER_ID = #{orderId}
|
|
|
+ </if>
|
|
|
+ <if test="detailsNo != null and detailsNo != ''">
|
|
|
+ and DETAILS_NO = #{detailsNo}
|
|
|
+ </if>
|
|
|
+ <if test="detailsTime != null">
|
|
|
+ and TO_CHAR(DETAILS_TIME,'yyyy-MM-dd') = #{detailsTime}
|
|
|
+ </if>
|
|
|
+ <if test="priceId != null">
|
|
|
+ and PRICE_ID = #{priceId}
|
|
|
+ </if>
|
|
|
+ <if test="detailsAmount != null">
|
|
|
+ and DETAILS_AMOUNT = #{detailsAmount}
|
|
|
+ </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="detailsId != null">
|
|
|
+ and DETAILS_ID = #{detailsId}
|
|
|
+ </if>
|
|
|
+ <if test="purchaseOrderId != null">
|
|
|
+ and PURCHASE_ORDER_ID = #{purchaseOrderId}
|
|
|
+ </if>
|
|
|
+ <if test="orderId != null">
|
|
|
+ and ORDER_ID = #{orderId}
|
|
|
+ </if>
|
|
|
+ <if test="detailsNo != null and detailsNo != ''">
|
|
|
+ and DETAILS_NO LIKE '%${detailsNo}%'
|
|
|
+ </if>
|
|
|
+ <if test="detailsTime != null">
|
|
|
+ and TO_CHAR(DETAILS_TIME,'yyyy-MM-dd') = #{detailsTime}
|
|
|
+ </if>
|
|
|
+ <if test="priceId != null">
|
|
|
+ and PRICE_ID = #{priceId}
|
|
|
+ </if>
|
|
|
+ <if test="detailsAmount != null">
|
|
|
+ and DETAILS_AMOUNT = #{detailsAmount}
|
|
|
+ </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 BMSTRUCK_DETAILS_ORDER
|
|
|
+ where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
+ delete from BMSTRUCK_DETAILS_ORDER
|
|
|
+ where 1!=1
|
|
|
+ <if test="purchaseOrderId != null">
|
|
|
+ or PURCHASE_ORDER_ID = #{purchaseOrderId}
|
|
|
+ </if>
|
|
|
+ <if test="orderId != null">
|
|
|
+ or ORDER_ID = #{orderId}
|
|
|
+ </if>
|
|
|
+ <if test="detailsNo != null and detailsNo != ''">
|
|
|
+ or DETAILS_NO = #{detailsNo}
|
|
|
+ </if>
|
|
|
+ <if test="detailsTime != null">
|
|
|
+ or TO_CHAR(DETAILS_TIME,'yyyy-MM-dd') = '#{detailsTime}'
|
|
|
+ </if>
|
|
|
+ <if test="priceId != null">
|
|
|
+ or PRICE_ID = #{priceId}
|
|
|
+ </if>
|
|
|
+ <if test="detailsAmount != null">
|
|
|
+ or DETAILS_AMOUNT = #{detailsAmount}
|
|
|
+ </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.BmstruckDetailsOrder">
|
|
|
+ insert into BMSTRUCK_DETAILS_ORDER (DETAILS_ID, PURCHASE_ORDER_ID, ORDER_ID,
|
|
|
+ DETAILS_NO, DETAILS_TIME, PRICE_ID,
|
|
|
+ DETAILS_AMOUNT, INSERT_USERNAME, INSERT_TIME,
|
|
|
+ UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK)
|
|
|
+ values (#{detailsId,jdbcType=DECIMAL}, #{purchaseOrderId,jdbcType=DECIMAL}, #{orderId,jdbcType=DECIMAL},
|
|
|
+ #{detailsNo,jdbcType=VARCHAR}, #{detailsTime,jdbcType=TIMESTAMP}, #{priceId,jdbcType=DECIMAL},
|
|
|
+ #{detailsAmount,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
|
|
|
+ #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ #{insertUpdateRemark,jdbcType=VARCHAR})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
|
+ insert into BMSTRUCK_DETAILS_ORDER
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="detailsId != null">
|
|
|
+ DETAILS_ID,
|
|
|
+ </if>
|
|
|
+ <if test="purchaseOrderId != null">
|
|
|
+ PURCHASE_ORDER_ID,
|
|
|
+ </if>
|
|
|
+ <if test="orderId != null">
|
|
|
+ ORDER_ID,
|
|
|
+ </if>
|
|
|
+ <if test="detailsNo != null">
|
|
|
+ DETAILS_NO,
|
|
|
+ </if>
|
|
|
+ <if test="detailsTime != null">
|
|
|
+ DETAILS_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="priceId != null">
|
|
|
+ PRICE_ID,
|
|
|
+ </if>
|
|
|
+ <if test="detailsAmount != null">
|
|
|
+ DETAILS_AMOUNT,
|
|
|
+ </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="detailsId != null">
|
|
|
+ #{detailsId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="purchaseOrderId != null">
|
|
|
+ #{purchaseOrderId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderId != null">
|
|
|
+ #{orderId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="detailsNo != null">
|
|
|
+ #{detailsNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="detailsTime != null">
|
|
|
+ #{detailsTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="priceId != null">
|
|
|
+ #{priceId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="detailsAmount != null">
|
|
|
+ #{detailsAmount,jdbcType=DECIMAL},
|
|
|
+ </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.BmstruckDetailsOrder">
|
|
|
+ update BMSTRUCK_DETAILS_ORDER
|
|
|
+ set PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
|
|
|
+ ORDER_ID = #{orderId,jdbcType=DECIMAL},
|
|
|
+ DETAILS_NO = #{detailsNo,jdbcType=VARCHAR},
|
|
|
+ DETAILS_TIME = #{detailsTime,jdbcType=TIMESTAMP},
|
|
|
+ PRICE_ID = #{priceId,jdbcType=DECIMAL},
|
|
|
+ DETAILS_AMOUNT = #{detailsAmount,jdbcType=DECIMAL},
|
|
|
+ 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 DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
|
+ update BMSTRUCK_DETAILS_ORDER
|
|
|
+ <set>
|
|
|
+ <if test="purchaseOrderId != null">
|
|
|
+ PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="orderId != null">
|
|
|
+ ORDER_ID = #{orderId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="detailsNo != null">
|
|
|
+ DETAILS_NO = #{detailsNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="detailsTime != null">
|
|
|
+ DETAILS_TIME = #{detailsTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="priceId != null">
|
|
|
+ PRICE_ID = #{priceId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="detailsAmount != null">
|
|
|
+ DETAILS_AMOUNT = #{detailsAmount,jdbcType=DECIMAL},
|
|
|
+ </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 DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
|
|
|
+ <include refid="select"/>
|
|
|
+ where DETAILS_ID = #{detailsId,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 BMSTRUCK_DETAILS_ORDER
|
|
|
+ (DETAILS_ID,
|
|
|
+ PURCHASE_ORDER_ID, ORDER_ID, DETAILS_NO,
|
|
|
+ DETAILS_TIME, PRICE_ID, DETAILS_AMOUNT,
|
|
|
+ INSERT_USERNAME, INSERT_TIME,
|
|
|
+ UPDATE_USERNAME, UPDATE_TIME,
|
|
|
+ INSERT_UPDATE_REMARK)
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
+ select
|
|
|
+ #{item.detailsId,jdbcType=DECIMAL},
|
|
|
+ #{item.purchaseOrderId,jdbcType=DECIMAL}, #{item.orderId,jdbcType=DECIMAL}, #{item.detailsNo,jdbcType=VARCHAR},
|
|
|
+ #{item.detailsTime,jdbcType=TIMESTAMP}, #{item.priceId,jdbcType=DECIMAL},
|
|
|
+ #{item.detailsAmount,jdbcType=DECIMAL},
|
|
|
+ #{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 BMSTRUCK_DETAILS_ORDER
|
|
|
+ set
|
|
|
+ DETAILS_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,PURCHASE_ORDER_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.purchaseOrderId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,ORDER_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.orderId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,DETAILS_NO=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsNo,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,DETAILS_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,PRICE_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.priceId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,DETAILS_AMOUNT=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsAmount,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_USERNAME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_USERNAME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_UPDATE_REMARK=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ where DETAILS_ID in
|
|
|
+ <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
+ #{item.detailsId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+ <delete id="batchDelete" parameterType="java.util.List">
|
|
|
+ delete from BMSTRUCK_DETAILS_ORDER
|
|
|
+ where DETAILS_ID in
|
|
|
+ <foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <!-- 友情提示!!!-->
|
|
|
+ <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
+
|
|
|
+ <!-- 展示详单列表 -->
|
|
|
+ <select id="getTruckDetailsOrderList" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
+ SELECT * FROM(
|
|
|
+ SELECT DISTINCT
|
|
|
+ bdo.INSERT_TIME as "insertTime",
|
|
|
+ bdo.DETAILS_ID as "detailsId",
|
|
|
+ apo.RECEIVE_UNIT_ID as "statementShipperId",
|
|
|
+ db.BATCH_ID as "batchId",
|
|
|
+ oo.ORDER_ID as "orderId",
|
|
|
+ apo.PURCHASE_ORDER_NO as "purchaseOrderNo",
|
|
|
+ rm.MATERIAL_NAME as "materialName",
|
|
|
+ db.RESULT_FOREIGN_SHIP_NAME as "resultForeignShipName",
|
|
|
+ bdo.DETAILS_NO as "detailsNo",
|
|
|
+ bdo.DETAILS_TIME as "detailsTime",
|
|
|
+ rc.CAPACITY_NUMBER as "capacityNumber",
|
|
|
+ twr.RESULT_NET_WEIGHT as "resultNetWeight",
|
|
|
+ actp.PRICE_VALUE as "priceValue",
|
|
|
+ bdo.DETAILS_AMOUNT as "detailsAmount"
|
|
|
+ FROM BMSTRUCK_DETAILS_ORDER bdo
|
|
|
+ LEFT JOIN AMS_PURCHASE_ORDER apo
|
|
|
+ ON apo.PURCHASE_ORDER_ID = bdo.PURCHASE_ORDER_ID
|
|
|
+ LEFT JOIN RMS_SHIPPER rs
|
|
|
+ ON rs.SHIPPER_ID = apo.RECEIVE_UNIT_ID
|
|
|
+ LEFT JOIN DIL_BATCH db
|
|
|
+ ON db.BATCH_ID = apo.BATCH_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL rm
|
|
|
+ ON rm.MATERIAL_ID = db.MATERIAL_ID
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER oo
|
|
|
+ ON oo.ORDER_ID = bdo.ORDER_ID
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
+ ON oo.CAPACITY_ID = rc.CAPACITY_ID
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT ttl
|
|
|
+ ON ttl.ORDER_ID = oo.ORDER_ID
|
|
|
+ LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
|
|
|
+ ON twr.RESULT_TOTAL_ID = ttl.RESULT_TOTAL_ID
|
|
|
+ LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
|
+ ON actp.PRICE_ID = bdo.PRICE_ID
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="purchaseOrderNo!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="purchaseOrderNo" item="item" open="(" separator="," close=")">
|
|
|
+ "purchaseOrderNo" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="materialName!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="," close=")">
|
|
|
+ "materialName" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultForeignShipName!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultForeignShipName" item="item" open="(" separator="," close=")">
|
|
|
+ "resultForeignShipName" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="detailsNo!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="detailsNo" item="item" open="(" separator="," close=")">
|
|
|
+ "detailsNo" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="detailsTime!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="detailsTime" item="item" open="(" separator="," close=")">
|
|
|
+ "detailsTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
|
|
|
+ "capacityNumber" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultNetWeight!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultNetWeight" item="item" open="(" separator="," close=")">
|
|
|
+ "resultNetWeight" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="priceValue!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="priceValue" item="item" open="(" separator="," close=")">
|
|
|
+ "priceValue" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="detailsAmount!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="detailsAmount" item="item" open="(" separator="," close=")">
|
|
|
+ "detailsAmount" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ </select>
|
|
|
+ <!-- 得到最大id -->
|
|
|
+ <select id="selectMaxId" resultType="DECIMAL">
|
|
|
+ SELECT MAX(DETAILS_ID)
|
|
|
+ FROM BMSTRUCK_DETAILS_ORDER
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <sql id="orderBy">
|
|
|
+ <if test="orderField != null and orderField != ''">
|
|
|
+ order by "${orderField}"
|
|
|
+ <if test="orderType != null and orderType != ''">
|
|
|
+ ${orderType}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="orderField == null ">
|
|
|
+ order by "insertTime" desc
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 展示汽运实绩列表 -->
|
|
|
+ <select id="getTruckResultList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ SELECT *
|
|
|
+ FROM (
|
|
|
+ SELECT oo.INSERT_TIME as "insertTime",
|
|
|
+ apo.PURCHASE_ORDER_NO as "purchaseOrderNo",
|
|
|
+ rm.MATERIAL_NAME as "materialName",
|
|
|
+ db.RESULT_FOREIGN_SHIP_NAME as "resultForeignShipName",
|
|
|
+ oo.ORDER_ISSUE_TIME as "orderIssueTime",
|
|
|
+ rc.CONSIGNEE_COMPANY_NAME as "consigneeCompanyName",
|
|
|
+ rsu.SUPPLIER_NAME as "supplierName",
|
|
|
+ rca.CAPACITY_NUMBER as "capacityNumber",
|
|
|
+ twr.RESULT_NET_WEIGHT as "resultNetWeight"
|
|
|
+ FROM OMSTRUCK_ORDER oo
|
|
|
+ LEFT JOIN RMS_CAPACITY rca
|
|
|
+ ON rca.CAPACITY_ID = oo.CAPACITY_ID
|
|
|
+ LEFT JOIN AMS_PURCHASE_ORDER apo
|
|
|
+ ON apo.PURCHASE_ORDER_ID = oo.ORDER_PLAN_ID
|
|
|
+ LEFT JOIN RMS_SUPPLIER rsu
|
|
|
+ ON rsu.SUPPLIER_ID = apo.SUPPLIER_UNIT_ID
|
|
|
+ LEFT JOIN RMS_CONSIGNEE rc
|
|
|
+ ON rc.CONSIGNEE_ID = apo.RECEIVE_UNIT_ID
|
|
|
+ LEFT JOIN DIL_BATCH db
|
|
|
+ ON db.BATCH_ID = apo.BATCH_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL rm
|
|
|
+ ON rm.MATERIAL_ID = db.MATERIAL_ID
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
|
|
|
+ ON oo.ORDER_ID = ttr.ORDER_ID
|
|
|
+ LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
|
|
|
+ ON twr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
|
|
|
+ WHERE oo.ORDER_ID = #{orderId}
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="purchaseOrderNo!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="purchaseOrderNo" item="item" open="(" separator="," close=")">
|
|
|
+ "purchaseOrderNo" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="materialName!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="materialName" item="item" open="(" separator="," close=")">
|
|
|
+ "materialName" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultForeignShipName!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultForeignShipName" item="item" open="(" separator="," close=")">
|
|
|
+ "resultForeignShipName" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="orderIssueTime!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="orderIssueTime" item="item" open="(" separator="," close=")">
|
|
|
+ "orderIssueTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="consigneeCompanyName!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="consigneeCompanyName" item="item" open="(" separator="," close=")">
|
|
|
+ "consigneeCompanyName" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="supplierName!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="supplierName" item="item" open="(" separator="," close=")">
|
|
|
+ "supplierName" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="capacityNumber!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
|
|
|
+ "capacityNumber" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="resultNetWeight!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="resultNetWeight" item="item" open="(" separator="," close=")">
|
|
|
+ "resultNetWeight" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 得到计算因子 -->
|
|
|
+ <select id="getFormulaMembers" parameterType="DECIMAL" resultType="DECIMAL">
|
|
|
+ SELECT apo.PURCHASE_ORDER_ID
|
|
|
+ FROM OMSTRUCK_ORDER oo
|
|
|
+ LEFT JOIN AMS_PURCHASE_ORDER apo
|
|
|
+ ON apo.PURCHASE_ORDER_ID = oo.ORDER_PLAN_ID
|
|
|
+ WHERE oo.ORDER_ID = #{orderId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 得到单价id -->
|
|
|
+ <select id="getPriceId" resultType="java.util.Map" >
|
|
|
+ SELECT
|
|
|
+ actp.PRICE_ID as "priceId"
|
|
|
+ FROM AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
+ ON rc.CAPACITY_ID = actp.CAPACITY_ID
|
|
|
+ WHERE rc.CAPACITY_TYPE_ID = 1
|
|
|
+ AND actp.DELETED = 0
|
|
|
+ ORDER BY actp.PRICE_DATE DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getPriceValue" parameterType="DECIMAL" resultType="DECIMAL">
|
|
|
+ SELECT
|
|
|
+ actp.PRICE_VALUE as "priceValue"
|
|
|
+ FROM AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
|
+ WHERE PRICE_ID = #{priceId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getNetWeight" parameterType="DECIMAL" resultType="DECIMAL">
|
|
|
+ SELECT
|
|
|
+ twr.RESULT_NET_WEIGHT as "netWeight"
|
|
|
+ FROM OMSTRUCK_ORDER oo
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
|
|
|
+ ON oo.ORDER_ID = ttr.ORDER_ID
|
|
|
+ LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
|
|
|
+ ON ttr.RESULT_TOTAL_ID = twr.RESULT_TOTAL_ID
|
|
|
+ WHERE oo.ORDER_ID = #{orderId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|