You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
580 lines
28 KiB
XML
580 lines
28 KiB
XML
<?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.nmgs.mapper.HangTableMapper">
|
|
|
|
<select id="getHangByPage" parameterType="java.util.HashMap" resultType="com.nmgs.entity.HangTable">
|
|
select
|
|
t.BEGDATE,t.CARDID,t.CARDNO,t.CARDTP,t.DT,
|
|
t.PLATECOLOR,t.VERNO,t.CASH,t.TYPE,t.REPORTROADNO,t.REPORTSTANO,
|
|
t.JTFLAG,ht.text as cardtpName,tt.TEXT as typeName,rta.roadname as reportroadnoName,
|
|
nta.staname as reportstanoName,(case when t.JTFLAG=1 THEN '是' else '否' end) As jtflagName
|
|
<if test="params.DBTYPE ==1">
|
|
,(case when t.DT< dateadd(day,0,#{params.CURRENTWILLDATE}) THEN 'Y' else 'N' end) AS isOverTrace
|
|
</if>
|
|
<if test="params.DBTYPE ==2">
|
|
,(case when t.DT< to_Date(#{params.CURRENTWILLDATE},'YYYY-MM-DD HH24:mi:ss') THEN 'Y' else 'N' end) AS isOverTrace
|
|
</if>
|
|
<if test="params.DBTYPE ==3">
|
|
,(case when t.DT< to_Date(#{params.CURRENTWILLDATE},'YYYY-MM-DD HH24:mi:ss') THEN 'Y' else 'N' end) AS isOverTrace
|
|
</if>
|
|
<if test="params.DBTYPE ==4">
|
|
,(case when t.DT< STR_TO_DATE(#{params.CURRENTWILLDATE},'%Y-%m-%d %H:%k:%s') THEN 'Y' else 'N' end) AS isOverTrace
|
|
</if>
|
|
FROM HANG_TABLE t
|
|
left join ROAD_TABLE rta on(t.REPORTROADNO = rta.roadno)
|
|
left join hangtp_text ht on(t.CARDTP = ht.ID)
|
|
left join TYPE_TEXT tt on(t.TYPE = tt.value)
|
|
left join NAME_TABLE nta on(t.REPORTSTANO = nta.STANO)
|
|
<where>
|
|
<if test="params.id != null and params.id != ''">
|
|
AND t.id = #{params.id}
|
|
</if>
|
|
<if test="params.queryCreateTimeS!= null and params.queryCreateTimeS!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.DT >= dateadd(day,0,#{params.queryCreateTimeS})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.DT >= TO_DATE(#{params.queryCreateTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.DT >= TO_DATE(#{params.queryCreateTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.DT >= STR_TO_DATE(#{params.queryCreateTimeS}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.queryCreateTimeE!= null and params.queryCreateTimeE!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.DT <= dateadd(day,0,#{params.queryCreateTimeE})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.DT <= TO_DATE(#{params.queryCreateTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.DT <= TO_DATE(#{params.queryCreateTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.DT <= STR_TO_DATE(#{params.queryCreateTimeE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.queryrptimeS!= null and params.queryrptimeS!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.RPTIME >= dateadd(day,0,#{params.queryrptimeS})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.RPTIME >= TO_DATE(#{params.queryrptimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.RPTIME >= TO_DATE(#{params.queryrptimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.RPTIME >= STR_TO_DATE(#{params.queryrptimeS}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.queryrptimeE!= null and params.queryrptimeE!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.RPTIME <= dateadd(day,0,#{params.queryrptimeE})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.RPTIME <= TO_DATE(#{params.queryrptimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.RPTIME <= TO_DATE(#{params.queryrptimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.RPTIME <= STR_TO_DATE(#{params.queryrptimeE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.querybegdateS!= null and params.querybegdateS!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.BEGDATE >= dateadd(day,0,#{params.querybegdateS})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.BEGDATE >= TO_DATE(#{params.querybegdateS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.BEGDATE >= TO_DATE(#{params.querybegdateS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.BEGDATE >= STR_TO_DATE(#{params.querybegdateS}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.querybegdateE!= null and params.querybegdateE!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.BEGDATE <= dateadd(day,0,#{params.querybegdateE})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.BEGDATE <= TO_DATE(#{params.querybegdateE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.BEGDATE <= TO_DATE(#{params.querybegdateE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.BEGDATE <= STR_TO_DATE(#{params.querybegdateE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.WILLDATE!= null and params.WILLDATE!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
<!-- 已过追缴期-->
|
|
<if test="params.SPROMPOTY==1">
|
|
AND t.DT < dateadd(day,0,#{params.WILLDATE})
|
|
</if>
|
|
<!-- 未过追缴期-->
|
|
<if test="params.SPROMPOTY==2">
|
|
AND t.DT >=dateadd(day,0,#{params.WILLDATE})
|
|
</if>
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
<!-- 已过追缴期-->
|
|
<if test="params.SPROMPOTY==1">
|
|
AND t.DT < TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<!-- 未过追缴期-->
|
|
<if test="params.SPROMPOTY==2">
|
|
AND t.DT >= TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
<!-- 已过追缴期-->
|
|
<if test="params.SPROMPOTY==1">
|
|
AND t.DT <= TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<!-- 未过追缴期-->
|
|
<if test="params.SPROMPOTY==2">
|
|
AND t.DT >= TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
<!-- 已过追缴期-->
|
|
<if test="params.SPROMPOTY==1">
|
|
AND t.DT <= STR_TO_DATE(#{params.WILLDATE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
<!-- 未过追缴期-->
|
|
<if test="params.SPROMPOTY==2">
|
|
AND t.DT >= STR_TO_DATE(#{params.WILLDATE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
</if>
|
|
<if test="params.SROADNO != null and params.SROADNO != ''">
|
|
AND t.REPORTROADNO = #{params.SROADNO}
|
|
</if>
|
|
<if test="params.SSTANO != null and params.SSTANO != ''">
|
|
AND t.REPORTSTANO = #{params.SSTANO}
|
|
</if>
|
|
<if test="params.SCARDID != null and params.SCARDID != ''">
|
|
AND t.CARDID like '%'|| #{params.SCARDID} || '%'
|
|
</if>
|
|
<if test="params.SCARDTP != null and params.SCARDTP != ''">
|
|
AND t.CARDTP = #{params.SCARDTP}
|
|
</if>
|
|
<if test="params.STYPE != null and params.STYPE != ''">
|
|
AND t.TYPE = #{params.STYPE}
|
|
</if>
|
|
<if test="params.SJTFLAG != null and params.SJTFLAG != ''">
|
|
AND t.JTFLAG = #{params.SJTFLAG}
|
|
</if>
|
|
<if test="params.SPLATECOLOR != null and params.SPLATECOLOR != ''">
|
|
AND t.platecolor = #{params.SPLATECOLOR}
|
|
</if>
|
|
</where>
|
|
order by t.DT DESC
|
|
</select>
|
|
<update id="updateById" parameterType="com.nmgs.entity.HangTable">
|
|
update HANG_TABLE
|
|
<set>
|
|
<if test="params.platecolor !='' and params.platecolor != null">
|
|
PLATECOLOR= #{params.platecolor},
|
|
</if>
|
|
<if test="params.type !='' and params.type != null">
|
|
type= #{params.type},
|
|
</if>
|
|
<if test="params.cash !='' and params.cash != null">
|
|
cash= #{params.cash},
|
|
</if>
|
|
<if test="params.cardno !='' and params.cardno != null">
|
|
CARDNO= #{params.cardno},
|
|
</if>
|
|
<if test="params.reportroadno !='' and params.reportroadno != null">
|
|
REPORTROADNO=#{params.reportroadno},
|
|
</if>
|
|
<if test="params.reportstano !='' and params.reportstano != null">
|
|
REPORTSTANO=#{params.reportstano},
|
|
</if>
|
|
</set>
|
|
where CARDID=#{params.cardid} AND CARDTP=#{params.cardtp}
|
|
</update>
|
|
<update id="publishVersion" parameterType="java.util.HashMap">
|
|
update HANG_TABLE
|
|
<set>
|
|
<if test="params.DBType == 1">
|
|
BEGDATE = dateadd(day,0,#{params.begdate})
|
|
</if>
|
|
<if test="params.DBType == 2">
|
|
BEGDATE= TO_DATE(#{params.begdate}, 'YYYY-MM-DD HH24:mi:ss'),
|
|
</if>
|
|
<if test="params.DBType == 3">
|
|
BEGDATE = TO_DATE(#{params.begdate}, 'YYYY-MM-DD HH24:mi:ss'),
|
|
</if>
|
|
<if test="params.DBType == 4">
|
|
BEGDATE= STR_TO_DATE(#{params.begdate}, '%Y-%m-%d %H:%k:%s'),
|
|
</if>
|
|
VERNO= #{params.verno}
|
|
</set>
|
|
</update>
|
|
|
|
<delete id="delDataBatch">
|
|
DELETE FROM HANG_TABLE t WHERE t.CARDID =#{params.cardid} AND t.cardtp=#{params.cardtp}
|
|
</delete>
|
|
<select id="getHangList" parameterType="java.util.HashMap" resultType="com.nmgs.entity.HangTable">
|
|
select
|
|
t.BEGDATE,t.CARDID,t.CARDNO,t.CARDTP,t.DT,
|
|
t.PLATECOLOR,t.VERNO,t.CASH,t.TYPE,t.REPORTROADNO,t.REPORTSTANO,
|
|
t.JTFLAG,ht.text as cardtpName,tt.TEXT as typeName,rta.roadname as reportroadnoName,
|
|
nta.staname as reportstanoName,(case when t.JTFLAG=1 THEN '是' else '否' end) As jtflagName
|
|
<if test="params.DBTYPE ==1">
|
|
,(case when t.DT< dateadd(day,0,#{params.CURRENTWILLDATE}) THEN 'Y' else 'N' end) AS isOverTrace
|
|
</if>
|
|
<if test="params.DBTYPE ==2">
|
|
,(case
|
|
when t.DT< to_Date(#{params.CURRENTWILLDATE},'YYYY-MM-DD HH24:mi:ss') THEN 'Y' else 'N' end) AS isOverTrace
|
|
</if>
|
|
<if test="params.DBTYPE ==3">
|
|
,(case
|
|
when t.DT< to_Date(#{params.CURRENTWILLDATE},'YYYY-MM-DD HH24:mi:ss') THEN 'Y' else 'N' end) AS isOverTrace
|
|
</if>
|
|
<if test="params.DBTYPE ==4">
|
|
,(case
|
|
when t.DT< STR_TO_DATE(#{params.CURRENTWILLDATE},'%Y-%m-%d %H:%k:%s') THEN 'Y' else 'N' end) AS isOverTrace
|
|
</if>
|
|
FROM HANG_TABLE t
|
|
left join ROAD_TABLE rta on(t.REPORTROADNO = rta.roadno)
|
|
left join hangtp_text ht on(t.CARDTP = ht.ID)
|
|
left join TYPE_TEXT tt on(t.TYPE = tt.value)
|
|
left join NAME_TABLE nta on(t.REPORTSTANO = nta.STANO)
|
|
<where>
|
|
<if test="params.id != null and params.id != ''">
|
|
AND t.id = #{params.id}
|
|
</if>
|
|
<if test="params.queryCreateTimeS!= null and params.queryCreateTimeS!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.DT >= dateadd(day,0,#{params.queryCreateTimeS})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.DT >= TO_DATE(#{params.queryCreateTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.DT >= TO_DATE(#{params.queryCreateTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.DT >= STR_TO_DATE(#{params.queryCreateTimeS}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.queryCreateTimeE!= null and params.queryCreateTimeE!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.DT <= dateadd(day,0,#{params.queryCreateTimeE})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.DT <= TO_DATE(#{params.queryCreateTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.DT <= TO_DATE(#{params.queryCreateTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.DT <= STR_TO_DATE(#{params.queryCreateTimeE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.queryrptimeS!= null and params.queryrptimeS!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.RPTIME >= dateadd(day,0,#{params.queryrptimeS})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.RPTIME >= TO_DATE(#{params.queryrptimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.RPTIME >= TO_DATE(#{params.queryrptimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.RPTIME >= STR_TO_DATE(#{params.queryrptimeS}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.queryrptimeE!= null and params.queryrptimeE!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.RPTIME <= dateadd(day,0,#{params.queryrptimeE})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.RPTIME <= TO_DATE(#{params.queryrptimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.RPTIME <= TO_DATE(#{params.queryrptimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.RPTIME <= STR_TO_DATE(#{params.queryrptimeE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.querybegdateS!= null and params.querybegdateS!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.BEGDATE >= dateadd(day,0,#{params.querybegdateS})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.BEGDATE >= TO_DATE(#{params.querybegdateS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.BEGDATE >= TO_DATE(#{params.querybegdateS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.BEGDATE >= STR_TO_DATE(#{params.querybegdateS}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.querybegdateE!= null and params.querybegdateE!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.BEGDATE <= dateadd(day,0,#{params.querybegdateE})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.BEGDATE <= TO_DATE(#{params.querybegdateE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.BEGDATE <= TO_DATE(#{params.querybegdateE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.BEGDATE <= STR_TO_DATE(#{params.querybegdateE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.WILLDATE!= null and params.WILLDATE!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
<!-- 已过追缴期-->
|
|
<if test="params.SPROMPOTY==1">
|
|
AND t.DT < dateadd(day,0,#{params.WILLDATE})
|
|
</if>
|
|
<!-- 未过追缴期-->
|
|
<if test="params.SPROMPOTY==2">
|
|
AND t.DT >=dateadd(day,0,#{params.WILLDATE})
|
|
</if>
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
<!-- 已过追缴期-->
|
|
<if test="params.SPROMPOTY==1">
|
|
AND t.DT < TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<!-- 未过追缴期-->
|
|
<if test="params.SPROMPOTY==2">
|
|
AND t.DT >= TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
<!-- 已过追缴期-->
|
|
<if test="params.SPROMPOTY==1">
|
|
AND t.DT <= TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<!-- 未过追缴期-->
|
|
<if test="params.SPROMPOTY==2">
|
|
AND t.DT >= TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
<!-- 已过追缴期-->
|
|
<if test="params.SPROMPOTY==1">
|
|
AND t.DT <= STR_TO_DATE(#{params.WILLDATE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
<!-- 未过追缴期-->
|
|
<if test="params.SPROMPOTY==2">
|
|
AND t.DT >= STR_TO_DATE(#{params.WILLDATE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
</if>
|
|
<if test="params.SROADNO != null and params.SROADNO != ''">
|
|
AND t.REPORTROADNO = #{params.SROADNO}
|
|
</if>
|
|
<if test="params.SSTANO != null and params.SSTANO != ''">
|
|
AND t.REPORTSTANO = #{params.SSTANO}
|
|
</if>
|
|
<if test="params.SCARDID != null and params.SCARDID != ''">
|
|
AND t.CARDID like '%'|| #{params.SCARDID} || '%'
|
|
</if>
|
|
<if test="params.SCARDTP != null and params.SCARDTP != ''">
|
|
AND t.CARDTP = #{params.SCARDTP}
|
|
</if>
|
|
<if test="params.STYPE != null and params.STYPE != ''">
|
|
AND t.TYPE = #{params.STYPE}
|
|
</if>
|
|
<if test="params.SJTFLAG != null and params.SJTFLAG != ''">
|
|
AND t.JTFLAG = #{params.SJTFLAG}
|
|
</if>
|
|
<if test="params.SPLATECOLOR != null and params.SPLATECOLOR != ''">
|
|
AND t.PLATECOLOR = #{params.SPLATECOLOR}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="getTotalCash" parameterType="java.util.HashMap" resultType="string">
|
|
select
|
|
sum(t.cash)||'' as totalCash
|
|
FROM HANG_TABLE t
|
|
left join ROAD_TABLE rta on(t.REPORTROADNO = rta.roadno)
|
|
left join hangtp_text ht on(t.CARDTP = ht.ID)
|
|
left join TYPE_TEXT tt on(t.TYPE = tt.value)
|
|
left join NAME_TABLE nta on(t.REPORTSTANO = nta.STANO)
|
|
<where>
|
|
<if test="params.id != null and params.id != ''">
|
|
AND t.id = #{params.id}
|
|
</if>
|
|
<if test="params.queryCreateTimeS!= null and params.queryCreateTimeS!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.DT >= dateadd(day,0,#{params.queryCreateTimeS})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.DT >= TO_DATE(#{params.queryCreateTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.DT >= TO_DATE(#{params.queryCreateTimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.DT >= STR_TO_DATE(#{params.queryCreateTimeS}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.queryCreateTimeE!= null and params.queryCreateTimeE!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.DT <= dateadd(day,0,#{params.queryCreateTimeE})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.DT <= TO_DATE(#{params.queryCreateTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.DT <= TO_DATE(#{params.queryCreateTimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.DT <= STR_TO_DATE(#{params.queryCreateTimeE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.queryrptimeS!= null and params.queryrptimeS!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.RPTIME >= dateadd(day,0,#{params.queryrptimeS})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.RPTIME >= TO_DATE(#{params.queryrptimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.RPTIME >= TO_DATE(#{params.queryrptimeS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.RPTIME >= STR_TO_DATE(#{params.queryrptimeS}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.queryrptimeE!= null and params.queryrptimeE!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.RPTIME <= dateadd(day,0,#{params.queryrptimeE})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.RPTIME <= TO_DATE(#{params.queryrptimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.RPTIME <= TO_DATE(#{params.queryrptimeE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.RPTIME <= STR_TO_DATE(#{params.queryrptimeE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.querybegdateS!= null and params.querybegdateS!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.BEGDATE >= dateadd(day,0,#{params.querybegdateS})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.BEGDATE >= TO_DATE(#{params.querybegdateS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.BEGDATE >= TO_DATE(#{params.querybegdateS}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.BEGDATE >= STR_TO_DATE(#{params.querybegdateS}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.querybegdateE!= null and params.querybegdateE!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
AND t.BEGDATE <= dateadd(day,0,#{params.querybegdateE})
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
AND t.BEGDATE <= TO_DATE(#{params.querybegdateE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
AND t.BEGDATE <= TO_DATE(#{params.querybegdateE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
AND t.BEGDATE <= STR_TO_DATE(#{params.querybegdateE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
<if test="params.WILLDATE!= null and params.WILLDATE!= ''">
|
|
<if test="params.DBTYPE == 1">
|
|
<!-- 已过追缴期-->
|
|
<if test="params.SPROMPOTY==1">
|
|
AND t.DT < dateadd(day,0,#{params.WILLDATE})
|
|
</if>
|
|
<!-- 未过追缴期-->
|
|
<if test="params.SPROMPOTY==2">
|
|
AND t.DT >=dateadd(day,0,#{params.WILLDATE})
|
|
</if>
|
|
</if>
|
|
<if test="params.DBTYPE == 2">
|
|
<!-- 已过追缴期-->
|
|
<if test="params.SPROMPOTY==1">
|
|
AND t.DT < TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<!-- 未过追缴期-->
|
|
<if test="params.SPROMPOTY==2">
|
|
AND t.DT >= TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
</if>
|
|
<if test="params.DBTYPE == 3">
|
|
<!-- 已过追缴期-->
|
|
<if test="params.SPROMPOTY==1">
|
|
AND t.DT <= TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
<!-- 未过追缴期-->
|
|
<if test="params.SPROMPOTY==2">
|
|
AND t.DT >= TO_DATE(#{params.WILLDATE}, 'YYYY-MM-DD HH24:mi:ss')
|
|
</if>
|
|
</if>
|
|
<if test="params.DBTYPE == 4">
|
|
<!-- 已过追缴期-->
|
|
<if test="params.SPROMPOTY==1">
|
|
AND t.DT <= STR_TO_DATE(#{params.WILLDATE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
<!-- 未过追缴期-->
|
|
<if test="params.SPROMPOTY==2">
|
|
AND t.DT >= STR_TO_DATE(#{params.WILLDATE}, '%Y-%m-%d %H:%k:%s')
|
|
</if>
|
|
</if>
|
|
</if>
|
|
<if test="params.SROADNO != null and params.SROADNO != ''">
|
|
AND t.REPORTROADNO = #{params.SROADNO}
|
|
</if>
|
|
<if test="params.SSTANO != null and params.SSTANO != ''">
|
|
AND t.REPORTSTANO = #{params.SSTANO}
|
|
</if>
|
|
<if test="params.SCARDID != null and params.SCARDID != ''">
|
|
AND t.CARDID like '%'|| #{params.SCARDID} || '%'
|
|
</if>
|
|
<if test="params.SCARDTP != null and params.SCARDTP != ''">
|
|
AND t.CARDTP = #{params.SCARDTP}
|
|
</if>
|
|
<if test="params.STYPE != null and params.STYPE != ''">
|
|
AND t.TYPE = #{params.STYPE}
|
|
</if>
|
|
<if test="params.SJTFLAG != null and params.SJTFLAG != ''">
|
|
AND t.JTFLAG = #{params.SJTFLAG}
|
|
</if>
|
|
<if test="params.SPLATECOLOR != null and params.SPLATECOLOR != ''">
|
|
AND t.PLATECOLOR = #{params.SPLATECOLOR}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="getHangMaxVarnoBySql" parameterType="java.util.HashMap" resultType="com.nmgs.entity.HangTable">
|
|
select
|
|
max(t.VERNO) as verno
|
|
FROM HANG_TABLE t
|
|
<where>
|
|
<if test="params.whereSql != null and params.whereSql != ''">
|
|
${params.whereSql}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
</mapper> |