| | |
| | | |
| | | |
| | | <select id="selectMountainrainPage" resultMap="mountainrainResultMap"> |
| | | select * from blade_mountainrain |
| | | select * |
| | | from blade_mountainrain |
| | | </select> |
| | | <select id="selectNoticePage" resultMap="ResultMap"> |
| | | SELECT |
| | |
| | | ORDER BY mr.cenconding |
| | | </select> |
| | | <select id="selectInfo" resultMap="ResultMap"> |
| | | SELECT |
| | | mr.id, |
| | | SELECT mr.id, |
| | | mr.cenconding, |
| | | mr.aconding, |
| | | mr.township, |
| | |
| | | isnull(mr.imohour,0) imohour, |
| | | isnull(mr.imthour,0) imthour, |
| | | isnull(mr.imshour,0) imshour |
| | | FROM |
| | | dbo.blade_mountain mr |
| | | FROM dbo.blade_mountain mr |
| | | where mr.id=#{id} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectcInfos" resultMap="mountainrainResultMapcInfo"> |
| | | SELECT |
| | | cs.id, |
| | | SELECT cs.id, |
| | | cs.cenconding, |
| | | cs.crainfall, |
| | | isnull(cs.gohour,0) gohour, |
| | |
| | | isnull(cs.fyear,0) as fyear , |
| | | isnull(cs.tyear,0) as tyear, |
| | | isnull(cs.oyear,0) as oyear |
| | | FROM |
| | | ( SELECT id,cenconding,crainfall,township, village, village_group, dj, bw,county,fyear,tyear,oyear,gohour,gthour,gshour,imohour,imthour,imshour FROM blade_mountain ) cs |
| | | FROM (SELECT id, |
| | | cenconding, |
| | | crainfall, |
| | | township, |
| | | village, |
| | | village_group, |
| | | dj, |
| | | bw, |
| | | county, |
| | | fyear, |
| | | tyear, |
| | | oyear, |
| | | gohour, |
| | | gthour, |
| | | gshour, |
| | | imohour, |
| | | imthour, |
| | | imshour |
| | | FROM blade_mountain) cs |
| | | INNER JOIN ( |
| | | SELECT ISNULL(SUM(str.DRP), 0) AS drp1, |
| | | STCD |
| | | FROM dbo.ST_PPTN_R str |
| | | WHERE str.TM > #{dateEnd1} |
| | | AND str.TM <= #{times} |
| | | GROUP BY STCD |
| | | ) css ON css.STCD = cs.cenconding |
| | | FULL JOIN ( |
| | | SELECT ISNULL(SUM(s.DRP), 0) AS drp3, |
| | | STCD |
| | | FROM dbo.ST_PPTN_R s |
| | | WHERE s.TM > #{dateEnd3} |
| | | AND s.TM <= #{times} |
| | | GROUP BY STCD |
| | | ) cs2 ON cs2.STCD = cs.cenconding |
| | | FULL JOIN ( |
| | | SELECT ISNULL(SUM(strs.DRP), 0) AS drp6, |
| | | STCD |
| | | FROM dbo.ST_PPTN_R strs |
| | | WHERE strs.TM > #{dateEnd6} |
| | | AND strs.TM <= #{times} |
| | | GROUP BY STCD |
| | | ) cs6 ON cs6.STCD = cs.cenconding |
| | | FULL JOIN ( |
| | | SELECT SUM(strd.DRP) AS dyp, |
| | | STCD |
| | | FROM dbo.ST_PPTN_R strd |
| | | WHERE strd.TM > #{timess} |
| | | AND strd.TM <= #{times} |
| | | GROUP BY STCD |
| | | ) csd on csd.STCD = cs.cenconding |
| | | </select> |
| | | |
| | | |
| | | <select id="selectCode" resultType="java.lang.String"> |
| | | SELECT stuff(( |
| | | SELECT ',' + CONVERT(VARCHAR (25), cenconding) |
| | | FROM dbo.blade_mountain FOR XML PATH ('')), |
| | | 1, |
| | | 1, |
| | | '' |
| | | ) AS siteids |
| | | </select> |
| | | |
| | | <select id="Mountains"> |
| | | SELECT |
| | | a.drp1, |
| | | b.drp3, |
| | | c.drp6, |
| | | d.dyp, |
| | | cs.* |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ISNULL( SUM ( str.DRP ), 0 ) AS drp1, |
| | | STCD |
| | |
| | | WHERE |
| | | str.TM >#{dateEnd1} |
| | | AND str.TM <=#{times} |
| | | AND str.STCD IN (${code}) |
| | | GROUP BY |
| | | STCD |
| | | ) css ON css.STCD = cs.cenconding |
| | | str.STCD |
| | | ) a |
| | | FULL JOIN ( |
| | | SELECT |
| | | ISNULL( SUM ( s.DRP ), 0 ) AS drp3, |
| | |
| | | WHERE |
| | | s.TM >#{dateEnd3} |
| | | AND s.TM <=#{times} |
| | | AND s.STCD IN (${code}) |
| | | GROUP BY |
| | | STCD |
| | | ) cs2 ON cs2.STCD = cs.cenconding |
| | | s.STCD |
| | | ) b ON a.STCD= b.STCD |
| | | FULL JOIN ( |
| | | SELECT |
| | | ISNULL( SUM ( strs.DRP ), 0 ) AS drp6, |
| | |
| | | dbo.ST_PPTN_R strs |
| | | WHERE |
| | | strs.TM >#{dateEnd6} |
| | | AND strs.TM <=#{times} |
| | | AND strs.TM<= #{times} AND strs.STCD IN (${code}) |
| | | GROUP BY |
| | | STCD |
| | | ) cs6 ON cs6.STCD = cs.cenconding |
| | | ) c ON a.STCD= c.STCD |
| | | FULL JOIN ( |
| | | SELECT |
| | | SUM( strd.DRP ) AS dyp,STCD |
| | |
| | | dbo.ST_PPTN_R strd |
| | | WHERE |
| | | strd.TM >#{timess} |
| | | AND strd.TM <=#{times} |
| | | AND strd.TM<= #{times} AND strd.STCD IN (${code}) |
| | | GROUP BY STCD |
| | | ) csd on csd.STCD=cs.cenconding |
| | | ) d on d.STCD=a.STCD |
| | | LEFT JOIN ( |
| | | SELECT |
| | | id, |
| | | cenconding, |
| | | crainfall, |
| | | township, |
| | | village, |
| | | village_group, |
| | | dj, |
| | | bw, |
| | | county, |
| | | fyear, |
| | | tyear, |
| | | oyear, |
| | | gohour, |
| | | gthour, |
| | | gshour, |
| | | imohour, |
| | | imthour, |
| | | imshour |
| | | FROM |
| | | blade_mountain |
| | | ) cs ON cs.cenconding= a.STCD |
| | | </select> |
| | | </mapper> |