|
@@ -79,16 +79,20 @@
|
|
from PUB_PUBLICITYPOSITION p
|
|
from PUB_PUBLICITYPOSITION p
|
|
inner join ZZ_ZZQKXX z on p.partycode=z.dzzdm
|
|
inner join ZZ_ZZQKXX z on p.partycode=z.dzzdm
|
|
inner join (select pn.*, (case
|
|
inner join (select pn.*, (case
|
|
- when pn.EXPIREDTIME is not null and pn.PANELCYCLE <![CDATA[ <> ]]> 1 and to_number(date_format(sysdate,'yyyymmdd'))
|
|
|
|
|
|
+ when pn.EXPIREDTIME is not null and pn.PANELCYCLE <![CDATA[ <> ]]> 1 and to_number(TO_CHAR(sysdate,'YYYYMMDD'))
|
|
> pn.EXPIREDTIME then 1
|
|
> pn.EXPIREDTIME then 1
|
|
else 0 end) as ISEXPIRED from (
|
|
else 0 end) as ISEXPIRED from (
|
|
- select pn.*,to_number(concat(date_format(add_months(trunc(PANELTIME,'%m'),
|
|
|
|
- case PANELCYCLE
|
|
|
|
- when 2 then 1
|
|
|
|
- when 3 then 3
|
|
|
|
- when 4 then 6
|
|
|
|
- when 5 then 12
|
|
|
|
- else 0 end),'yyyymm'),date_format(PANELTIME,'%d'))) as EXPIREDTIME from PUB_PUBLICITYPOSITION_PANEL pn
|
|
|
|
|
|
+ select pn.*,to_number(concat(to_char(add_months(trunc(PANELTIME, 'mm'), 1), 'YYYYMM'), '01')),
|
|
|
|
+ TO_CHAR(ADD_MONTHS(PANELTIME,
|
|
|
|
+ CASE PANELCYCLE
|
|
|
|
+ WHEN 2 THEN 1
|
|
|
|
+ WHEN 3 THEN 3
|
|
|
|
+ WHEN 4 THEN 6
|
|
|
|
+ WHEN 5 THEN 12
|
|
|
|
+ ELSE 0
|
|
|
|
+ END
|
|
|
|
+ ),'yyyymm' || TO_CHAR(PANELTIME, 'dd')) AS EXPIREDTIME
|
|
|
|
+ from PUB_PUBLICITYPOSITION_PANEL pn
|
|
) pn
|
|
) pn
|
|
) panel on p.publicityPositionId = panel.publicityPositionId
|
|
) panel on p.publicityPositionId = panel.publicityPositionId
|
|
where 1 = 1
|
|
where 1 = 1
|
|
@@ -108,10 +112,10 @@
|
|
and p.address like concat('%',#{address},'%')
|
|
and p.address like concat('%',#{address},'%')
|
|
</if>
|
|
</if>
|
|
<if test="beginTime != null and beginTime != '' ">
|
|
<if test="beginTime != null and beginTime != '' ">
|
|
- and p.buildTime <![CDATA[ >= ]]> date_format(#{beginTime},'%Y%m%d')
|
|
|
|
|
|
+ and p.buildTime <![CDATA[ >= ]]> TO_CHAR(#{beginTime},'YYYYMMDD')
|
|
</if>
|
|
</if>
|
|
<if test="endTime != null and endTime != '' ">
|
|
<if test="endTime != null and endTime != '' ">
|
|
- and p.buildTime <![CDATA[ < ]]> date_add(date_format(#{endTime},'%Y%m%d'),interval 1 day)
|
|
|
|
|
|
+ and p.buildTime <![CDATA[ < ]]> date_add(TO_CHAR(#{endTime},'YYYYMMDD'),interval 1 day)
|
|
</if>
|
|
</if>
|
|
<if test="positionState != null">
|
|
<if test="positionState != null">
|
|
and p.positionState = #{positionState}
|
|
and p.positionState = #{positionState}
|
|
@@ -129,10 +133,10 @@
|
|
and SUBSTR(p.partyCode,1,12) in(select dzzdm from ZZ_DZZFBQK where zzfb= #{zzfbType})
|
|
and SUBSTR(p.partyCode,1,12) in(select dzzdm from ZZ_DZZFBQK where zzfb= #{zzfbType})
|
|
</if>
|
|
</if>
|
|
<if test="updateTime_bt != null and updateTime_bt != '' ">
|
|
<if test="updateTime_bt != null and updateTime_bt != '' ">
|
|
- and panel.PANELTIME <![CDATA[ >= ]]> date_format(#{updateTime_bt},'%Y%m%d')
|
|
|
|
|
|
+ and panel.PANELTIME <![CDATA[ >= ]]> TO_CHAR(#{updateTime_bt},'YYYYMMDD')
|
|
</if>
|
|
</if>
|
|
<if test="updateTime_et != null and updateTime_et != '' ">
|
|
<if test="updateTime_et != null and updateTime_et != '' ">
|
|
- and panel.PANELTIME <![CDATA[ < ]]> date_add(date_format(#{updateTime_et},'%Y%m%d'),interval 1 day)
|
|
|
|
|
|
+ and panel.PANELTIME <![CDATA[ < ]]> date_add(TO_CHAR(#{updateTime_et},'YYYYMMDD'),interval 1 day)
|
|
</if>
|
|
</if>
|
|
order by panel.PANELTIME desc nulls last
|
|
order by panel.PANELTIME desc nulls last
|
|
</select>
|
|
</select>
|
|
@@ -177,10 +181,10 @@
|
|
and u.userName like concat('%',#{userName},'%')
|
|
and u.userName like concat('%',#{userName},'%')
|
|
</if>
|
|
</if>
|
|
<if test="beginTime != null and beginTime != '' ">
|
|
<if test="beginTime != null and beginTime != '' ">
|
|
- and u.findTime <![CDATA[ >= ]]> date_format(#{beginTime},'%Y%m%d')
|
|
|
|
|
|
+ and u.findTime <![CDATA[ >= ]]> TO_CHAR(#{beginTime},'YYYYMMDD')
|
|
</if>
|
|
</if>
|
|
<if test="endTime != null and endTime != '' ">
|
|
<if test="endTime != null and endTime != '' ">
|
|
- and u.findTime <![CDATA[ < ]]> date_add(date_format(#{endTime},'%Y%m%d'),interval 1 day)
|
|
|
|
|
|
+ and u.findTime <![CDATA[ < ]]> date_add(TO_CHAR(#{endTime},'YYYYMMDD'),interval 1 day)
|
|
</if>
|
|
</if>
|
|
<if test="handleType != null">
|
|
<if test="handleType != null">
|
|
and u.handleType = #{handleType}
|
|
and u.handleType = #{handleType}
|
|
@@ -199,7 +203,7 @@
|
|
|
|
|
|
<!--统计职工思想动态-->
|
|
<!--统计职工思想动态-->
|
|
<select id="selectThoughtTotal" resultType="java.util.HashMap">
|
|
<select id="selectThoughtTotal" resultType="java.util.HashMap">
|
|
- select date_format(u.FINDTIME,'yyyy') as year,date_format(u.FINDTIME,'%m') as month,
|
|
|
|
|
|
+ select TO_CHAR(u.FINDTIME, 'yyyy') AS year,TO_CHAR(u.FINDTIME, 'mm') AS month,
|
|
sum(case when u.QUESTIONTYPE=1 then 1 else 0 end) as NUM_THOUGHTTYPE1,
|
|
sum(case when u.QUESTIONTYPE=1 then 1 else 0 end) as NUM_THOUGHTTYPE1,
|
|
sum(case when u.QUESTIONTYPE=2 then 1 else 0 end) as NUM_THOUGHTTYPE2,
|
|
sum(case when u.QUESTIONTYPE=2 then 1 else 0 end) as NUM_THOUGHTTYPE2,
|
|
sum(case when u.QUESTIONTYPE=3 then 1 else 0 end) as NUM_THOUGHTTYPE3,
|
|
sum(case when u.QUESTIONTYPE=3 then 1 else 0 end) as NUM_THOUGHTTYPE3,
|
|
@@ -214,12 +218,12 @@
|
|
and u.partyCode like concat('%',#{partyCode},'%')
|
|
and u.partyCode like concat('%',#{partyCode},'%')
|
|
</if>
|
|
</if>
|
|
<if test="year!=null">
|
|
<if test="year!=null">
|
|
- and date_format(u.FINDTIME,'%Y')= #{year}
|
|
|
|
|
|
+ and TO_CHAR(u.FINDTIME,'yyyy')= #{year}
|
|
</if>
|
|
</if>
|
|
<if test="month!=null">
|
|
<if test="month!=null">
|
|
- and date_format(u.FINDTIME,'%m')= #{month}
|
|
|
|
|
|
+ and TO_CHAR(u.FINDTIME,'mm')= #{month}
|
|
</if>
|
|
</if>
|
|
- group by date_format(u.FINDTIME,'%Y'),date_format(u.FINDTIME,'%m')
|
|
|
|
|
|
+ group by TO_CHAR(u.FINDTIME,'yyyy'),TO_CHAR(u.FINDTIME,'mm')
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!--职工思想动态分析-->
|
|
<!--职工思想动态分析-->
|
|
@@ -322,10 +326,10 @@
|
|
and u.leaderType = #{leaderType}
|
|
and u.leaderType = #{leaderType}
|
|
</if>
|
|
</if>
|
|
<if test="beginTime != null and beginTime != '' ">
|
|
<if test="beginTime != null and beginTime != '' ">
|
|
- and u.leaderTime <![CDATA[ >= ]]> date_format(#{beginTime},'%Y%m%d')
|
|
|
|
|
|
+ and u.leaderTime <![CDATA[ >= ]]> TO_CHAR(#{beginTime},'YYYYMMDD')
|
|
</if>
|
|
</if>
|
|
<if test="endTime != null and endTime != '' ">
|
|
<if test="endTime != null and endTime != '' ">
|
|
- and u.leaderTime <![CDATA[ < ]]> date_add(date_format(#{endTime},'%Y%m%d'),interval 1 day)
|
|
|
|
|
|
+ and u.leaderTime <![CDATA[ < ]]> date_add(TO_CHAR(#{endTime},'YYYYMMDD'),interval 1 day)
|
|
</if>
|
|
</if>
|
|
<if test="zzfbType != null">
|
|
<if test="zzfbType != null">
|
|
and SUBSTR(u.partyCode,1,12) in(select dzzdm from ZZ_DZZFBQK where zzfb= #{zzfbType})
|
|
and SUBSTR(u.partyCode,1,12) in(select dzzdm from ZZ_DZZFBQK where zzfb= #{zzfbType})
|
|
@@ -362,10 +366,10 @@
|
|
inner join ZZ_ZZQKXX p on SUBSTR(us.SZDZBDM,1,#{partyLength})=p.dzzdm
|
|
inner join ZZ_ZZQKXX p on SUBSTR(us.SZDZBDM,1,#{partyLength})=p.dzzdm
|
|
left join US_USERLEADER l on us.RYBM=l.USERCODE
|
|
left join US_USERLEADER l on us.RYBM=l.USERCODE
|
|
<if test="beginTime != null and beginTime != '' ">
|
|
<if test="beginTime != null and beginTime != '' ">
|
|
- and l.leaderTime <![CDATA[ >= ]]> date_format(#{beginTime},'%Y%m%d')
|
|
|
|
|
|
+ and l.leaderTime <![CDATA[ >= ]]> TO_CHAR(#{beginTime},'YYYYMMDD')
|
|
</if>
|
|
</if>
|
|
<if test="endTime != null and endTime != '' ">
|
|
<if test="endTime != null and endTime != '' ">
|
|
- and l.leaderTime <![CDATA[ < ]]> date_add(date_format(#{endTime},'%Y%m%d'),interval 1 day)
|
|
|
|
|
|
+ and l.leaderTime <![CDATA[ < ]]> date_add(TO_CHAR(#{endTime},'YYYYMMDD'),interval 1 day)
|
|
</if>
|
|
</if>
|
|
left join vw_partyduty uszw on us.RYBM=uszw.rybm -- 党内职务名称
|
|
left join vw_partyduty uszw on us.RYBM=uszw.rybm -- 党内职务名称
|
|
where 1=1
|
|
where 1=1
|
|
@@ -517,7 +521,7 @@
|
|
, ifnull(us.endYearMonth,999999) as endYearMonth
|
|
, ifnull(us.endYearMonth,999999) as endYearMonth
|
|
from (select dic.DICKEY as MONTH from cf_dictionary dic where dic.DICTYPEKEY='monthType') m,(
|
|
from (select dic.DICKEY as MONTH from cf_dictionary dic where dic.DICTYPEKEY='monthType') m,(
|
|
select us.rybm,us.xm,ifnull(fb.partyDuesStartMonth,(cast(substr(dj.JRZGZZRQ, 1, 6) as signed))) startYearMonth,
|
|
select us.rybm,us.xm,ifnull(fb.partyDuesStartMonth,(cast(substr(dj.JRZGZZRQ, 1, 6) as signed))) startYearMonth,
|
|
- cast(substr(DATE_FORMAT(fb.archiveDate, '%Y%m%d'), 1, 6) as signed) as endYearMonth
|
|
|
|
|
|
+ cast(substr(TO_CHAR(fb.archiveDate, 'YYYYMMDD'), 1, 6) as signed) as endYearMonth
|
|
from vm_ryjbxx_all us
|
|
from vm_ryjbxx_all us
|
|
inner join rs_ryjbxxfb fb on us.rybm = fb.rybm
|
|
inner join rs_ryjbxxfb fb on us.rybm = fb.rybm
|
|
inner join ZZ_DJXX dj on us.rybm = dj.rybm
|
|
inner join ZZ_DJXX dj on us.rybm = dj.rybm
|
|
@@ -577,10 +581,10 @@
|
|
and q.partyCode like concat('%',#{partyCode},'%')
|
|
and q.partyCode like concat('%',#{partyCode},'%')
|
|
</if>
|
|
</if>
|
|
<if test="beginTime != null and beginTime != '' ">
|
|
<if test="beginTime != null and beginTime != '' ">
|
|
- and q.USETIME <![CDATA[ >= ]]> date_format(#{beginTime},'%Y%m%d')
|
|
|
|
|
|
+ and q.USETIME <![CDATA[ >= ]]> TO_CHAR(#{beginTime},'YYYYMMDD')
|
|
</if>
|
|
</if>
|
|
<if test="endTime != null and endTime != '' ">
|
|
<if test="endTime != null and endTime != '' ">
|
|
- and q.USETIME <![CDATA[ < ]]> date_add(date_format(#{endTime},'%Y%m%d'),interval 1 day)
|
|
|
|
|
|
+ and q.USETIME <![CDATA[ < ]]> date_add(TO_CHAR(#{endTime},'YYYYMMDD'),interval 1 day)
|
|
</if>
|
|
</if>
|
|
<if test="zzfbType != null">
|
|
<if test="zzfbType != null">
|
|
and SUBSTR(q.partyCode,1,12) in(select dzzdm from ZZ_DZZFBQK where zzfb= #{zzfbType})
|
|
and SUBSTR(q.partyCode,1,12) in(select dzzdm from ZZ_DZZFBQK where zzfb= #{zzfbType})
|
|
@@ -711,7 +715,7 @@
|
|
select p.PARTYCODE as DZZDM,
|
|
select p.PARTYCODE as DZZDM,
|
|
p.POSITIONTYPE,
|
|
p.POSITIONTYPE,
|
|
sum(case
|
|
sum(case
|
|
- when date_format(panel.PANELTIME, '%Y') = date_format(sysdate(), '%Y') then 1
|
|
|
|
|
|
+ when TO_CHAR(panel.PANELTIME, 'YYYY') = TO_CHAR(sysdate(), 'YYYY') then 1
|
|
else 0 end) as NUM_UPDATE,
|
|
else 0 end) as NUM_UPDATE,
|
|
sum(case when panel.PANELID is null then 1 else 0 end) as NUM_NOT_UPDATE,
|
|
sum(case when panel.PANELID is null then 1 else 0 end) as NUM_NOT_UPDATE,
|
|
sum(case when panel.PANELSTATE = 0 then 1 else 0 end) as NUM_NOT_APPROVE
|
|
sum(case when panel.PANELSTATE = 0 then 1 else 0 end) as NUM_NOT_APPROVE
|
|
@@ -733,19 +737,20 @@
|
|
left join (select pn.*,
|
|
left join (select pn.*,
|
|
(case
|
|
(case
|
|
when pn.EXPIREDTIME is not null and pn.PANELCYCLE != 1 and
|
|
when pn.EXPIREDTIME is not null and pn.PANELCYCLE != 1 and
|
|
- cast(date_format(sysdate(), '%Y%m%d') as SIGNED INTEGER)
|
|
|
|
|
|
+ cast(TO_CHAR(sysdate(), 'YYYYMMDD') as SIGNED INTEGER)
|
|
> pn.EXPIREDTIME then 1
|
|
> pn.EXPIREDTIME then 1
|
|
else 0 end) as ISEXPIRED
|
|
else 0 end) as ISEXPIRED
|
|
from (
|
|
from (
|
|
select pn.*,
|
|
select pn.*,
|
|
- cast(concat(date_format(DATE_ADD(PANELTIME,
|
|
|
|
- INTERVAL (case PANELCYCLE
|
|
|
|
- when 2 then 1
|
|
|
|
- when 3 then 3
|
|
|
|
- when 4 then 6
|
|
|
|
- when 5 then 12
|
|
|
|
- else 0 end) day),'%Y%m%d'),
|
|
|
|
- date_format(PANELTIME, '%d')) as SIGNED INTEGER) as EXPIREDTIME
|
|
|
|
|
|
+ CAST(TO_CHAR(ADD_DAYS(PANELTIME,
|
|
|
|
+ CASE PANELCYCLE
|
|
|
|
+ WHEN 2 THEN 1
|
|
|
|
+ WHEN 3 THEN 3
|
|
|
|
+ WHEN 4 THEN 6
|
|
|
|
+ WHEN 5 THEN 12
|
|
|
|
+ ELSE 0
|
|
|
|
+ END),
|
|
|
|
+ 'yyyymmdd') || TO_CHAR(PANELTIME, 'dd') AS INTEGER) AS EXPIREDTIME
|
|
from PUB_PUBLICITYPOSITION_PANEL pn
|
|
from PUB_PUBLICITYPOSITION_PANEL pn
|
|
) pn
|
|
) pn
|
|
) panel on p.publicityPositionId = panel.publicityPositionId
|
|
) panel on p.publicityPositionId = panel.publicityPositionId
|
|
@@ -862,10 +867,10 @@
|
|
and pay.payState = #{payState}
|
|
and pay.payState = #{payState}
|
|
</if>
|
|
</if>
|
|
<if test="startDate!=null">
|
|
<if test="startDate!=null">
|
|
- and pay.payTime <![CDATA[ >= ]]> date_format(#{startDate},"%Y%m%d")
|
|
|
|
|
|
+ and pay.payTime <![CDATA[ >= ]]> TO_CHAR(#{startDate},"YYYYMMDD")
|
|
</if>
|
|
</if>
|
|
<if test="endDate!=null">
|
|
<if test="endDate!=null">
|
|
- and pay.payTime <![CDATA[ < ]]> date_add(date_format(#{endDate},'%Y%m%d'),interval 1 day)
|
|
|
|
|
|
+ and pay.payTime <![CDATA[ < ]]> date_add(TO_CHAR(#{endDate},'YYYYMMDD'),interval 1 day)
|
|
</if>
|
|
</if>
|
|
<if test="year!=null">
|
|
<if test="year!=null">
|
|
and pdd.year = #{year}
|
|
and pdd.year = #{year}
|