| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365 |
- <?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.AttJskejianEcofrdRgstrDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.AttJskejianEcofrdRgstr" id="attJskejianEcofrdRgstrResultMap">
- <result property="id" column="ID"/>
- <result property="objId" column="OBJ_ID"/>
- <result property="accepNum" column="ACCEP_NUM"/>
- <result property="assignNum" column="ASSIGN_NUM"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="adName" column="AD_NAME"/>
- <result property="location" column="LOCATION"/>
- <result property="centerX" column="CENTER_X"/>
- <result property="centerY" column="CENTER_Y"/>
- <result property="gdX" column="GD_X"/>
- <result property="gdY" column="GD_Y"/>
- <result property="reportContent" column="REPORT_CONTENT"/>
- <result property="biz" column="BIZ"/>
- <result property="hostUnit" column="HOST_UNIT"/>
- <result property="sptUnit" column="SPT_UNIT"/>
- <result property="invstVfctn" column="INVST_VFCTN"/>
- <result property="trtmtRctftn" column="TRTMT_RCTFTN"/>
- <result property="opinion" column="OPINION"/>
- <result property="office" column="OFFICE"/>
- <result property="isOver" column="IS_OVER"/>
- <result property="reviConc" column="REVI_CONC"/>
- <result property="reviOpin" column="REVI_OPIN"/>
- <result property="persId" column="PERS_ID"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="state" column="STATE"/>
- <result property="groupId" column="GROUP_ID"/>
- <result property="province" column="PROVINCE"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- OBJ_ID,
- ACCEP_NUM,
- ASSIGN_NUM,
- AD_CODE,
- AD_NAME,
- LOCATION,
- CENTER_X,
- CENTER_Y,
- GD_X,
- GD_Y,
- REPORT_CONTENT,
- BIZ,
- HOST_UNIT,
- SPT_UNIT,
- INVST_VFCTN,
- TRTMT_RCTFTN,
- OPINION,
- OFFICE,
- IS_OVER,
- REVI_CONC,
- REVI_OPIN,
- PERS_ID,
- INTM,
- UPTM,
- STATE,
- GROUP_ID,
- PROVINCE
- </sql>
- <sql id="entity_properties">
- #{id},
- #{objId},
- #{accepNum},
- #{assignNum},
- #{adCode},
- #{adName},
- #{location},
- #{centerX},
- #{centerY},
- #{gdX},
- #{gdY},
- #{reportContent},
- #{biz},
- #{hostUnit},
- #{sptUnit},
- #{invstVfctn},
- #{trtmtRctftn},
- #{opinion},
- #{office},
- #{isOver},
- #{reviConc},
- #{reviOpin},
- #{persId},
- #{intm},
- #{uptm},
- #{state},
- #{groupId},
- #{province}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
- <if test="accepNum != null and accepNum != ''">and ACCEP_NUM = #{accepNum}</if>
- <if test="assignNum != null and assignNum != ''">and ASSIGN_NUM = #{assignNum}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE like '${adCode}%'</if>
- <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
- <if test="location != null and location != ''">and LOCATION = #{location}</if>
- <if test="centerX != null and centerX != ''">and CENTER_X = #{centerX}</if>
- <if test="centerY != null and centerY != ''">and CENTER_Y = #{centerY}</if>
- <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
- <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
- <if test="reportContent != null and reportContent != ''">and REPORT_CONTENT = #{reportContent}</if>
- <if test="biz != null and biz != ''">and BIZ = #{biz}</if>
- <if test="hostUnit != null and hostUnit != ''">and HOST_UNIT = #{hostUnit}</if>
- <if test="sptUnit != null and sptUnit != ''">and SPT_UNIT = #{sptUnit}</if>
- <if test="invstVfctn != null and invstVfctn != ''">and INVST_VFCTN = #{invstVfctn}</if>
- <if test="trtmtRctftn != null and trtmtRctftn != ''">and TRTMT_RCTFTN = #{trtmtRctftn}</if>
- <if test="opinion != null and opinion != ''">and OPINION = #{opinion}</if>
- <if test="office != null and office != ''">and OFFICE = #{office}</if>
- <if test="isOver != null and isOver != ''">and IS_OVER = #{isOver}</if>
- <if test="reviConc != null and reviConc != ''">and REVI_CONC = #{reviConc}</if>
- <if test="reviOpin != null and reviOpin != ''">and REVI_OPIN = #{reviOpin}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="state != null and state != ''">and STATE = #{state}</if>
- <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
- <if test="province != null and province != ''">and PROVINCE like '%${province}%'</if>
- </trim>
- </sql>
- <select id="get" resultMap="attJskejianEcofrdRgstrResultMap" parameterType="String" >
- select <include refid="table_columns" /> from ATT_JSKEJIAN_ECOFRD_RGSTR where ID = #{id}
- </select>
- <select id="getBy" resultMap="attJskejianEcofrdRgstrResultMap">
- select <include refid="table_columns" /> from ATT_JSKEJIAN_ECOFRD_RGSTR <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="attJskejianEcofrdRgstrResultMap">
- select <include refid="table_columns" /> from ATT_JSKEJIAN_ECOFRD_RGSTR
- </select>
- <select id="findList" resultMap="attJskejianEcofrdRgstrResultMap">
- select <include refid="table_columns" /> from ATT_JSKEJIAN_ECOFRD_RGSTR <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from ATT_JSKEJIAN_ECOFRD_RGSTR <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttJskejianEcofrdRgstr">
- insert into ATT_JSKEJIAN_ECOFRD_RGSTR( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from ATT_JSKEJIAN_ECOFRD_RGSTR where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttJskejianEcofrdRgstr">
- delete from ATT_JSKEJIAN_ECOFRD_RGSTR <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update ATT_JSKEJIAN_ECOFRD_RGSTR set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttJskejianEcofrdRgstr">
- update ATT_JSKEJIAN_ECOFRD_RGSTR
- <trim prefix="set" suffixOverrides=",">
- <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
- <if test="accepNum != null and accepNum != ''">ACCEP_NUM = #{accepNum},</if>
- <if test="assignNum != null and assignNum != ''">ASSIGN_NUM = #{assignNum},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="location != null and location != ''">LOCATION = #{location},</if>
- <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
- <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="reportContent != null and reportContent != ''">REPORT_CONTENT = #{reportContent},</if>
- <if test="biz != null and biz != ''">BIZ = #{biz},</if>
- <if test="hostUnit != null and hostUnit != ''">HOST_UNIT = #{hostUnit},</if>
- <if test="sptUnit != null and sptUnit != ''">SPT_UNIT = #{sptUnit},</if>
- <if test="invstVfctn != null and invstVfctn != ''">INVST_VFCTN = #{invstVfctn},</if>
- <if test="trtmtRctftn != null and trtmtRctftn != ''">TRTMT_RCTFTN = #{trtmtRctftn},</if>
- <if test="opinion != null and opinion != ''">OPINION = #{opinion},</if>
- <if test="office != null and office != ''">OFFICE = #{office},</if>
- <if test="isOver != null and isOver != ''">IS_OVER = #{isOver},</if>
- <if test="reviConc != null and reviConc != ''">REVI_CONC = #{reviConc},</if>
- <if test="reviOpin != null and reviOpin != ''">REVI_OPIN = #{reviOpin},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="province != null and province != ''">PROVINCE = #{province},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttJskejianEcofrdRgstr">
- update ATT_JSKEJIAN_ECOFRD_RGSTR
- <trim prefix="set" suffixOverrides=",">
- <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
- <if test="accepNum != null and accepNum != ''">ACCEP_NUM = #{accepNum},</if>
- <if test="assignNum != null and assignNum != ''">ASSIGN_NUM = #{assignNum},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="location != null and location != ''">LOCATION = #{location},</if>
- <if test="centerX != null and centerX != ''">CENTER_X = #{centerX},</if>
- <if test="centerY != null and centerY != ''">CENTER_Y = #{centerY},</if>
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="reportContent != null and reportContent != ''">REPORT_CONTENT = #{reportContent},</if>
- <if test="biz != null and biz != ''">BIZ = #{biz},</if>
- <if test="hostUnit != null and hostUnit != ''">HOST_UNIT = #{hostUnit},</if>
- <if test="sptUnit != null and sptUnit != ''">SPT_UNIT = #{sptUnit},</if>
- <if test="invstVfctn != null and invstVfctn != ''">INVST_VFCTN = #{invstVfctn},</if>
- <if test="trtmtRctftn != null and trtmtRctftn != ''">TRTMT_RCTFTN = #{trtmtRctftn},</if>
- <if test="opinion != null and opinion != ''">OPINION = #{opinion},</if>
- <if test="office != null and office != ''">OFFICE = #{office},</if>
- <if test="isOver != null and isOver != ''">IS_OVER = #{isOver},</if>
- <if test="reviConc != null and reviConc != ''">REVI_CONC = #{reviConc},</if>
- <if test="reviOpin != null and reviOpin != ''">REVI_OPIN = #{reviOpin},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="province != null and province != ''">PROVINCE = #{province},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- <select id="findEcfordPage" parameterType="cn.com.goldenwater.dcproj.param.TypeParam" resultType="cn.com.goldenwater.dcproj.dto.BisInspRgstrDto">
- select * from (
- select A.*,b.id as rgstrId,CASE WHEN B.STATE IS NULL THEN '0' ELSE B.STATE END AS state,(case when b.ASSIGN_NUM is
- null then cast(c.ASSIGN_NUM as char ) else b.ASSIGN_NUM end) as name,b.intm as IN_TM,b.uptm as Up_tm,
- c.id as baseId,b.REPORT_CONTENT,b.biz, (case when b.IS_OVER = '1' then '已办结' else '未办结' end) IS_OVER ,
- (case when b.location is null then c.location else b.location end) as location,ia.pnm groupName,ria.pnm
- riverName,ad.ad_full_name as ad_name from BIS_INSP_ALL_OBJ A join ATT_JSKEJIAN_ECOFRD_RGSTR B on A.Obj_Id
- = B.Obj_Id left join ATT_JSKEJIAN_ECOFRD_BASE c on a.code = c.id
- left join ATT_AD_X_BASE ad on b.ad_code = ad.ad_code LEFT JOIN BIS_INSP_ALL ia on A.ID = ia.id
- left join BIS_INSP_ALL ria on substr(A.ID,1,6) = ria.id
- where 1 = 1
- <include refid="choseSql"/>
- <if test="adName != null and adName != ''">and ad.AD_FULL_NAME LIKE '%${adName}%'</if>
- <if test="groupId != null and groupId != ''">and A.id = #{groupId}</if>
- <if test="adCode != null and adCode !=''">and B.AD_CODE like '${adCode}%'</if>
- <if test="plnaId !=null and plnaId !=''">
- and A.id like '${plnaId}%'
- </if>
- <if test="orgId != null and orgId !=''">and A.org_id = #{orgId}</if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND B.intm >= STR_TO_DATE(#{sttm},'%Y-%m-%d') AND B.uptm < DATE_ADD(STR_TO_DATE(#{entm},'%Y-%m-%d'),INTERVAL 1 DAY)
- </if>
- and
- B.id in (${inIdsSql})
- ) where 1 = 1
- <if test="state != null and state != ''">
- and state in (${state})
- </if>
- <if test="name != null and name != ''">
- and name like '%${name}%'
- </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="findPcEcfordPage" resultType="cn.com.goldenwater.dcproj.dto.AttJskejianEcofrdRgstrDto"
- parameterType="cn.com.goldenwater.dcproj.param.AttJskejianEcofrdRgstrParam">
- select * from (
- select A.*,b.id as rgstrId,CASE WHEN B.STATE IS NULL THEN '0' ELSE B.STATE END AS state,(case when b.ASSIGN_NUM is
- null then cast(c.ASSIGN_NUM as char) else b.ASSIGN_NUM end) as name,b.intm,b.uptm,
- c.id as baseId,b.biz,b.REPORT_CONTENT,
- (case when b.CENTER_X is null then c.CENTER_X else b.CENTER_X end) as centerX,
- (case when b.CENTER_Y is null then c.CENTER_Y else b.CENTER_Y end) as centerY,
- (case when b.location is null then c.location else b.location end) as location,ia.pnm groupName,ria.pnm
- riverName,ad.ad_full_name from BIS_INSP_ALL_OBJ A join ATT_JSKEJIAN_ECOFRD_RGSTR B on A.Obj_Id
- = B.Obj_Id left join ATT_JSKEJIAN_ECOFRD_BASE c on a.code = c.id
- left join ATT_AD_X_BASE ad on b.ad_code = ad.ad_code LEFT JOIN BIS_INSP_ALL ia on A.ID = ia.id
- left join BIS_INSP_ALL ria on substr(A.ID,1,6) = ria.id
- where 1 = 1
- <if test="tabType =='2'.toString()">
- and ria.entm <DATE_ADD(STR_TO_DATE(#{nowTime},'%Y-%m-%d'),INTERVAL 1 DAY)
- </if>
- <if test="tabType =='1'.toString()">
- and ria.entm >=STR_TO_DATE(#{nowTime},'%Y-%m-%d')
- </if>
- <include refid="choseSql"/>
- <if test="adName != null and adName != ''">and ad.AD_FULL_NAME LIKE '%${adName}%'</if>
- <if test="groupId != null and groupId != ''">and A.id = #{groupId}</if>
- <if test="adCode != null and adCode !=''">and B.AD_CODE like '${adCode}%'</if>
- <if test="orgId != null and orgId !=''">and A.org_id =#{orgId}</if>
- <if test="plnaId !=null and plnaId !=''">
- and A.id like '${plnaId}%'
- </if>
- <if test="sttm != null and sttm != '' and entm != null and entm != ''">
- AND B.INTM >= STR_TO_DATE(#{sttm},'%Y-%m-%d') AND B.UPTM < STR_TO_DATE(#{entm},'%Y-%m-%d')
- </if>
- and
- B.id in (${inIdsSql})
- ) where 1 = 1
- <if test="state != null and state != ''">
- and state in (${state})
- </if>
- <if test="name != null and name != ''">
- and name like '%${name}%'
- </if>
- </select>
- <select id="getListEcofrdByInspGroupIdObjType" resultType="cn.com.goldenwater.dcproj.model.AttJskejianEcofrdRgstr" parameterType="cn.com.goldenwater.dcproj.param.PagePersObjParam">
- select t.*,C.id groupId,C.PNM groupName,B.obj_id
- from ATT_JSKEJIAN_ECOFRD_BASE t
- left join BIS_INSP_ALL_OBJ B
- on B.CODE = t.ID
- LEFT JOIN BIS_INSP_ALL C ON B.ID = C.ID
- and B.ptype = #{objType}
- where 1 = 1
- <if test="wtdstNm !=null and wtdstNm !=''">
- and b.nm like '%${wtdstNm}%'
- </if>
- <if test='isAll == "0"'>and B.ID = #{inspGroupId}</if>
- <if test='isAll == "1"'>and B.ID LIKE '${inspGroupId}%'</if>
- <if test="adCode != null and adCode != ''">
- and t.AD_CODE like '${adCode}%'
- </if>
- <choose>
- <when test="province != null and province != ''">
- and B.AD_CODE LIKE '${province}%'
- </when>
- <otherwise>
- and B.AD_CODE is null
- </otherwise>
- </choose>
- </select>
- <sql id="choseSql">
- <choose>
- <when test="province !=null and province !=''">
- and A.AD_Code like '${province}%'
- </when>
- <otherwise>
- and A.AD_CODE is null
- </otherwise>
- </choose>
- </sql>
- </mapper>
|