ke
2024-12-03 bfe4e6e49ea341c8443d7b4b70cb66de0f1aadab
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProjectInfoMapper.xml
@@ -16,6 +16,24 @@
        LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id
        WHERE
        1 =1
        <if test="dto.selfUnit != null and dto.selfUnit.size>0 ">
            and
            <foreach collection="dto.selfUnit" item="item" index="index" open="(" separator="or" close=")">
                info.CONSTRUCTION_UNIT Like  CONCAT(CONCAT('%', #{item}), '%') or   info.SELF_UNIT Like  CONCAT(CONCAT('%', #{item}), '%')
            </foreach>
        </if>
        <if test="dto.userUnit != null and dto.userUnit.size>0">
            and
            <foreach collection="dto.userUnit" item="item" index="index" open="(" separator="or" close=")">
                info.CONTROL_UNIT Like  CONCAT(CONCAT('%', #{item}), '%')
            </foreach>
        </if>
        <if test="dto.countryUnit != null and dto.countryUnit.size>0">
            and dria."county_cd" in
            <foreach collection="dto.countryUnit" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="dto.projectName != null and dto.projectName != ''">
            and info.project_name like concat( concat ('%',#{dto.projectName}),'%')
        </if>
@@ -67,11 +85,14 @@
                #{id}
            </foreach>)
        </if>
        <if test="dto.deptId != null and dto.deptId !=''">
        <!--<if test="dto.deptId != null and dto.deptId !=''">
            and (info.control_unit = #{dto.deptId} or info.construction_unit = #{dto.deptId})
        </if>
        </if>-->
        <if test="dto.adCode != null and dto.adCode !=''">
            and dria."county_cd" = #{dto.adCode}
        </if>
        <if test="dto.othRegCd != null and dto.othRegCd !=''">
            and dria."oth_reg_cd" = #{dto.othRegCd}
        </if>
       <if test="dto.projectSort == null">
            ORDER BY TO_NUMBER(info.project_progress) desc NULLS LAST,info.status desc
@@ -131,7 +152,10 @@
        pro.STATUS AS projectStatus,
        re.id AS reportId,
        pro.lon_lat,
        re.resubmit
        re.resubmit,
        COALESCE(d.price, 99) as price,
        COALESCE(Pdict.sort, 0)  as sort,
        COALESCE(dict.sort, 0)  as dSort
        FROM
        ywxt.sg_project_info pro
        LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = pro.sk_id
@@ -485,6 +509,24 @@
    </select>
    <sql id="queryBySgCodeS">
        <if test="dto.selfUnit != null and dto.selfUnit.size>0">
            and
            <foreach collection="dto.selfUnit" item="item" index="index" open="(" separator="or" close=")">
                pro.CONSTRUCTION_UNIT Like  CONCAT(CONCAT('%', #{item}), '%') or  pro.SELF_UNIT Like  CONCAT(CONCAT('%', #{item}), '%')
            </foreach>
        </if>
        <if test="dto.userUnit != null and dto.userUnit.size>0">
            and
            <foreach collection="dto.userUnit" item="item" index="index" open="(" separator="or" close=")">
                pro.CONTROL_UNIT Like  CONCAT(CONCAT('%', #{item}), '%')
            </foreach>
        </if>
        <if test="dto.countryUnit != null and dto.countryUnit.size>0">
            and dria."county_cd" in
            <foreach collection="dto.countryUnit" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </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=")">
@@ -523,12 +565,20 @@
            Pdict.DICT_KEY
    </select>
    <select id="getSgCodeByUser" resultType="java.lang.String">
        SELECT
       <!-- 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}
        WHERE u.id = #{userId} -->
        SELECT
        distinct dp."SG_CODE"
        FROM
        ywxt.BLADE_USER u
        LEFT JOIN ywxt.blade_dept dp ON   u.dept_id  Like  CONCAT('%',  dp.id , '%')
        WHERE u.id =  #{userId}  and   dp."SG_CODE"  is not null  and <![CDATA[dp."SG_CODE" <>'' ]]>   limit 1
    </select>
    <select id="queryDept" resultType="cn.gistack.sm.sg.VO.SgAllDeptOrUser">
@@ -554,6 +604,18 @@
            1 =1
        <if test="dto.buildStage != null and dto.buildStage != ''">
            and info.build_stage = #{dto.buildStage}
        </if>
        <if test="dto.selfUnit != null and dto.selfUnit.size>0 ">
            and
            <foreach collection="dto.selfUnit" item="item" index="index" open="(" separator="or" close=")">
                info.CONSTRUCTION_UNIT Like  CONCAT(CONCAT('%', #{item}), '%') or info.SELF_UNIT Like  CONCAT(CONCAT('%', #{item}), '%')
            </foreach>
        </if>
        <if test="dto.userUnit != null and dto.userUnit.size>0">
            and
            <foreach collection="dto.userUnit" item="item" index="index" open="(" separator="or" close=")">
                info.CONTROL_UNIT Like  CONCAT(CONCAT('%', #{item}), '%')
            </foreach>
        </if>
        <if test="dto.sgCodeS != null and dto.sgCodeS.size > 0">
            and (dria."province_cd" in
@@ -583,10 +645,13 @@
            user_id
        FROM
            "YWXT"."BLADE_USER_DEPT"
        WHERE
            dept_id = #{controlUnit}
        WHERE 1=1
        <if test="list != null and list.size>0">
            and dept_id in
            <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
    </select>
    <select id="resList" resultType="cn.gistack.sm.sg.VO.ResVO">
        select dria.* from "SJZT_DW"."dim_res_info_a" dria where 1=1