|
@@ -1,24 +1,34 @@
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE mapper
|
|
<!DOCTYPE mapper
|
|
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.ruoyi.shipping.mapper.TCtnpriceItemsMapper">
|
|
<mapper namespace="com.ruoyi.shipping.mapper.TCtnpriceItemsMapper">
|
|
-
|
|
|
|
|
|
+
|
|
<resultMap type="TCtnpriceItems" id="TCtnpriceItemsResult">
|
|
<resultMap type="TCtnpriceItems" id="TCtnpriceItemsResult">
|
|
- <result property="fId" column="f_id" />
|
|
|
|
- <result property="fPid" column="f_pid" />
|
|
|
|
- <result property="fCntrid" column="f_cntrid" />
|
|
|
|
- <result property="fPrice" column="f_price" />
|
|
|
|
- <result property="fStatus" column="f_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" />
|
|
|
|
|
|
+ <result property="fId" column="f_id"/>
|
|
|
|
+ <result property="fPid" column="f_pid"/>
|
|
|
|
+ <result property="fCntrid" column="f_cntrid"/>
|
|
|
|
+ <result property="fPrice" column="f_price"/>
|
|
|
|
+ <result property="fStatus" column="f_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>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTCtnpriceItemsVo">
|
|
<sql id="selectTCtnpriceItemsVo">
|
|
- select f_id, f_pid, f_cntrid, f_price, f_status, create_by, create_time, update_by, update_time, remark from t_ctnprice_items
|
|
|
|
|
|
+ select f_id,
|
|
|
|
+ f_pid,
|
|
|
|
+ f_cntrid,
|
|
|
|
+ f_price,
|
|
|
|
+ f_status,
|
|
|
|
+ create_by,
|
|
|
|
+ create_time,
|
|
|
|
+ update_by,
|
|
|
|
+ update_time,
|
|
|
|
+ remark
|
|
|
|
+ from t_ctnprice_items
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectTCtnpriceItemsList" parameterType="TCtnpriceItems" resultMap="TCtnpriceItemsResult">
|
|
<select id="selectTCtnpriceItemsList" parameterType="TCtnpriceItems" resultMap="TCtnpriceItemsResult">
|
|
@@ -40,11 +50,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
FROM
|
|
FROM
|
|
t_ctnprice_items ti
|
|
t_ctnprice_items ti
|
|
LEFT JOIN t_cntr tc ON ti.f_cntrid = tc.f_id
|
|
LEFT JOIN t_cntr tc ON ti.f_cntrid = tc.f_id
|
|
- <where>
|
|
|
|
- <if test="fPid != null "> and ti.f_pid = #{fPid}</if>
|
|
|
|
- <if test="fCntrid != null "> and ti.f_cntrid = #{fCntrid}</if>
|
|
|
|
- <if test="fPrice != null "> and ti.f_price = #{fPrice}</if>
|
|
|
|
- <if test="fStatus != null and fStatus != ''"> and ti.f_status = #{fStatus}</if>
|
|
|
|
|
|
+ <where>
|
|
|
|
+ <if test="fPid != null ">and ti.f_pid = #{fPid}</if>
|
|
|
|
+ <if test="fCntrid != null ">and ti.f_cntrid = #{fCntrid}</if>
|
|
|
|
+ <if test="fPrice != null ">and ti.f_price = #{fPrice}</if>
|
|
|
|
+ <if test="fStatus != null and fStatus != ''">and ti.f_status = #{fStatus}</if>
|
|
<if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
|
|
<if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
|
|
and ti.create_time >= #{cLoadDate[0]}
|
|
and ti.create_time >= #{cLoadDate[0]}
|
|
</if>
|
|
</if>
|
|
@@ -53,12 +63,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="selectTCtnpriceItemsById" parameterType="Long" resultMap="TCtnpriceItemsResult">
|
|
<select id="selectTCtnpriceItemsById" parameterType="Long" resultMap="TCtnpriceItemsResult">
|
|
<include refid="selectTCtnpriceItemsVo"/>
|
|
<include refid="selectTCtnpriceItemsVo"/>
|
|
where f_id = #{fId}
|
|
where f_id = #{fId}
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<insert id="insertTCtnpriceItems" parameterType="TCtnpriceItems" useGeneratedKeys="true" keyProperty="fId">
|
|
<insert id="insertTCtnpriceItems" parameterType="TCtnpriceItems" useGeneratedKeys="true" keyProperty="fId">
|
|
insert into t_ctnprice_items
|
|
insert into t_ctnprice_items
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -71,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="remark != null">remark,</if>
|
|
- </trim>
|
|
|
|
|
|
+ </trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="fPid != null">#{fPid},</if>
|
|
<if test="fPid != null">#{fPid},</if>
|
|
<if test="fCntrid != null">#{fCntrid},</if>
|
|
<if test="fCntrid != null">#{fCntrid},</if>
|
|
@@ -82,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
- </trim>
|
|
|
|
|
|
+ </trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<update id="updateTCtnpriceItems" parameterType="TCtnpriceItems">
|
|
<update id="updateTCtnpriceItems" parameterType="TCtnpriceItems">
|
|
@@ -102,17 +112,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTCtnpriceItemsById" parameterType="Long">
|
|
<delete id="deleteTCtnpriceItemsById" parameterType="Long">
|
|
- delete from t_ctnprice_items where f_id = #{fId}
|
|
|
|
|
|
+ delete
|
|
|
|
+ from t_ctnprice_items
|
|
|
|
+ where f_id = #{fId}
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTCtnpriceItemsByIds" parameterType="String">
|
|
<delete id="deleteTCtnpriceItemsByIds" parameterType="String">
|
|
- delete from t_ctnprice_items where f_id in
|
|
|
|
|
|
+ delete from t_ctnprice_items where f_id in
|
|
<foreach item="fId" collection="array" open="(" separator="," close=")">
|
|
<foreach item="fId" collection="array" open="(" separator="," close=")">
|
|
#{fId}
|
|
#{fId}
|
|
</foreach>
|
|
</foreach>
|
|
</delete>
|
|
</delete>
|
|
<delete id="deleteTCtnpriceItemsByfPid" parameterType="Long">
|
|
<delete id="deleteTCtnpriceItemsByfPid" parameterType="Long">
|
|
- delete from t_ctnprice_items where f_pid = #{fPid}
|
|
|
|
|
|
+ delete
|
|
|
|
+ from t_ctnprice_items
|
|
|
|
+ where f_pid = #{fPid}
|
|
</delete>
|
|
</delete>
|
|
<delete id="deleteTCtnpriceItemsByfPids" parameterType="Long">
|
|
<delete id="deleteTCtnpriceItemsByfPids" parameterType="Long">
|
|
delete from t_ctnprice_items where f_pid in
|
|
delete from t_ctnprice_items where f_pid in
|
|
@@ -121,44 +135,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</foreach>
|
|
</foreach>
|
|
</delete>
|
|
</delete>
|
|
<select id="selectMoney" resultType="string">
|
|
<select id="selectMoney" resultType="string">
|
|
- SELECT
|
|
|
|
- IFNULL(min(ti.f_price),0) price
|
|
|
|
- FROM
|
|
|
|
- t_ctnprice_items ti
|
|
|
|
- LEFT JOIN t_ctnprice tc ON ti.f_pid = tc.f_id
|
|
|
|
- LEFT JOIN t_cntr tr ON ti.f_cntrid = tr.f_id
|
|
|
|
- WHERE
|
|
|
|
- tc.f_portofloadid = #{fPortofloadid}
|
|
|
|
- AND tc.f_distinationid = #{fDistinationid}
|
|
|
|
- AND tr.f_no = #{fNo}
|
|
|
|
|
|
+ SELECT IFNULL(min(ti.f_price), 0) price
|
|
|
|
+ FROM t_ctnprice_items ti
|
|
|
|
+ LEFT JOIN t_ctnprice tc ON ti.f_pid = tc.f_id
|
|
|
|
+ LEFT JOIN t_cntr tr ON ti.f_cntrid = tr.f_id
|
|
|
|
+ WHERE tc.f_portofloadid = #{fPortofloadid}
|
|
|
|
+ AND tc.f_distinationid = #{fDistinationid}
|
|
|
|
+ AND tr.f_no = #{fNo}
|
|
|
|
+ AND tc.f_status = 'T'
|
|
|
|
+ AND ti.f_status = 'T'
|
|
</select>
|
|
</select>
|
|
<select id="selectPriceMoney" resultType="string">
|
|
<select id="selectPriceMoney" resultType="string">
|
|
- SELECT
|
|
|
|
- CASE
|
|
|
|
- WHEN
|
|
|
|
- ti.f_price IS NULL THEN
|
|
|
|
- 0 ELSE ti.f_price END AS pric
|
|
|
|
- FROM
|
|
|
|
- t_ctnprice_items ti
|
|
|
|
- LEFT JOIN t_ctnprice tc ON ti.f_pid = tc.f_id
|
|
|
|
- LEFT JOIN t_cntr tr ON ti.f_cntrid = tr.f_id
|
|
|
|
- WHERE
|
|
|
|
- tc.f_portofloadid = #{fPortofloadid}
|
|
|
|
- AND tc.f_distinationid = #{fDistinationid}
|
|
|
|
- AND tr.f_no = #{fNo}
|
|
|
|
|
|
+ SELECT CASE
|
|
|
|
+ WHEN
|
|
|
|
+ ti.f_price IS NULL THEN
|
|
|
|
+ 0
|
|
|
|
+ ELSE ti.f_price END AS pric
|
|
|
|
+ FROM t_ctnprice_items ti
|
|
|
|
+ LEFT JOIN t_ctnprice tc ON ti.f_pid = tc.f_id
|
|
|
|
+ LEFT JOIN t_cntr tr ON ti.f_cntrid = tr.f_id
|
|
|
|
+ WHERE tc.f_portofloadid = #{fPortofloadid}
|
|
|
|
+ AND tc.f_distinationid = #{fDistinationid}
|
|
|
|
+ AND tr.f_no = #{fNo}
|
|
|
|
+ AND tc.f_status = 'T'
|
|
|
|
+ AND ti.f_status = 'T'
|
|
</select>
|
|
</select>
|
|
<select id="containerPrice" parameterType="object" resultType="long">
|
|
<select id="containerPrice" parameterType="object" resultType="long">
|
|
- SELECT
|
|
|
|
- ti.f_price
|
|
|
|
- FROM
|
|
|
|
- t_ctnprice_items ti
|
|
|
|
- LEFT JOIN t_cntr tc
|
|
|
|
- ON ti.f_cntrid = tc.f_id
|
|
|
|
- LEFT JOIN t_ctnprice tp ON ti.f_pid = tp.f_id
|
|
|
|
|
|
+ SELECT ti.f_price
|
|
|
|
+ FROM t_ctnprice_items ti
|
|
|
|
+ LEFT JOIN t_cntr tc
|
|
|
|
+ ON ti.f_cntrid = tc.f_id
|
|
|
|
+ LEFT JOIN t_ctnprice tp ON ti.f_pid = tp.f_id
|
|
WHERE tc.f_no = #{cntridName}
|
|
WHERE tc.f_no = #{cntridName}
|
|
AND tp.f_portofloadid = #{fPortofloadid}
|
|
AND tp.f_portofloadid = #{fPortofloadid}
|
|
AND tp.f_distinationid = #{fDistinationid}
|
|
AND tp.f_distinationid = #{fDistinationid}
|
|
AND #{fEtd} BETWEEN tp.f_begindate AND tp.f_end
|
|
AND #{fEtd} BETWEEN tp.f_begindate AND tp.f_end
|
|
|
|
+ AND tc.f_status = 'T'
|
|
|
|
+ AND tp.f_status = 'T'
|
|
|
|
+ <if test="fPortoftransshipment != null">AND tp.f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectItemMeaasge" parameterType="TCtnpriceItems" resultMap="TCtnpriceItemsResult">
|
|
|
|
+ select f_id,
|
|
|
|
+ f_pid,
|
|
|
|
+ f_cntrid,
|
|
|
|
+ f_price,
|
|
|
|
+ f_status,
|
|
|
|
+ create_by,
|
|
|
|
+ create_time,
|
|
|
|
+ update_by,
|
|
|
|
+ update_time,
|
|
|
|
+ remark
|
|
|
|
+ from t_ctnprice_items
|
|
|
|
+ where f_pid = #{fPid}
|
|
|
|
+ AND f_cntrid = #{fCntrid}
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
</mapper>
|
|
</mapper>
|