|
@@ -64,6 +64,7 @@
|
|
|
sdd.dict_label rentName,
|
|
|
tc.f_updatetime,
|
|
|
tc.f_updateaddress,
|
|
|
+ address.f_name addressName,
|
|
|
tc.f_updateEF,
|
|
|
sdda.dict_label updateEFName,
|
|
|
tc.f_cntrstatus,
|
|
@@ -89,24 +90,29 @@
|
|
|
LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
|
|
|
LEFT JOIN sys_dict_data prs ON prs.dict_value = t.f_cntrsize
|
|
|
AND prs.dict_type = 'f_cntrsize'
|
|
|
+ LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
|
|
|
<where>
|
|
|
tc.f_status = 'T'
|
|
|
- <if test="fNo != null and fNo != ''">and tc.f_no = #{fNo}</if>
|
|
|
- <if test="fTypeid != null ">and tc.f_typeid = #{fTypeid}</if>
|
|
|
- <if test="fOwner != null and fOwner != ''">and tc.f_owner = #{fOwner}</if>
|
|
|
- <if test="fSource != null and fSource != ''">and tc.f_source = #{fSource}</if>
|
|
|
- <if test="fRent != null and fRent != ''">and tc.f_rent = #{fRent}</if>
|
|
|
- <if test="fUpdatetime != null ">and tc.f_updatetime = #{fUpdatetime}</if>
|
|
|
- <if test="fUpdateaddress != null and fUpdateaddress != ''">and tc.f_updateaddress = #{fUpdateaddress}</if>
|
|
|
- <if test="fUpdateef != null and fUpdateef != ''">and tc.f_updateEF = #{fUpdateef}</if>
|
|
|
- <if test="fCntrstatus != null and fCntrstatus != ''">and tc.f_cntrstatus = #{fCntrstatus}</if>
|
|
|
- <if test="fStatus != null and fStatus != ''">and tc.f_status = #{fStatus}</if>
|
|
|
- <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
|
|
|
- and tc.create_time >= #{cLoadDate[0]}
|
|
|
+ <if test="tc.fNo != null and tc.fNo != ''">and tc.f_no = #{tc.fNo}</if>
|
|
|
+ <if test="tc.fTypeid != null ">and tc.f_typeid = #{tc.fTypeid}</if>
|
|
|
+ <if test="tc.fOwner != null and tc.fOwner != ''">and tc.f_owner = #{tc.fOwner}</if>
|
|
|
+ <if test="tc.fSource != null and tc.fSource != ''">and tc.f_source = #{tc.fSource}</if>
|
|
|
+ <if test="tc.fRent != null and tc.fRent != ''">and tc.f_rent = #{tc.fRent}</if>
|
|
|
+ <if test="tc.fUpdatetime != null ">and tc.f_updatetime = #{tc.fUpdatetime}</if>
|
|
|
+ <if test="tc.fUpdateaddress != null and tc.fUpdateaddress != ''">and tc.f_updateaddress = #{tc.fUpdateaddress}</if>
|
|
|
+ <if test="tc.fUpdateef != null and tc.fUpdateef != ''">and tc.f_updateEF = #{tc.fUpdateef}</if>
|
|
|
+ <if test="tc.fCntrstatus != null and tc.fCntrstatus != ''">and tc.f_cntrstatus = #{tc.fCntrstatus}</if>
|
|
|
+ <if test="tc.fStatus != null and tc.fStatus != ''">and tc.f_status = #{tc.fStatus}</if>
|
|
|
+ <if test='tc.cLoadDate != null and tc.cLoadDate[0] != null and tc.cLoadDate[0]!= ""'>
|
|
|
+ and tc.create_time >= #{tc.cLoadDate[0]}
|
|
|
</if>
|
|
|
- <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
|
|
|
- and tc.create_time <= #{cLoadDate[1]}
|
|
|
+ <if test='tc.cLoadDate != null and tc.cLoadDate[1] != null and tc.cLoadDate[1]!= ""'>
|
|
|
+ and tc.create_time <= #{tc.cLoadDate[1]}
|
|
|
</if>
|
|
|
+ <if test="address != null and address != ''">and address.f_name = #{address}</if>
|
|
|
+ <if test="typeidName != null and typeidName != ''">and t.f_name = #{typeidName}</if>
|
|
|
+ <if test="cntrstatusName != null and cntrstatusName != ''">and pr.dict_label = #{cntrstatusName}</if>
|
|
|
+ <if test="updateEFName != null and updateEFName != ''">and sdda.dict_label = #{updateEFName}</if>
|
|
|
</where>
|
|
|
ORDER BY tc.f_no,CONVERT(tc.f_updateaddress USING gbk),CONVERT(t.f_no USING gbk),
|
|
|
tc.f_updateEF,tc.f_cntrstatus,tc.f_owner
|
|
@@ -128,6 +134,7 @@
|
|
|
sdd.dict_label rentName,
|
|
|
tc.f_updatetime,
|
|
|
tc.f_updateaddress,
|
|
|
+ address.f_name addressName,
|
|
|
tc.f_updateEF,
|
|
|
sdda.dict_label updateEFName,
|
|
|
tc.f_cntrstatus,
|
|
@@ -153,6 +160,7 @@
|
|
|
LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
|
|
|
LEFT JOIN sys_dict_data prs ON prs.dict_value = t.f_cntrsize
|
|
|
AND prs.dict_type = 'f_cntrsize'
|
|
|
+ LEFT JOIN t_address address ON address.f_id = tc.f_updateaddress
|
|
|
where tc.f_id = #{fId}
|
|
|
</select>
|
|
|
|
|
@@ -239,72 +247,111 @@
|
|
|
</update>
|
|
|
<!--获取集装动态分布信息 -->
|
|
|
<select id="getTCntrnoMessage" parameterType="string" resultType="map">
|
|
|
- SELECT
|
|
|
- container.*,
|
|
|
- box.`空`,
|
|
|
- box.`重`,
|
|
|
- car.`好`,
|
|
|
- car.`坏`
|
|
|
-FROM
|
|
|
- (
|
|
|
- SELECT
|
|
|
- tt.f_updateaddress AS 地点
|
|
|
- <if test=" sql != null and sql != ''">
|
|
|
+ SELECT
|
|
|
+ container.*,
|
|
|
+ box.`空`,
|
|
|
+ box.`重`,
|
|
|
+ car.`好`,
|
|
|
+ car.`坏`
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ tt.f_updateaddress AS 地点
|
|
|
+ <if test=" sql != null and sql != ''">
|
|
|
,${sql}
|
|
|
</if>
|
|
|
- FROM
|
|
|
- (
|
|
|
- SELECT
|
|
|
- tc.f_updateaddress f_updateaddress,
|
|
|
- tc.typeidCount typeidCount,
|
|
|
- t.f_no f_no
|
|
|
- FROM
|
|
|
- ( SELECT f_updateaddress, f_typeid, COUNT( 1 ) typeidCount FROM t_cntrno GROUP BY f_updateaddress, f_typeid ) tc
|
|
|
- LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
|
|
|
- ) tt
|
|
|
- GROUP BY
|
|
|
- tt.f_updateaddress
|
|
|
- ) container
|
|
|
- LEFT JOIN (
|
|
|
- SELECT
|
|
|
- a.f_updateaddress,
|
|
|
- MAX( CASE WHEN a.dict_label = '空' THEN a.efCount ELSE 0 END ) AS 空,
|
|
|
- MAX( CASE WHEN a.dict_label = '重' THEN a.efCount ELSE 0 END ) AS 重
|
|
|
- FROM
|
|
|
- (
|
|
|
- SELECT
|
|
|
- tc.f_updateaddress f_updateaddress,
|
|
|
- tc.f_updateEF f_updateEF,
|
|
|
- tc.efCount efCount,
|
|
|
- sdda.dict_label dict_label
|
|
|
- FROM
|
|
|
- ( SELECT f_updateaddress, f_updateEF, COUNT( 1 ) efCount FROM t_cntrno GROUP BY f_updateaddress, f_updateEF ) tc
|
|
|
- LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
|
|
|
- AND sdda.dict_type = 'f_updateEF'
|
|
|
- ) a
|
|
|
- GROUP BY
|
|
|
- a.f_updateaddress
|
|
|
- ) box ON container.地点 = box.f_updateaddress
|
|
|
- LEFT JOIN (
|
|
|
- SELECT
|
|
|
- b.f_updateaddress,
|
|
|
- MAX( CASE WHEN b.dict_label = '好' THEN b.statusCount ELSE 0 END ) AS 好,
|
|
|
- MAX( CASE WHEN b.dict_label = '坏' THEN b.statusCount ELSE 0 END ) AS 坏
|
|
|
- FROM
|
|
|
- (
|
|
|
- SELECT
|
|
|
- tc.f_updateaddress f_updateaddress,
|
|
|
- tc.f_cntrstatus f_cntrstatus,
|
|
|
- tc.statusCount statusCount,
|
|
|
- sdda.dict_label dict_label
|
|
|
- FROM
|
|
|
- ( SELECT f_updateaddress, f_cntrstatus, COUNT( 1 ) statusCount FROM t_cntrno GROUP BY f_updateaddress, f_cntrstatus ) tc
|
|
|
- LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_cntrstatus
|
|
|
- AND sdda.dict_type = 'f_cntrstatus'
|
|
|
- ) b
|
|
|
- GROUP BY
|
|
|
- b.f_updateaddress
|
|
|
- ) car ON container.地点 = car.f_updateaddress
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ tc.f_updateaddress f_updateaddress,
|
|
|
+ tc.typeidCount typeidCount,
|
|
|
+ t.f_no f_no
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ta.f_name f_updateaddress,
|
|
|
+ tcn.f_typeid,
|
|
|
+ COUNT( tcn.f_updateaddress ) typeidCount
|
|
|
+ FROM
|
|
|
+ t_cntrno tcn
|
|
|
+ LEFT JOIN t_address ta ON tcn.f_updateaddress = ta.f_id
|
|
|
+ WHERE
|
|
|
+ tcn.f_status = 'T'
|
|
|
+ GROUP BY
|
|
|
+ tcn.f_updateaddress,
|
|
|
+ tcn.f_typeid
|
|
|
+ ) tc
|
|
|
+ LEFT JOIN t_cntr t ON tc.f_typeid = t.f_id
|
|
|
+ ) tt
|
|
|
+ GROUP BY
|
|
|
+ tt.f_updateaddress
|
|
|
+ ) container
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ a.f_updateaddress,
|
|
|
+ MAX( CASE WHEN a.dict_label = '空' THEN a.efCount ELSE 0 END ) AS 空,
|
|
|
+ MAX( CASE WHEN a.dict_label = '重' THEN a.efCount ELSE 0 END ) AS 重
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ tc.f_updateaddress f_updateaddress,
|
|
|
+ tc.f_updateEF f_updateEF,
|
|
|
+ tc.efCount efCount,
|
|
|
+ sdda.dict_label dict_label
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ta.f_name f_updateaddress,
|
|
|
+ tct.f_updateEF,
|
|
|
+ COUNT( tct.f_updateaddress ) efCount
|
|
|
+ FROM
|
|
|
+ t_cntrno tct
|
|
|
+ LEFT JOIN t_address ta ON tct.f_updateaddress = ta.f_id
|
|
|
+ WHERE
|
|
|
+ tct.f_status = 'T'
|
|
|
+ GROUP BY
|
|
|
+ tct.f_updateaddress,
|
|
|
+ tct.f_updateEF
|
|
|
+ ) tc
|
|
|
+ LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_updateEF
|
|
|
+ AND sdda.dict_type = 'f_updateEF'
|
|
|
+ ) a
|
|
|
+ GROUP BY
|
|
|
+ a.f_updateaddress
|
|
|
+ ) box ON container.地点 = box.f_updateaddress
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ b.f_updateaddress,
|
|
|
+ MAX( CASE WHEN b.dict_label = '好' THEN b.statusCount ELSE 0 END ) AS 好,
|
|
|
+ MAX( CASE WHEN b.dict_label = '坏' THEN b.statusCount ELSE 0 END ) AS 坏
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ tc.f_updateaddress f_updateaddress,
|
|
|
+ tc.f_cntrstatus f_cntrstatus,
|
|
|
+ tc.statusCount statusCount,
|
|
|
+ sdda.dict_label dict_label
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ ta.f_name f_updateaddress,
|
|
|
+ tct.f_cntrstatus,
|
|
|
+ COUNT( tct.f_updateaddress ) statusCount
|
|
|
+ FROM
|
|
|
+ t_cntrno tct
|
|
|
+ LEFT JOIN t_address ta ON tct.f_updateaddress = ta.f_id
|
|
|
+ WHERE
|
|
|
+ tct.f_status = 'T'
|
|
|
+ GROUP BY
|
|
|
+ tct.f_updateaddress,
|
|
|
+ tct.f_cntrstatus
|
|
|
+ ) tc
|
|
|
+ LEFT JOIN sys_dict_data sdda ON sdda.dict_value = tc.f_cntrstatus
|
|
|
+ AND sdda.dict_type = 'f_cntrstatus'
|
|
|
+ ) b
|
|
|
+ GROUP BY
|
|
|
+ b.f_updateaddress
|
|
|
+ ) car ON container.地点 = car.f_updateaddress
|
|
|
<where>
|
|
|
<if test="tCntrno.fUpdateaddress != null and tCntrno.fUpdateaddress != ''">
|
|
|
container.地点 like concat('%', #{tCntrno.fUpdateaddress}, '%')</if>
|