shenyijian
2024-08-21 a4b8b53d4b59a5f9e5c4d19e5f4db7829b81e07d
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProjectInfoMapper.xml
@@ -21,11 +21,35 @@
        <if test="dto.skName != null and dto.skName != ''">
            and info.sk_name like concat(concat('%',#{dto.skName}),'%')
        </if>
        <if test="dto.resCd != null and dto.resCd != '' ">
            and info.sk_id like CONCAT(CONCAT('%', #{dto.resCd}), '%')
        </if>
        <if test="dto.engScal != null and dto.engScal != '' ">
            and dria."eng_scal" like CONCAT(CONCAT('%', #{dto.engScal}), '%')
        </if>
        <if test="dto.status != null">
            and info.status = #{dto.status}
        </if>
        <if test="dto.isBegin != null and dto.isBegin == 1">
            and info.status in(1,2)
        </if>
        <if test="dto.isBegin != null and dto.isBegin == 2">
            and info.status = 0
        </if>
        <if test="dto.projectIds != null and dto.projectIds.size > 0">
            and info.id in
         <foreach collection="dto.projectIds" 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>
        <if test="dto.projectSort ==1">
            ORDER BY info.project_progress desc
        </if>
        <if test="dto.projectSort != null and dto.projectSort ==2">
            ORDER BY info.sk_id asc
        </if>
    </select>
    <select id="queryStepByProject" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO">
@@ -36,6 +60,8 @@
        gx.id AS gxId,
        gx.gx_name,
        d.device_name,
        Pdict.dict_key as Ptype,
        Pdict.dict_value as PtypeName,
        d.device_type,
        dict."DICT_VALUE" AS typeName,
        d.id AS dId,
@@ -50,8 +76,8 @@
        FROM
        ywxt.sg_project_info pro
        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" 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
        LEFT JOIN ywxt.sg_gx gx ON d.device_type = gx.gx_type
        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
@@ -101,7 +127,7 @@
           1 = 1
        <if test="grad == 0">
            AND
            dria."bas_name" = #{code}
            info.lot = #{code}
        </if>
        <if test="grad == 2">
            AND
@@ -154,10 +180,11 @@
        FROM
   YWXT.SG_PROJECT_INFO info
   LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = info.sk_id
        WHERE
    WHERE
   1 = 1
        AND
   dria."bas_name" =#{code}
    <if test="code != null and code != ''">
        AND   info.lot =#{code}
    </if>
   Group By dria."city_cd",dria."city_nm"
   HAVING
    dria."city_cd" IS NOT NULL AND
@@ -166,8 +193,10 @@
    <select id="getsgStatisticsOne" resultType="cn.gistack.sm.sg.VO.SgStatisProVO">
     SELECT
   dria."bas_name" AS code,
   dria."bas_guid" AS name,
<!--   dria."bas_name" AS code,
   dria."bas_guid" AS name,-->
    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
FROM
@@ -176,11 +205,12 @@
WHERE
   1 = 1
GROUP BY
   dria."bas_guid",
   dria."bas_name"
     info.lot
 <!--   dria."bas_guid", dria."bas_name" -->
   HAVING
    dria."bas_guid" IS NOT NULL AND
    dria."bas_name" IS NOT NULL
 <!--   dria."bas_guid" IS NOT NULL AND
    dria."bas_name" IS NOT NULL -->
       info.lot is not null
    </select>
    <select id="getProjectId" resultType="java.lang.String">
@@ -254,7 +284,7 @@
        ( pro.countyCode = a."guid" )
        OR ( pro.cityCode = a."guid" )
        OR ( pro.provinceCode = a."guid" ))
        WHERE 1=1 and a."p_ad_code" = #{dto.adCode}
        WHERE 1=1 and (a."p_ad_code" = #{dto.adCode} or a."ad_code" = #{dto.adCode})
        <if test="dto.status != null">
            and pro.status = #{dto.status}
        </if>
@@ -318,7 +348,7 @@
        ( pro.countyCode = a."guid" )
        OR ( pro.cityCode = a."guid" )
        OR ( pro.provinceCode = a."guid" ))
        WHERE 1=1 and a."p_ad_code" = #{dto.adCode}
        WHERE 1=1 and (a."p_ad_code" = #{dto.adCode} or a."ad_code" = #{dto.adCode})
        <if test="dto.projectId != null and dto.projectId != ''">
            and pro.id = #{dto.projectId}
        </if>
@@ -335,6 +365,9 @@
            </foreach>
        </if>
    </select>
    <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>-->