| | |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id |
| | | WHERE |
| | | 1 =1 |
| | | <include refid="sgCodeCondition" /> |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and info.project_name like concat( concat ('%',#{dto.projectName}),'%') |
| | | </if> |
| | |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <!--<if test="dto.sgCodeS != null and dto.sgCodeS.size > 0"> |
| | | and (dria.province_cd in |
| | | <foreach collection="dto.sgCodeS" item="id" separator="," open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | or dria.city_cd in |
| | | <foreach collection="dto.sgCodeS" item="id" separator="," open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | or dria.county_cd in |
| | | <foreach collection="dto.sgCodeS" item="id" separator="," open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | or dria.town_cd in |
| | | <foreach collection="dto.sgCodeS" item="id" separator="," open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | ) |
| | | </if>--> |
| | | <if test="dto.projectSort == null or dto.projectSort ==0"> |
| | | ORDER BY info.status desc ,info.project_progress desc |
| | | </if> |
| | |
| | | ORDER BY info.sk_id asc |
| | | </if> |
| | | </select> |
| | | |
| | | <sql id="sgCodeCondition"> |
| | | <if test="dto.sgCodeS != null and dto.sgCodeS.size() > 0"> |
| | | AND ( |
| | | <foreach collection="dto.sgCodeS" item="id" separator="OR" open="(" close=")"> |
| | | dria.province_cd = #{id} |
| | | OR dria.city_cd = #{id} |
| | | OR dria.county_cd = #{id} |
| | | or dria.town_cd = #{id} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="queryStepByProject" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO"> |
| | | |
| | | SELECT |
| | |
| | | a."ad_code" CODE, |
| | | a."ad_name" NAME, |
| | | SUM( CASE WHEN b.STATUS IN ( 1, 2 ) THEN 1 ELSE 0 END ) AS commenceNum, |
| | | count( b.STATUS ) projectSum |
| | | count( b.STATUS ) projectSum, |
| | | LISTAGG(b.id, ',') as proIds |
| | | FROM |
| | | ( |
| | | SELECT |
| | | dria."county_cd" AS countyCode, |
| | | att."guid" AS cityCode, |
| | | ad."ad_code" AS provinceCode, |
| | | info.STATUS |
| | | info.STATUS, |
| | | info.id |
| | | FROM |
| | | YWXT.SG_PROJECT_INFO info |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id |
| | |
| | | SELECT |
| | | dria."city_cd" code, dria."city_nm" name , |
| | | sum( CASE WHEN info.STATUS IN ( 1, 2 ) THEN 1 ELSE 0 END ) AS commenceNum, |
| | | count( info.STATUS ) projectSum |
| | | FROM |
| | | count( info.STATUS ) projectSum, |
| | | LISTAGG(info.id, ',') as proIds |
| | | FROM |
| | | YWXT.SG_PROJECT_INFO info |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id |
| | | WHERE |
| | |
| | | info.lot as code, |
| | | info.lot as name, |
| | | sum( CASE WHEN info.STATUS IN ( 1, 2 ) THEN 1 ELSE 0 END ) AS commenceNum, |
| | | count( info.STATUS ) AS projectSum |
| | | count( info.STATUS ) AS projectSum, |
| | | LISTAGG(info.id, ',') as proIds |
| | | FROM |
| | | YWXT.SG_PROJECT_INFO info |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id |
| | |
| | | <select id="selectVOById" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO"> |
| | | select * from ywxt.sg_project_info pro where pro.id = #{proframId} |
| | | </select> |
| | | <!-- <select id="getProjectIds" resultType="java.lang.String">--> |
| | | |
| | | <!-- </select>--> |
| | | <select id="getDeviceTypes" resultType="cn.gistack.sm.sg.VO.SgStatisDeviceVO"> |
| | | SELECT |
| | | count( d.id) AS deviceCount, |
| | | sum( CASE WHEN d.STATUS IN ( 1, 2 ) THEN 1 ELSE 0 END) deviceStart, |
| | | Pdict.DICT_KEY as pType |
| | | FROM |
| | | ywxt.sg_device d |
| | | LEFT JOIN ywxt.blade_dict_biz dict ON d.device_type = dict.DICT_KEY |
| | | LEFT JOIN YWXT."BLADE_DICT_BIZ" Pdict ON dict.parent_id = Pdict.id |
| | | WHERE program_id IN ${s} |
| | | GROUP BY |
| | | Pdict.DICT_KEY |
| | | </select> |
| | | <select id="getSgCodeByUser" resultType="java.lang.String"> |
| | | SELECT |
| | | dp."SG_CODE" |
| | | FROM |
| | | ywxt.BLADE_USER u |
| | | LEFT JOIN ywxt.blade_dept dp ON u.dept_id = cast( dp.id AS VARCHAR ) |
| | | WHERE u.id = #{userId} |
| | | |
| | | </select> |
| | | </mapper> |