|
@@ -4,35 +4,51 @@
|
|
|
|
|
|
<select id="selectDetails" resultType="cn.com.victorysoft.business.cyyzs.entity.FailureReasonDetails">
|
|
<select id="selectDetails" resultType="cn.com.victorysoft.business.cyyzs.entity.FailureReasonDetails">
|
|
select
|
|
select
|
|
- *
|
|
|
|
|
|
+ a.rq, a.dwdm, a.dydm, a.jh, a.gylx, b.flag_name gylx_name,
|
|
|
|
+ case when fsyz_ck = 'Y' then '是' else '否' end fsyz_ck,
|
|
|
|
+ case when jgyz = 'Y' then '是' else '否' end jgyz,
|
|
|
|
+ case when fgq = 'Y' then '是' else '否' end fgq,
|
|
|
|
+ case when psq = 'Y' then '是' else '否' end psq,
|
|
|
|
+ case when xjf = 'Y' then '是' else '否' end xjf,
|
|
|
|
+ case when mdgj = 'Y' then '是' else '否' end mdgj,
|
|
|
|
+ case when mgz = 'Y' then '是' else '否' end mgz,
|
|
|
|
+ case when is_gzdx = 'Y' then '是' else '否' end is_gzdx,
|
|
|
|
+ case when last_is_xjcg = 'Y' then '是' else '否' end last_is_xjcg,
|
|
|
|
+ gjwhxms, zyrj, kzrq, sxrq, yxq, sxyy, qgzfh, zsltbqk,
|
|
|
|
+ d.unitname dwmc, c.blockname dymc
|
|
from
|
|
from
|
|
- water_failure_reason
|
|
|
|
|
|
+ water_failure_reason a
|
|
|
|
+ left join sys_flag b on a.gylx = b.flag_code
|
|
|
|
+ left join sys_blockinfo c on a.dydm = c.blockcode
|
|
|
|
+ left join sys_unitinfo d on a.dwdm = d.unitcode
|
|
|
|
+ left join water_well_basic e on a.jh = e.jh
|
|
where
|
|
where
|
|
1 = 1
|
|
1 = 1
|
|
- <if test="jh != null and jh != ''"> and jh = #{jh}</if>
|
|
|
|
- <if test="dwdm != null and dwdm != ''"> and dwdm = #{dwdm}</if>
|
|
|
|
- <if test="dydm != null and dydm != ''"> and dydm = #{dydm}</if>
|
|
|
|
- <if test="yclx != null and yclx != ''"> </if>
|
|
|
|
- <if test="gylx != null and gylx != ''"> and gylx = #{gylx}</if>
|
|
|
|
|
|
+ <if test="jh != null and jh != ''"> and a.jh = #{jh}</if>
|
|
|
|
+ <if test="dwdm != null and dwdm != ''"> and a.dwdm = #{dwdm}</if>
|
|
|
|
+ <if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
|
|
|
|
+ <if test="yclx != null and yclx != ''"> and e.yclx = #{yclx}</if>
|
|
|
|
+ <if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectListGroupGylx" resultType="cn.com.victorysoft.business.cyyzs.entity.FailureReason">
|
|
<select id="selectListGroupGylx" resultType="cn.com.victorysoft.business.cyyzs.entity.FailureReason">
|
|
select
|
|
select
|
|
a.gylx,
|
|
a.gylx,
|
|
(select flag_name from sys_flag where flag_code = a.gylx) gylx_name,
|
|
(select flag_name from sys_flag where flag_code = a.gylx) gylx_name,
|
|
- sum(case when fsyz_ck = 'Y' then 1 else 0 end ) fsyz_ck,
|
|
|
|
- sum(case when jgyz = 'Y' then 1 else 0 end ) jgyz,
|
|
|
|
- sum(case when fgq = 'Y' then 1 else 0 end ) fgq,
|
|
|
|
- sum(case when psq = 'Y' then 1 else 0 end ) psq,
|
|
|
|
- sum(case when xjf = 'Y' then 1 else 0 end ) xjf,
|
|
|
|
- sum(case when mdgj = 'Y' then 1 else 0 end ) mdgj,
|
|
|
|
- sum(case when mgz = 'Y' then 1 else 0 end ) mgz
|
|
|
|
|
|
+ sum(case when a.fsyz_ck = 'Y' then 1 else 0 end ) fsyz_ck,
|
|
|
|
+ sum(case when a.jgyz = 'Y' then 1 else 0 end ) jgyz,
|
|
|
|
+ sum(case when a.fgq = 'Y' then 1 else 0 end ) fgq,
|
|
|
|
+ sum(case when a.psq = 'Y' then 1 else 0 end ) psq,
|
|
|
|
+ sum(case when a.xjf = 'Y' then 1 else 0 end ) xjf,
|
|
|
|
+ sum(case when a.mdgj = 'Y' then 1 else 0 end ) mdgj,
|
|
|
|
+ sum(case when a.mgz = 'Y' then 1 else 0 end ) mgz
|
|
from
|
|
from
|
|
water_failure_reason a
|
|
water_failure_reason a
|
|
|
|
+ left join water_well_basic b on a.jh = b.jh
|
|
where
|
|
where
|
|
1 = 1
|
|
1 = 1
|
|
<if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
|
|
<if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
|
|
- <if test="yclx != null and yclx != ''"></if>
|
|
|
|
|
|
+ <if test="yclx != null and yclx != ''"> and b.yclx = #{yclx}</if>
|
|
<if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
|
|
<if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
|
|
<if test="dwdm != null and dwdm != ''"> and a.dwdm = #{dwdm}</if>
|
|
<if test="dwdm != null and dwdm != ''"> and a.dwdm = #{dwdm}</if>
|
|
group by
|
|
group by
|
|
@@ -70,10 +86,11 @@
|
|
sum(case when fsyz_ck = 'Y' then 1 else 0 end ) fsyz_ck
|
|
sum(case when fsyz_ck = 'Y' then 1 else 0 end ) fsyz_ck
|
|
from
|
|
from
|
|
water_failure_reason a
|
|
water_failure_reason a
|
|
|
|
+ left join water_well_basic b on a.jh = b.jh
|
|
where
|
|
where
|
|
1 = 1
|
|
1 = 1
|
|
<if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
|
|
<if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
|
|
- <if test="yclx != null and yclx != ''"></if>
|
|
|
|
|
|
+ <if test="yclx != null and yclx != ''"> and b.yclx = #{yclx}</if>
|
|
<if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
|
|
<if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
|
|
<if test="dwdm != null and dwdm != ''"> and a.dwdm = #{dwdm}</if>
|
|
<if test="dwdm != null and dwdm != ''"> and a.dwdm = #{dwdm}</if>
|
|
group by
|
|
group by
|
|
@@ -91,10 +108,11 @@
|
|
sum(case when mgz = 'Y' then 1 else 0 end ) "埋管柱"
|
|
sum(case when mgz = 'Y' then 1 else 0 end ) "埋管柱"
|
|
from
|
|
from
|
|
water_failure_reason a
|
|
water_failure_reason a
|
|
|
|
+ left join water_well_basic b on a.jh = b.jh
|
|
where
|
|
where
|
|
1 = 1
|
|
1 = 1
|
|
<if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
|
|
<if test="gylx != null and gylx != ''"> and a.gylx = #{gylx}</if>
|
|
- <if test="yclx != null and yclx != ''"></if>
|
|
|
|
|
|
+ <if test="yclx != null and yclx != ''"> and b.yclx = #{yclx}</if>
|
|
<if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
|
|
<if test="dydm != null and dydm != ''"> and a.dydm = #{dydm}</if>
|
|
<if test="dwdm != null and dwdm != ''"> and a.dwdm = #{dwdm}</if>
|
|
<if test="dwdm != null and dwdm != ''"> and a.dwdm = #{dwdm}</if>
|
|
</select>
|
|
</select>
|