| | |
| | | <select id="getList" resultType="cn.gistack.sm.sjztmd.vo.TbProjectVO"> |
| | | |
| | | SELECT |
| | | * |
| | | tb.*,b."actual_fund" |
| | | FROM SJZT_MD."tb_project" tb |
| | | left join ( |
| | | SELECT "tb_project_id",sum("actual_fund") as "actual_fund" from SJZT_MD."tb_project_schedule" |
| | | <if test="vo.tbYear != null and vo.tbYear != ''"> |
| | | where "year" = #{vo.tbYear} |
| | | </if> |
| | | group by "tb_project_id" |
| | | ) b |
| | | on (tb."guid" = b."tb_project_id") |
| | | where |
| | | tb."is_deleted" = 0 |
| | | <if test="vo.tbYear != null and vo.tbYear != ''"> |
| | | and tb."tb_year" = #{vo.tbYear} |
| | | </if> |
| | | <if test="vo.cityCode != null and vo.cityCode != ''"> |
| | | and tb."city_code" = #{vo.cityCode} |
| | | </if> |
| | |
| | | <result property="contractUrl" column="contract_url"/> |
| | | <result property="checkDate" column="check_date"/> |
| | | <result property="planCheckDate" column="plan_check_date"/> |
| | | <result property="planName" column="plan_name"/> |
| | | <result property="planFeedBackName" column="plan_feed_back_name"/> |
| | | <result property="govName" column="gov_name"/> |
| | | <result property="contractName" column="contract_name"/> |
| | | <result property="checkName" column="check_name"/> |
| | | |
| | | <result property="isCheck" column="is_check"/> |
| | | <result property="checkUrl" column="check_url"/> |
| | |
| | | <result property="year" column="year"/> |
| | | <result property="month" column="month"/> |
| | | <result property="actualFund" column="actual_fund"/> |
| | | <result property="payOrderUrl" column="pay_order_url"/> |
| | | <result property="payOrderName" column="pay_order_name"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | |
| | | TPS."guid" as scheduleId, |
| | | TPS."year", |
| | | TPS."month", |
| | | TPS."actual_fund" |
| | | TPS."actual_fund",TPS."pay_order_name",TPS."pay_order_url" |
| | | from sjzt_md."tb_project" tb |
| | | LEFT JOIN SJZT_MD."tb_project_schedule" TPS ON TPS."tb_project_id" = tb."guid" |
| | | where |
| | |
| | | levelTwoLength, |
| | | levelThreeLength, |
| | | levelFourLength, |
| | | levelFiveLength |
| | | levelFiveLength, |
| | | dykeLengthAll, |
| | | levelOneLengthAll, |
| | | levelTwoLengthAll, |
| | | levelThreeLengthAll, |
| | | levelFourLengthAll, |
| | | levelFiveLengthAll |
| | | FROM YWXT."att_ad_base" aab |
| | | left join ( |
| | | SELECT |
| | |
| | | ) arb ON ((arb.townCode = aab."guid")or(arb.countyCode = aab."guid") or (arb.cityCode = aab."guid") or (arb.provinceCode = aab."guid") ) |
| | | right join sjzt_md."tb_res_general_investigation_state" trgis on trgis."res_guid" = arb."code" |
| | | <!--统计待审核和已审核的--> |
| | | and (trgis."check_state" = 2) |
| | | and (trgis."check_state" >= 2) |
| | | <if test="params.tbYear != null and params.tbYear != ''"> |
| | | and trgis."tb_year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbQuarter != null and params.tbQuarter != ''"> |
| | | and trgis."tb_quarter" = #{params.tbQuarter} |
| | | </if> |
| | | group by aab."guid",aab."ad_name" |
| | | )res on res."guid" = aab."guid" |
| | |
| | | <if test="params.tbYear != null and params.tbYear != ''"> |
| | | AND tdi."tb_year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbQuarter != null and params.tbQuarter != ''"> |
| | | and tdi."tb_quarter" = #{params.tbQuarter} |
| | | </if> |
| | | group by tdi."tb_state_id",tdi."dyke_guid",tdi."unit" |
| | | )TEMP1 |
| | | ) tdi on tdi."tb_state_id" = tdis."guid" |
| | | <!--统计待审核和已审核的--> |
| | | where (tdis."check_state" = 1 or tdis."check_state" = 2) |
| | | where (tdis."check_state" >= 2) |
| | | ) trd |
| | | LEFT JOIN YWXT."att_ad_base" county ON county."ad_code" = trd."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" city ON city."ad_code" = county."p_ad_code" |
| | |
| | | )trd on ((trd.countyCode = aab."guid") or (trd.cityCode = aab."guid") or (trd.provinceCode = aab."guid")) |
| | | group by aab."guid",aab."ad_name" |
| | | )dyke on dyke."guid" = aab."guid" |
| | | |
| | | left join ( |
| | | SELECT |
| | | aab."guid", |
| | | aab."ad_name", |
| | | SUM(CASE WHEN tb."actual_fund" then tb."actual_fund" else 0 end) as totalActualFund |
| | | SUM(CASE WHEN trd."guid" is not null then trd."dyke_length" else 0 END) as dykeLengthAll, |
| | | SUM(CASE WHEN trd."dyke_level" = '1级' THEN trd."dyke_length" ELSE 0 END) AS levelOneLengthAll, |
| | | SUM(CASE WHEN trd."dyke_level" = '2级' THEN trd."dyke_length" ELSE 0 END) AS levelTwoLengthAll, |
| | | SUM(CASE WHEN trd."dyke_level" = '3级' THEN trd."dyke_length" ELSE 0 END)AS levelThreeLengthAll, |
| | | SUM(CASE WHEN trd."dyke_level" = '4级' THEN trd."dyke_length" ELSE 0 END) AS levelFourLengthAll, |
| | | SUM(CASE WHEN trd."dyke_level" = '5级' THEN trd."dyke_length" ELSE 0 END) AS levelFiveLengthAll |
| | | FROM YWXT."att_ad_base" aab |
| | | left join ( |
| | | select trd."guid", |
| | | trd."dyke_length", |
| | | trd."dyke_level", |
| | | county."guid" as countyCode, |
| | | city."guid" as cityCode, |
| | | province."guid" as provinceCode |
| | | from sjzt_md."tb_res_dyke" trd |
| | | LEFT JOIN YWXT."att_ad_base" county ON county."ad_code" = trd."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" city ON city."ad_code" = county."p_ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" province ON province."ad_code" = city."p_ad_code" |
| | | ) trd on ((trd.countyCode = aab."guid") or (trd.cityCode = aab."guid") or (trd.provinceCode = aab."guid")) |
| | | group by aab."guid",aab."ad_name" |
| | | ) dykeAll on dykeAll."guid" = aab."guid" |
| | | |
| | | left join ( |
| | | SELECT |
| | | aab."guid", |
| | | aab."ad_name", |
| | | SUM(CASE WHEN tb."center_fund" then tb."center_fund" else 0 end) + SUM(CASE WHEN tb."local_fund" then tb."local_fund" else 0 end) as totalActualFund |
| | | FROM YWXT."att_ad_base" aab |
| | | LEFT JOIN ( |
| | | select |
| | | tb."city_code" cityCode, |
| | | tb."county_code" countyCode, |
| | | province."guid" provinceCode, |
| | | tps."actual_fund" |
| | | tb."center_fund", |
| | | tb."local_fund" |
| | | from sjzt_md."tb_project" tb |
| | | LEFT JOIN SJZT_MD."tb_project_schedule" tps on tps."tb_project_id" = tb."guid" |
| | | LEFT JOIN YWXT."att_ad_base" province ON province."ad_code" = tb."city_code" |
| | | <where> |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND tb."tb_year" = #{params.tbYear} |
| | | </if> |
| | | </where> |
| | | )tb on ((tb.countyCode = aab."guid") or (tb.cityCode = aab."guid") or (tb.provinceCode = aab."guid")) |
| | | group by aab."guid",aab."ad_name" |
| | | ) project on project."guid" = aab."guid" |
| | | |
| | | left join ( |
| | | SELECT |
| | | aab."guid", |
| | | aab."ad_name", |
| | | tb."actual_fund" curMonthActualFund |
| | | aab."guid", |
| | | aab."ad_name", |
| | | sum(CASE WHEN tb."actual_fund" then tb."actual_fund" else 0 end) curMonthActualFund |
| | | FROM YWXT."att_ad_base" aab |
| | | LEFT JOIN ( |
| | | select |
| | |
| | | tb."county_code" countyCode, |
| | | province."guid" provinceCode, |
| | | tps."actual_fund" |
| | | from sjzt_md."tb_project" tb |
| | | LEFT JOIN SJZT_MD."tb_project_schedule" tps on tps."tb_project_id" = tb."guid" |
| | | LEFT JOIN YWXT."att_ad_base" province ON province."ad_code" = tb."city_code" |
| | | where |
| | | 1=1 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND tps."year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbMonth != null and params.tbMonth != ''"> |
| | | and tps."month" = #{params.tbMonth} |
| | | </if> |
| | | from sjzt_md."tb_project" tb |
| | | LEFT JOIN SJZT_MD."tb_project_schedule" tps on tps."tb_project_id" = tb."guid" |
| | | LEFT JOIN YWXT."att_ad_base" province ON province."ad_code" = tb."city_code" |
| | | where 1=1 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND tps."year" = #{params.tbYear} |
| | | </if> |
| | | )tb on ((tb.countyCode = aab."guid") or (tb.cityCode = aab."guid") or (tb.provinceCode = aab."guid")) |
| | | group by aab."guid",aab."ad_name" |
| | | ) tps on tps."guid" = aab."guid" |
| | | left join ywxt."att_ad_base" paab on paab."guid" = aab."p_ad_code" |
| | | where |
| | |
| | | </if> |
| | | </select> |
| | | <select id="getStatisticsPie" resultType="cn.gistack.sm.sjztmd.vo.StatisticsPrice"> |
| | | SELECT |
| | | sum( |
| | | NVL ( a."center_fund", 0 )+ NVL ( a."local_fund", 0 )) AS sumPrice, |
| | | sum( |
| | | NVL ( b."actual_fund", 0 )) sumPay, |
| | | sum( |
| | | NVL ( a."center_fund", 0 )+ NVL ( a."local_fund", 0 ))- sum( |
| | | NVL ( b."actual_fund", 0 )) noPay |
| | | FROM |
| | | SELECT |
| | | sum( |
| | | NVL ( a."center_fund", 0 )+ NVL ( a."local_fund", 0 )) AS sumPrice, |
| | | sum( |
| | | NVL ( b."actual_fund", 0 )) sumPay, |
| | | sum( |
| | | NVL ( a."center_fund", 0 )+ NVL ( a."local_fund", 0 ))- sum( |
| | | NVL ( b."actual_fund", 0 )) noPay |
| | | FROM |
| | | sjzt_md."tb_project" a |
| | | LEFT JOIN ( SELECT * FROM sjzt_md."tb_project_schedule" |
| | | WHERE 1=1 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbMonth != null and params.tbMonth !=''"> |
| | | AND "month" = #{params.tbMonth} |
| | | </if> |
| | | ) b ON a."guid" = b."tb_project_id" and a."check_state" = 3 |
| | | LEFT JOIN ( |
| | | SELECT "tb_project_id",sum("actual_fund") "actual_fund" FROM sjzt_md."tb_project_schedule" |
| | | WHERE 1=1 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbMonth != null and params.tbMonth !=''"> |
| | | AND "month" = #{params.tbMonth} |
| | | </if> |
| | | group by "tb_project_id" |
| | | ) b ON a."guid" = b."tb_project_id" |
| | | </select> |
| | | <select id="getStatisticsPies" resultType="cn.gistack.sm.sjztmd.vo.StatisticsPrice"> |
| | | SELECT |
| | |
| | | NVL ( b."actual_fund", 0 )) noPay |
| | | FROM |
| | | sjzt_md."tb_project" a |
| | | LEFT JOIN ( SELECT * FROM sjzt_md."tb_project_schedule" |
| | | LEFT JOIN ( |
| | | SELECT "tb_project_id",sum("actual_fund") "actual_fund" FROM sjzt_md."tb_project_schedule" |
| | | WHERE 1=1 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | |
| | | <if test="params.tbMonth != null and params.tbMonth !=''"> |
| | | AND "month" = #{params.tbMonth} |
| | | </if> |
| | | ) b ON a."guid" = b."tb_project_id" and a."check_state" = 3 |
| | | group by "tb_project_id" |
| | | ) b ON a."guid" = b."tb_project_id" |
| | | LEFT JOIN YWXT."att_ad_base" c ON ( a."city_code" = c."guid" ) |
| | | OR ( a."county_code" = c."guid" ) |
| | | WHERE |
| | |
| | | NVL ( b."actual_fund", 0 )) noPay |
| | | FROM |
| | | sjzt_md."tb_project" a |
| | | LEFT JOIN ( SELECT * FROM sjzt_md."tb_project_schedule" |
| | | WHERE 1=1 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbMonth != null and params.tbMonth !=''"> |
| | | AND "month" = #{params.tbMonth} |
| | | </if> |
| | | ) b ON a."guid" = b."tb_project_id" and a."check_state" = 3 |
| | | LEFT JOIN ( |
| | | SELECT "tb_project_id",sum("actual_fund") "actual_fund" FROM sjzt_md."tb_project_schedule" |
| | | WHERE 1=1 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbMonth != null and params.tbMonth !=''"> |
| | | AND "month" = #{params.tbMonth} |
| | | </if> |
| | | group by "tb_project_id" |
| | | ) b ON a."guid" = b."tb_project_id" |
| | | RIGHT JOIN YWXT."att_ad_base" c on c."ad_code" = a."city_code" |
| | | where c."p_ad_code" = #{params.adCode} |
| | | GROUP BY |
| | |
| | | NVL ( b."actual_fund", 0 )) noPay |
| | | FROM |
| | | sjzt_md."tb_project" a |
| | | LEFT JOIN ( SELECT * FROM sjzt_md."tb_project_schedule" |
| | | WHERE 1=1 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbMonth != null and params.tbMonth !=''"> |
| | | AND "month" = #{params.tbMonth} |
| | | </if> |
| | | ) b ON a."guid" = b."tb_project_id" and a."check_state" = 3 |
| | | LEFT JOIN ( |
| | | SELECT "tb_project_id",sum("actual_fund") "actual_fund" FROM sjzt_md."tb_project_schedule" |
| | | WHERE 1=1 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | | </if> |
| | | <if test="params.tbMonth != null and params.tbMonth !=''"> |
| | | AND "month" = #{params.tbMonth} |
| | | </if> |
| | | group by "tb_project_id" |
| | | ) b ON a."guid" = b."tb_project_id" |
| | | GROUP BY |
| | | a."county_code", |
| | | a."county_name", |