| | |
| | | </if> |
| | | </select> |
| | | <select id="queryStepByProject" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO"> |
| | | SELECT |
| | | b.id, |
| | | b.project_name, |
| | | b.gxId, |
| | | b.gx_name, |
| | | b.device_name, |
| | | b.device_type, |
| | | b.typeName, |
| | | b.dId, |
| | | b.gx_step_name, |
| | | b.gx_step_num, |
| | | b.stepId, |
| | | b.reportStatus, |
| | | b.deviceStatus, |
| | | b.projectStatus, |
| | | b.reportId, |
| | | b.lon_lat |
| | | FROM |
| | | ( |
| | | |
| | | SELECT |
| | | pro.id, |
| | | pro.project_name, |
| | |
| | | d.STATUS AS deviceStatus, |
| | | pro.STATUS AS projectStatus, |
| | | re.id AS reportId, |
| | | pro.lon_lat, |
| | | dria."county_cd" AS countyCode, |
| | | att."guid" AS cityCode, |
| | | ad."ad_code" AS provinceCode |
| | | pro.lon_lat |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | LEFT JOIN ywxt.sg_device d ON pro.id = d.program_id |
| | |
| | | LEFT JOIN ywxt.sg_gx_step step ON gx.id = step.gx_info_id |
| | | LEFT JOIN ywxt.sg_progress_report re ON re.gx_step_id = step.id |
| | | AND re.gx_device_id = d.id |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = pro.sk_id |
| | | LEFT JOIN YWXT."att_ad_base" att ON att."ad_code" = dria."city_cd" |
| | | LEFT JOIN YWXT."att_ad_base" ad ON att."p_ad_code" = ad."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" aad ON aad."ad_code" = ad."p_ad_code" |
| | | ) b |
| | | LEFT JOIN YWXT."att_ad_base" a ON ( |
| | | ( b.countyCode = a."guid" ) |
| | | OR ( b.cityCode = a."guid" ) |
| | | OR ( b.provinceCode = a."guid" )) |
| | | where 1=1 |
| | | <if test="dto.adCode != null"> |
| | | and a."p_ad_code" = #{dto.adCode} |
| | | </if> |
| | | <if test="dto.projectId != null and dto.projectId != ''"> |
| | | and b.id = #{dto.projectId} |
| | | and pro.id = #{dto.projectId} |
| | | </if> |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and b.project_name like CONCAT(CONCAT('%', #{dto.projectName}), '%') |
| | | and pro.project_name like CONCAT(CONCAT('%', #{dto.projectName}), '%') |
| | | </if> |
| | | <if test="dto.status != null"> |
| | | and b.status = #{dto.status} |
| | | and pro.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.projectIds != null and dto.projectIds.size > 0"> |
| | | and b.id in |
| | | and pro.id in |
| | | <foreach collection="dto.projectIds" item="id" separator="," open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <select id="progressList" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO"> |
| | | select b.id, |
| | | b.project_name, |
| | | b.lon_lat, |
| | | b.status from |
| | | (SELECT |
| | | SELECT |
| | | pro.id, |
| | | pro.project_name, |
| | | pro.lon_lat, |
| | |
| | | ad."ad_code" AS provinceCode |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = pro.sk_id |
| | | LEFT JOIN YWXT."att_ad_base" att ON att."ad_code" = dria."city_cd" |
| | | LEFT JOIN YWXT."att_ad_base" ad ON att."p_ad_code" = ad."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" aad ON aad."ad_code" = ad."p_ad_code")b |
| | | LEFT JOIN YWXT."att_ad_base" a ON ( |
| | | ( b.countyCode = a."guid" ) |
| | | OR ( b.cityCode = a."guid" ) |
| | | OR ( b.provinceCode = a."guid" )) |
| | | WHERE 1=1 |
| | | <if test="dto.adCode != null"> |
| | | and a."p_ad_code" = #{dto.adCode} |
| | | </if> |
| | | <if test="dto.status != null"> |
| | | and b.status = #{dto.status} |
| | | and pro.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and b.project_name like CONCAT(CONCAT('%',#{dto.projectName}),'%') |
| | | and pro.project_name like CONCAT(CONCAT('%',#{dto.projectName}),'%') |
| | | </if> |
| | | </select> |
| | | <select id="getSgstatiss" resultType="cn.gistack.sm.sg.VO.SgStatisticsVO"> |