| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="cn.com.goldenwater.dcproj.dao.BisInspWtdstDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspWtdst" id="bisInspWtdstResultMap">
- <result property="wtdstDtle" column="WTDST_DTLE" />
- <result property="wtdstWrkam" column="WTDST_WRKAM" />
- <result property="planRcvrTm" column="PLAN_RCVR_TM" />
- <result property="intm" column="INTM" />
- <result property="uptm" column="UPTM" />
- <result property="note" column="NOTE" />
- <result property="wtdstLgtd" column="WTDST_LGTD" />
- <result property="wtdstLttd" column="WTDST_LTTD" />
- <result property="locNm" column="LOC_NM" />
- <result property="objType" column="OBJ_TYPE" />
- <result property="objCode" column="OBJ_CODE" />
- <result property="objName" column="OBJ_NAME" />
- <result property="centerXGd" column="CENTER_X_GD" />
- <result property="centerYGd" column="CENTER_Y_GD" />
- <result property="prjamntTcfSum" column="PRJAMNT_TCF_SUM" />
- <result property="prjamntMony" column="PRJAMNT_MONY" />
- <result property="prjamntSum" column="PRJAMNT_SUM" />
- <result property="prjState" column="PRJ_STATE" />
- <result property="fdPlan" column="FD_PLAN" />
- <result property="year" column="YEAR" />
- <result property="wtdstId" column="WTDST_ID" />
- <result property="wtdstType" column="WTDST_TYPE" />
- <result property="wtdstNm" column="WTDST_NM" />
- <result property="wtdstState" column="WTDST_STATE" />
- <result property="locAd" column="LOC_AD" />
- <result property="orgId" column="ORG_ID" />
- <result property="cost" column="COST" />
- <result property="planRcvr" column="PLAN_RCVR" />
- <result property="prjType" column="PRJ_TYPE" />
- <result property="wtdstLev" column="WTDST_LEV" />
- <result property="prjamntTcfBch" column="PRJAMNT_TCF_BCH" />
- <result property="prjamntTcfNo" column="PRJAMNT_TCF_NO" />
- <result property="adName" column="AD_NAME" />
- </resultMap>
- <sql id="table_columns">
- AD_NAME,
- WTDST_DTLE,
- WTDST_WRKAM,
- PLAN_RCVR_TM,
- INTM,
- UPTM,
- NOTE,
- WTDST_LGTD,
- WTDST_LTTD,
- LOC_NM,
- OBJ_TYPE,
- OBJ_CODE,
- OBJ_NAME,
- CENTER_X_GD,
- CENTER_Y_GD,
- PRJAMNT_TCF_SUM,
- PRJAMNT_MONY,
- PRJAMNT_SUM,
- PRJ_STATE,
- FD_PLAN,
- YEAR,
- WTDST_ID,
- WTDST_TYPE,
- WTDST_NM,
- WTDST_STATE,
- LOC_AD,
- ORG_ID,
- COST,
- PLAN_RCVR,
- PRJ_TYPE,
- WTDST_LEV,
- PRJAMNT_TCF_BCH,
- PRJAMNT_TCF_NO,
- PROVINCIAL
- </sql>
- <sql id="entity_properties">
- #{adName},
- #{wtdstDtle},
- #{wtdstWrkam},
- #{planRcvrTm},
- #{intm},
- #{uptm},
- #{note},
- #{wtdstLgtd},
- #{wtdstLttd},
- #{locNm},
- #{objType},
- #{objCode},
- #{objName},
- #{centerXGd},
- #{centerYGd},
- #{prjamntTcfSum},
- #{prjamntMony},
- #{prjamntSum},
- #{prjState},
- #{fdPlan},
- #{year},
- #{wtdstId},
- #{wtdstType},
- #{wtdstNm},
- #{wtdstState},
- #{locAd},
- #{orgId},
- #{cost},
- #{planRcvr},
- #{prjType},
- #{wtdstLev},
- #{prjamntTcfBch},
- #{prjamntTcfNo},
- #{provincial}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="wtdstId != null and wtdstId != ''">and WTDST_ID = #{wtdstId}</if>
- <if test="wtdstType != null and wtdstType != ''">and WTDST_TYPE = #{wtdstType}</if>
- <if test="wtdstNm != null and wtdstNm != ''">and WTDST_NM LIKE '%'||#{wtdstNm}||'%'</if>
- <if test="wtdstState != null and wtdstState != ''">and WTDST_STATE = #{wtdstState}</if>
- <if test="locAd != null and locAd != ''">and LOC_AD LIKE #{locAd}||'%'</if>
- <if test="wtdstDtle != null and wtdstDtle != ''">and WTDST_DTLE = #{wtdstDtle}</if>
- <if test="wtdstWrkam != null and wtdstWrkam != ''">and WTDST_WRKAM = #{wtdstWrkam}</if>
- <if test="planRcvrTm != null and planRcvrTm != ''">and PLAN_RCVR_TM = TO_DATE(#{planRcvrTm},'YYYY-MM-DD')
- </if>
- <if test="intm != null and intm != ''">and INTM = TO_DATE(#{intm},'YYYY-MM-DD HH24:MI:SS')</if>
- <if test="uptm != null and uptm != ''">and UPTM = TO_DATE(#{uptm},'YYYY-MM-DD HH24:MI:SS')</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="wtdstLgtd != null and wtdstLgtd != ''">and WTDST_LGTD = #{wtdstLgtd}</if>
- <if test="wtdstLttd != null and wtdstLttd != ''">and WTDST_LTTD = #{wtdstLttd}</if>
- <if test="locNm != null and locNm != ''">and LOC_NM LIKE '%'||#{locNm}||'%'</if>
- <if test="objType != null and objType != ''">and OBJ_TYPE = #{objType}</if>
- <if test="objCode != null and objCode != ''">and OBJ_CODE = #{objCode}</if>
- <if test="objName != null and objName != ''">and OBJ_NAME LIKE '%'||#{objName}||'%'</if>
- <if test="centerXGd != null and centerXGd != ''">and CENTER_X_GD = #{centerXGd}</if>
- <if test="centerYGd != null and centerYGd != ''">and CENTER_Y_GD = #{centerYGd}</if>
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- <if test="cost != null and cost != ''">and COST = #{cost}</if>
- <if test="planRcvr != null and planRcvr != ''">and PLAN_RCVR = #{planRcvr}</if>
- <if test="province != null and province != ''">and loc_ad LIKE #{province}||'%' </if>
- <if test="provincial != null and provincial != ''">and PROVINCIAL = #{provincial}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspWtdstResultMap" parameterType="String" >
- select <include refid="table_columns" /> from BIS_INSP_WTDST where WTDST_ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspWtdstResultMap">
- select <include refid="table_columns" /> from BIS_INSP_WTDST <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="bisInspWtdstResultMap">
- select <include refid="table_columns" /> from BIS_INSP_WTDST
- </select>
- <select id="findList" resultMap="bisInspWtdstResultMap">
- select <include refid="table_columns" /> from BIS_INSP_WTDST <include refid="page_where" /> ORDER BY plan_rcvr_tm DESC
- </select>
- <select id="selectCount" resultType="int" >
- select count(WTDST_ID) from BIS_INSP_WTDST <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspWtdst">
- insert into BIS_INSP_WTDST( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_WTDST where WTDST_ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspWtdst">
- delete from BIS_INSP_WTDST <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_WTDST set flag_valid = 0 where WTDST_ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspWtdst">
- update BIS_INSP_WTDST
- <trim prefix="set" suffixOverrides=",">
- <if test="wtdstWrkam != null and wtdstWrkam != ''">WTDST_WRKAM = #{wtdstWrkam},</if>
- <if test="planRcvrTm != null">PLAN_RCVR_TM = #{planRcvrTm},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="wtdstLgtd != null and wtdstLgtd != ''">WTDST_LGTD = #{wtdstLgtd},</if>
- <if test="wtdstLttd != null and wtdstLttd != ''">WTDST_LTTD = #{wtdstLttd},</if>
- <if test="locNm != null and locNm != ''">LOC_NM = #{locNm},</if>
- <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
- <if test="objCode != null and objCode != ''">OBJ_CODE = #{objCode},</if>
- <if test="objName != null and objName != ''">OBJ_NAME = #{objName},</if>
- <if test="centerXGd != null and centerXGd != ''">CENTER_X_GD = #{centerXGd},</if>
- <if test="centerYGd != null and centerYGd != ''">CENTER_Y_GD = #{centerYGd},</if>
- <if test="prjamntTcfSum != null and prjamntTcfSum != ''">PRJAMNT_TCF_SUM = #{prjamntTcfSum},</if>
- <if test="prjamntMony != null and prjamntMony != ''">PRJAMNT_MONY = #{prjamntMony},</if>
- <if test="prjamntSum != null and prjamntSum != ''">PRJAMNT_SUM = #{prjamntSum},</if>
- <if test="prjState != null and prjState != ''">PRJ_STATE = #{prjState},</if>
- <if test="fdPlan != null and fdPlan != ''">FD_PLAN = #{fdPlan},</if>
- <if test="year != null and year != ''">YEAR = #{year},</if>
- <if test="wtdstId != null and wtdstId != ''">WTDST_ID = #{wtdstId},</if>
- <if test="wtdstType != null and wtdstType != ''">WTDST_TYPE = #{wtdstType},</if>
- <if test="wtdstNm != null and wtdstNm != ''">WTDST_NM = #{wtdstNm},</if>
- <if test="wtdstState != null and wtdstState != ''">WTDST_STATE = #{wtdstState},</if>
- <if test="locAd != null and locAd != ''">LOC_AD = #{locAd},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="cost != null and cost != ''">COST = #{cost},</if>
- <if test="planRcvr != null and planRcvr != ''">PLAN_RCVR = #{planRcvr},</if>
- <if test="prjType != null and prjType != ''">PRJ_TYPE = #{prjType},</if>
- <if test="wtdstLev != null and wtdstLev != ''">WTDST_LEV = #{wtdstLev},</if>
- <if test="prjamntTcfBch != null and prjamntTcfBch != ''">PRJAMNT_TCF_BCH = #{prjamntTcfBch},</if>
- <if test="prjamntTcfNo != null and prjamntTcfNo != ''">PRJAMNT_TCF_NO = #{prjamntTcfNo},</if>
- <if test="provincial != null and provincial != ''">PROVINCIAL = #{provincial},</if>
- </trim>
- <where>WTDST_ID = #{wtdstId}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspWtdst">
- update BIS_INSP_WTDST
- <trim prefix="set" suffixOverrides=",">
- <if test="wtdstWrkam != null and wtdstWrkam != ''">WTDST_WRKAM = #{wtdstWrkam},</if>
- <if test="planRcvrTm != null">PLAN_RCVR_TM = #{planRcvrTm},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="wtdstLgtd != null and wtdstLgtd != ''">WTDST_LGTD = #{wtdstLgtd},</if>
- <if test="wtdstLttd != null and wtdstLttd != ''">WTDST_LTTD = #{wtdstLttd},</if>
- <if test="locNm != null and locNm != ''">LOC_NM = #{locNm},</if>
- <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
- <if test="objCode != null and objCode != ''">OBJ_CODE = #{objCode},</if>
- <if test="objName != null and objName != ''">OBJ_NAME = #{objName},</if>
- <if test="centerXGd != null and centerXGd != ''">CENTER_X_GD = #{centerXGd},</if>
- <if test="centerYGd != null and centerYGd != ''">CENTER_Y_GD = #{centerYGd},</if>
- <if test="prjamntTcfSum != null and prjamntTcfSum != ''">PRJAMNT_TCF_SUM = #{prjamntTcfSum},</if>
- <if test="prjamntMony != null and prjamntMony != ''">PRJAMNT_MONY = #{prjamntMony},</if>
- <if test="prjamntSum != null and prjamntSum != ''">PRJAMNT_SUM = #{prjamntSum},</if>
- <if test="prjState != null and prjState != ''">PRJ_STATE = #{prjState},</if>
- <if test="fdPlan != null and fdPlan != ''">FD_PLAN = #{fdPlan},</if>
- <if test="year != null and year != ''">YEAR = #{year},</if>
- <if test="wtdstId != null and wtdstId != ''">WTDST_ID = #{wtdstId},</if>
- <if test="wtdstType != null and wtdstType != ''">WTDST_TYPE = #{wtdstType},</if>
- <if test="wtdstNm != null and wtdstNm != ''">WTDST_NM = #{wtdstNm},</if>
- <if test="wtdstState != null and wtdstState != ''">WTDST_STATE = #{wtdstState},</if>
- <if test="locAd != null and locAd != ''">LOC_AD = #{locAd},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="cost != null and cost != ''">COST = #{cost},</if>
- <if test="planRcvr != null and planRcvr != ''">PLAN_RCVR = #{planRcvr},</if>
- <if test="prjType != null and prjType != ''">PRJ_TYPE = #{prjType},</if>
- <if test="wtdstLev != null and wtdstLev != ''">WTDST_LEV = #{wtdstLev},</if>
- <if test="prjamntTcfBch != null and prjamntTcfBch != ''">PRJAMNT_TCF_BCH = #{prjamntTcfBch},</if>
- <if test="prjamntTcfNo != null and prjamntTcfNo != ''">PRJAMNT_TCF_NO = #{prjamntTcfNo},</if>
- <if test="provincial != null and provincial != ''">PROVINCIAL = #{provincial},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- <!--查询督查范围内的对下那个-->
- <select id="getListByInspGroupIdObjType" resultType="cn.com.goldenwater.dcproj.model.BisInspWtdst">
- select t.*,C.id,C.PNM,B.obj_id
- from BIS_INSP_WTDST t
- left join BIS_INSP_ALL_OBJ B
- on B.CODE = t.wtdst_id
- LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
- and B.ptype = #{objType}
- where 1 = 1
- <if test='isAll == "0"'>and B.ID = #{inspGroupId}</if>
- <if test='isAll == "1"'>and B.ID LIKE '${inspGroupId}%'</if>
- <if test="wtdstNm != null and wtdstNm != ''">and t.WTDST_NM LIKE '%${wtdstNm}%'</if>
- <if test="wtdstState != null and wtdstState != ''">and t.WTDST_STATE = #{wtdstState}</if>
- <if test="wtdstType != null and wtdstType != ''">and t.WTDST_TYPE = #{wtdstType}</if>
- <if test="adCode != null and adCode != ''">and t.LOC_AD LIKE '${adCode}%'</if>
- <choose>
- <when test="province !=null and province !=''">
- and t.LOC_AD like '${province}%'
- </when>
- <otherwise>
- and t.LOC_AD is null
- </otherwise>
- </choose>
- </select>
- <!--查询不在范围内的对象-->
- <select id="getObjListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.BisInspWtdst">
- SELECT * FROM BIS_INSP_WTDST T
- WHERE T.WTDST_ID NOT IN (
- SELECT CODE FROM BIS_INSP_ALL_OBJ B WHERE ID LIKE CONCAT(#{inspGroupId},'%')
- )
- <if test="province !=null and province !=''">and t.LOC_AD like '${province}%'</if>
- <if test="wtdstNm != null and wtdstNm != ''">and t.WTDST_NM LIKE '%${wtdstNm}%'</if>
- <if test="wtdstState != null and wtdstState != ''">and t.WTDST_STATE = #{wtdstState}</if>
- <if test="wtdstType != null and wtdstType != ''">and t.WTDST_TYPE = #{wtdstType}</if>
- <if test="adCode != null and adCode != ''">and t.LOC_AD LIKE '${adCode}%'</if>
- <if test="year != null and year != ''">and t.year = #{year}</if>
- <if test="prjState != null and prjState != ''">and t.PRJ_STATE = #{prjState}</if>
- </select>
- <sql id="orgIdSql">
- <choose>
- <when test="orgId !=null and orgId !=''">
- and ORG_ID=#{orgId}
- </when>
- <otherwise>
- and ORG_ID is null
- </otherwise>
- </choose>
- </sql>
- <select id="getObjByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam" resultType="cn.com.goldenwater.dcproj.model.AttPersWtdst">
- SELECT TR.TRACK_ID,A.WTDST_ID,
- A.WTDST_TYPE,
- A.WTDST_NM,
- A.WTDST_STATE,
- A.LOC_AD,
- A.WTDST_DTLE,
- A.WTDST_WRKAM,
- A.PLAN_RCVR_TM,
- A.INTM,
- A.UPTM,
- A.NOTE,
- A.WTDST_LGTD,
- A.WTDST_LTTD,
- A.LOC_NM,B.ID,
- A.CENTER_X_GD,
- A.CENTER_Y_GD,
- B.NM,
- B.PTYPE,
- B.LGTD,
- B.LTTD,AD.AD_NAME adName,
- B.OBJ_ID,
- TR.AD_NM,
- TR.STATE,
- A.PROVINCIAL
- FROM BIS_INSP_WTDST A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.WTDST_ID = B.CODE
- LEFT JOIN ATT_AD_BASE AD ON A.LOC_AD = AD.AD_CODE
- LEFT JOIN (select a.track_id,a.state ,a.obj_id ,a.ad_nm from BIS_INSP_WTDST_TRACK a LEFT JOIN (select obj_id,max(intm) intm from BIS_INSP_WTDST_TRACK group by obj_id) b ON a.OBJ_ID = b.OBJ_ID where a.intm = b.intm) TR ON B.OBJ_ID = TR.OBJ_ID
- WHERE B.PTYPE = #{objType}
- <include refid="choseSql"/>
- AND
- REGEXP_LIKE(
- B.Id,'^('||
- ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid}
- <include refid="orgIdSql"/>
- )>0 then
- (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
- id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid}
- <include refid="orgIdSql"/>
- )
- else (select 'non' from dual) end)
- ||')')
- <if test="wtdstNm != null and wtdstNm != ''">and A.WTDST_NM LIKE '%${wtdstNm}%'</if>
- <if test="adCode != null and adCode != ''">and A.LOC_AD LIKE '${adCode}%'</if>
- <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and A.CENTER_X_GD BETWEEN #{mincenterXGd} AND #{maxcenterXGd}</if>
- <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and A.CENTER_Y_GD BETWEEN #{mincenterYGd} AND #{maxcenterYGd}</if>
- ORDER BY A.LOC_AD
- </select>
- <sql id="choseSql">
- <choose>
- <when test="province !=null and province !=''">
- and B.ad_code like '${province}%'
- </when>
- <otherwise>
- and B.ad_code is null
- </otherwise>
- </choose>
- </sql>
- <select id="findDtoList" resultType="cn.com.goldenwater.dcproj.dto.BisInspWtdstDetailDto" parameterType="cn.com.goldenwater.dcproj.param.BisInspWtdstDtoListParam">
- select
- A.WTDST_ID,A.WTDST_TYPE,A.WTDST_NM,A.WTDST_LGTD,A.WTDST_LTTD,A.LOC_NM,A.OBJ_TYPE,A.OBJ_CODE,A.OBJ_NAME,A.CENTER_X_GD,A.CENTER_Y_GD,A.LOC_AD,A.PROVINCIAL,
- C.TRACK_ID ,
- c.CHK_TIME,
- CASE WHEN C.OBJ_ID IS NULL THEN B.OBJ_ID ELSE C.OBJ_ID END OBJ_ID ,
- C.OBJ_NM ,
- C.MANG_NM ,
- C.LOAC ,
- CASE WHEN C.DIS_CONTENT IS NULL THEN A.WTDST_DTLE ELSE C.DIS_CONTENT END DIS_CONTENT ,
- A.WTDST_WRKAM,
- CASE WHEN C.WKSTATE IS NULL THEN A.WTDST_STATE ELSE C.WKSTATE END WKSTATE,
- TO_CHAR(CASE WHEN C.PLAN_TM IS NULL THEN A.PLAN_RCVR_TM ELSE C.PLAN_TM END,'YYYY-MM-DD') PLAN_TM,
- C.PROM_NUM ,
- C.AD_NM ,
- C.GROUP_LEADER_ID ,
- C.GROUP_LEADER ,
- C.GROUP_LEADER_TEL ,
- C.REC_PERS_ID ,
- C.REC_PERS ,
- C.REC_PERS_TEL ,
- C.INDP ,
- TO_CHAR(C.INTM,'YYYY-MM-DD HH24:MI:SS') INTM,
- TO_CHAR(C.UPTM,'YYYY-MM-DD HH24:MI:SS') UPTM,
- C.NOTE ,
- C.ATTACHID ,
- C.DATA_STAT ,
- C.STATE, c.prj_state,
- D.PNM GROUPNM ,D.ID GROUPID,F.PNM CHKCOM,F.ID CHKID,
- H.AD_FULL_NAME AD_FULL_NAME
- from BIS_INSP_WTDST A
- JOIN BIS_INSP_ALL_OBJ B ON A.WTDST_ID=B.CODE
- LEFT JOIN BIS_INSP_WTDST_TRACK C ON B.OBJ_ID=C.OBJ_ID
- LEFT JOIN BIS_INSP_ALL D ON B.ID=D.ID
- LEFT JOIN BIS_INSP_ALL E ON D.PID=E.ID
- LEFT JOIN BIS_INSP_ALL F ON E.PID=F.ID
- LEFT JOIN ATT_AD_X_BASE H ON A.LOC_AD=H.AD_CODE
- WHERE 1=1
- <if test="tabType =='2'.toString()">
- and D.entm <to_date(#{nowTime},'yyyy-MM-dd')+1
- </if>
- <if test="tabType =='1'.toString()">
- and D.entm >=to_date(#{nowTime},'yyyy-MM-dd')
- </if>
- <if test="wtdstId != null and wtdstId != ''">and A.WTDST_ID = #{wtdstId}</if>
- <if test="wtdstType != null and wtdstType != ''">and A.WTDST_TYPE = #{wtdstType}</if>
- <if test="wtdstNm != null and wtdstNm != ''">and A.WTDST_NM LIKE '%'||#{wtdstNm}||'%'</if>
- <if test="locNm != null and locNm != ''">and A.LOC_NM LIKE '%'||#{locNm}||'%'</if>
- <if test="objType != null and objType != ''">and A.OBJ_TYPE = #{objType}</if>
- <if test="objCode != null and objCode != ''">and A.OBJ_CODE = #{objCode}</if>
- <if test="objName != null and objName != ''">and A.OBJ_NAME LIKE '%'||#{objName}||'%'</if>
- <if test="trackId != null and trackId != ''">and C.TRACK_ID = #{trackId}</if>
- <if test="objId != null and objId != ''">and C.OBJ_ID = #{objId}</if>
- <if test="mangNm != null and mangNm != ''">and C.MANG_NM = #{mangNm}</if>
- <if test="disContent != null and disContent != ''">and A.WTDST_DTLE LIKE '%'||#{disContent}||'%'</if>
- <if test="wkstate != null and wkstate != ''">and A.WTDST_STATE = #{wkstate}</if>
- <if test="planTm != null and planTm != ''">and A.PLAN_RCVR_TM = TO_DATE(#{planTm},'YYYY-MM-DD')</if>
- <if test="state != null and state != ''">and C.STATE = #{state}</if>
- <if test="locAd != null and locAd != ''">and A.LOC_AD LIKE #{locAd}||'%'</if>
- <if test="startDate != null and startDate != ''">
- AND C.CHK_TIME >=TO_DATE(#{startDate},'YYYY-MM-DD')
- </if>
- <if test="endDate != null and endDate != ''">
- AND C.CHK_TIME <TO_DATE(#{endDate},'YYYY-MM-DD')+1
- </if>
- <if test="chkComId != null and chkComId != ''">
- AND F.ID =#{chkComId}
- </if>
- <if test="nodeId !=null and nodeId !=''">
- AND B.ID like '${nodeId}%'
- </if>
- <if test="groupId != null and groupId != ''">
- AND D.ID =#{groupId}
- </if>
- <if test="adNm != null and adNm != ''">
- AND( A.LOC_NM LIKE '%'||#{adNm}||'%' OR H.AD_NAME LIKE '%'||#{adNm}||'%' OR I.AD_NAME LIKE '%'||#{adNm}||'%' OR J.AD_NAME LIKE '%'||#{adNm}||'%' )
- </if>
- AND
- REGEXP_LIKE(
- B.Id,'^('||
- ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid}
- <include refid="orgIdSql"/>
- )>0 then
- (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
- id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid}
- <include refid="orgIdSql"/>
- )
- else (select 'non' from dual) end)
- ||')')
- ORDER BY C.STATE,C.UPTM
- </select>
- <select id="findDtoListAboutExport" resultType="cn.com.goldenwater.dcproj.dto.BisInspWtdstDetailDto" parameterType="cn.com.goldenwater.dcproj.param.TypeExportParam">
- select A.WTDST_ID,A.WTDST_TYPE,A.WTDST_NM,A.WTDST_LGTD,A.WTDST_LTTD,A.LOC_NM,A.OBJ_TYPE,A.OBJ_CODE,A.OBJ_NAME,A.CENTER_X_GD,A.CENTER_Y_GD,A.LOC_AD,A.PROVINCIAL,
- C.TRACK_ID ,
- CASE WHEN C.OBJ_ID IS NULL THEN B.OBJ_ID ELSE C.OBJ_ID END OBJ_ID ,
- C.OBJ_NM ,
- C.MANG_NM ,
- C.LOAC ,
- CASE WHEN C.DIS_CONTENT IS NULL THEN A.WTDST_DTLE ELSE C.DIS_CONTENT END DIS_CONTENT ,
- A.WTDST_WRKAM,
- CASE WHEN C.WKSTATE IS NULL THEN A.WTDST_STATE ELSE C.WKSTATE END WKSTATE,
- TO_CHAR(CASE WHEN C.PLAN_TM IS NULL THEN A.PLAN_RCVR_TM ELSE C.PLAN_TM END,'YYYY-MM-DD') PLAN_TM,
- C.PROM_NUM ,
- C.AD_NM ,
- C.GROUP_LEADER_ID ,
- C.GROUP_LEADER ,
- C.GROUP_LEADER_TEL ,
- C.REC_PERS_ID ,
- C.REC_PERS ,
- C.REC_PERS_TEL ,
- C.INDP ,
- TO_CHAR(C.INTM,'YYYY-MM-DD HH24:MI:SS') INTM,
- TO_CHAR(C.UPTM,'YYYY-MM-DD HH24:MI:SS') UPTM,
- C.NOTE ,
- C.ATTACHID ,
- C.DATA_STAT ,
- C.STATE
- from BIS_INSP_WTDST A LEFT JOIN BIS_INSP_ALL_OBJ B ON A.WTDST_ID=B.CODE LEFT JOIN BIS_INSP_WTDST_TRACK C ON B.OBJ_ID=C.OBJ_ID
- WHERE 1=1
- <include refid="choseSql"/>
- <if test="adCodes != null and adCodes != ''">and A.LOC_AD LIKE #{adCodes}||'%'</if>
- <if test="ids !=null and ids !=''">
- AND B.ID IN
- (SELECT REGEXP_SUBSTR('${ids}','[^,]+', 1, LEVEL) FROM DUAL
- CONNECT BY REGEXP_SUBSTR('${ids}', '[^,]+', 1, LEVEL) IS NOT NULL)
- </if>
- AND REGEXP_LIKE(
- B.Id,'^('||
- ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid}
- <include refid="orgIdSql"/>
- )>0 then
- (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
- id FROM BIS_INSP_ALL_RLATION WHERE PERSID =#{persGuid}
- <include refid="orgIdSql"/>
- )
- else (select 'non' from dual) end)
- ||')')
- ORDER BY C.STATE,C.UPTM
- </select>
- <update id="updateBatchProvincial" parameterType="cn.com.goldenwater.dcproj.param.BisInspWtdstParam">
- update BIS_INSP_WTDST set PROVINCIAL = #{provincial}
- where WTDST_ID in
- <foreach item="wtdstId" collection="wtdstIds" open="(" separator="," close=")">
- #{wtdstId}
- </foreach>
- </update>
- </mapper>
|