shenyijian
2024-09-20 0aa9af7bc8e34d539c990c5d714e24092a2d53e7
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProjectInfoMapper.xml
@@ -70,7 +70,7 @@
            and (info.control_unit = #{dto.deptId} or info.construction_unit = #{dto.deptId})
        </if>
       <if test="dto.projectSort == null">
            ORDER BY info.status desc ,info.project_progress desc NULLS LAST
            ORDER BY TO_NUMBER(info.project_progress) desc NULLS LAST,info.status desc
        </if>
        <!--
       <if test="dto.projectSort ==1">
@@ -130,6 +130,7 @@
        re.resubmit
        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.sg_device d ON pro.id = d.program_id
        LEFT JOIN YWXT."BLADE_DICT_BIZ" AS dict ON d.device_type = dict.DICT_KEY AND dict.CODE = 'SG_DEVICE_TYPE'
        LEFT JOIN YWXT."BLADE_DICT_BIZ" Pdict on dict.parent_id = Pdict.id
@@ -159,6 +160,7 @@
        <if test="dto.buildStage != null and dto.buildStage != ''">
            and pro.build_stage like CONCAT(CONCAT('%',#{dto.buildStage}),'%')
        </if>
        <include refid="queryBySgCodeS"></include>
       ORDER BY pro.status desc ,pro.project_progress desc
    </select>
@@ -445,7 +447,10 @@
        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") pro
        LEFT JOIN YWXT."att_ad_base" aad ON aad."ad_code" = ad."p_ad_code"
        where 1=1
        <include refid="queryBySgCodeS"></include>
        ) pro
        LEFT JOIN YWXT."att_ad_base" a ON (
        ( pro.countyCode = a."guid" )
        OR ( pro.cityCode = a."guid" )
@@ -474,6 +479,28 @@
        </if>
        ORDER BY pro.projectStatus desc ,pro.project_progress desc
    </select>
    <sql id="queryBySgCodeS">
        <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>
    </sql>
    <select id="selectVOById" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO">
        select * from  ywxt.sg_project_info pro where pro.id = #{proframId}
    </select>
@@ -554,4 +581,11 @@
    </select>
    <select id="resList" resultType="cn.gistack.sm.sg.VO.ResVO">
        select dria.* from "SJZT_DW"."dim_res_info_a" dria where 1=1
        <if test="dto.adCode != null and dto.adCode != ''">
           and (dria."province_cd" = #{dto.adCode} or dria."city_cd" = #{dto.adCode} or dria."county_cd" = #{dto.adCode})
        </if>
        <include refid="queryBySgCodeS"></include>
    </select>
</mapper>