| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345 |
- <?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.BisInspWiuRgstrDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspWiuRgstr" id="bisInspWiuRgstrResultMap">
- <result property="id" column="ID"/>
- <result property="objId" column="OBJ_ID"/>
- <result property="wiuId" column="WIU_ID"/>
- <result property="wiuName" column="WIU_NAME"/>
- <result property="adName" column="AD_NAME"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="wiuLoc" column="WIU_LOC"/>
- <result property="wiuLong" column="WIU_LONG"/>
- <result property="wiuLat" column="WIU_LAT"/>
- <result property="gdX" column="GD_X"/>
- <result property="gdY" column="GD_Y"/>
- <result property="watLicCode" column="WAT_LIC_CODE"/>
- <result property="wiuContact" column="WIU_CONTACT"/>
- <result property="wiuContactTel" column="WIU_CONTACT_TEL"/>
- <result property="apprContact" column="APPR_CONTACT"/>
- <result property="apprContactTel" column="APPR_CONTACT_TEL"/>
- <result property="note" column="NOTE"/>
- <result property="state" column="STATE"/>
- <result property="dataStat" column="DATA_STAT"/>
- <result property="intInfoStat" column="INT_INFO_STAT"/>
- <result property="apprInfoStat" column="APPR_INFO_STAT"/>
- <result property="persId" column="PERS_ID"/>
- <result property="groupId" column="GROUP_ID"/>
- <result property="inTm" column="IN_TM"/>
- <result property="upTm" column="UP_TM"/>
- <result property="apprUnit" column="APPR_UNIT"/>
- <result property="province" column="PROVINCE"/>
- </resultMap>
-
- <sql id="table_columns">
- ID,
- OBJ_ID,
- WIU_ID,
- WIU_NAME,
- AD_NAME,
- AD_CODE,
- WIU_LOC,
- WIU_LONG,
- WIU_LAT,
- GD_X,
- GD_Y,
- WAT_LIC_CODE,
- WIU_CONTACT,
- WIU_CONTACT_TEL,
- APPR_CONTACT,
- APPR_CONTACT_TEL,
- NOTE,
- STATE,
- DATA_STAT,
- INT_INFO_STAT,
- APPR_INFO_STAT,
- PERS_ID,
- GROUP_ID,
- IN_TM,
- UP_TM,
- APPR_UNIT,PROVINCE
- </sql>
- <sql id="entity_properties">
- #{id},
- #{objId},
- #{wiuId},
- #{wiuName},
- #{adName},
- #{adCode},
- #{wiuLoc},
- #{wiuLong},
- #{wiuLat},
- #{gdX},
- #{gdY},
- #{watLicCode},
- #{wiuContact},
- #{wiuContactTel},
- #{apprContact},
- #{apprContactTel},
- #{note},
- #{state},
- #{dataStat},
- #{intInfoStat},
- #{apprInfoStat},
- #{persId},
- #{groupId},
- #{inTm},
- #{upTm},
- #{apprUnit},#{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>
- <choose>
- <when test="province !=null and province !=''">
- and province =#{provicne}
- </when>
- <otherwise>
- and province is null
- </otherwise>
- </choose>
- <if test="wiuId != null and wiuId != ''">and WIU_ID = #{wiuId}</if>
- <if test="wiuName != null and wiuName != ''">and WIU_NAME = #{wiuName}</if>
- <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="wiuLoc != null and wiuLoc != ''">and WIU_LOC = #{wiuLoc}</if>
- <if test="wiuLong != null and wiuLong != ''">and WIU_LONG = #{wiuLong}</if>
- <if test="wiuLat != null and wiuLat != ''">and WIU_LAT = #{wiuLat}</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="watLicCode != null and watLicCode != ''">and WAT_LIC_CODE = #{watLicCode}</if>
- <if test="wiuContact != null and wiuContact != ''">and WIU_CONTACT = #{wiuContact}</if>
- <if test="wiuContactTel != null and wiuContactTel != ''">and WIU_CONTACT_TEL = #{wiuContactTel}</if>
- <if test="apprContact != null and apprContact != ''">and APPR_CONTACT = #{apprContact}</if>
- <if test="apprContactTel != null and apprContactTel != ''">and APPR_CONTACT_TEL = #{apprContactTel}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="state != null and state != ''">and STATE = #{state}</if>
- <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- <if test="intInfoStat != null and intInfoStat != ''">and INT_INFO_STAT = #{intInfoStat}</if>
- <if test="apprInfoStat != null and apprInfoStat != ''">and APPR_INFO_STAT = #{apprInfoStat}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
- <if test="inTm != null">and IN_TM = #{inTm}</if>
- <if test="upTm != null">and UP_TM = #{upTm}</if>
- <if test="apprUnit != null and apprUnit != ''">and APPR_UNIT = #{apprUnit}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspWiuRgstrResultMap" parameterType="String" >
- select <include refid="table_columns" /> from BIS_INSP_WIU_RGSTR where ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspWiuRgstrResultMap">
- select <include refid="table_columns" /> from BIS_INSP_WIU_RGSTR <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="bisInspWiuRgstrResultMap">
- select <include refid="table_columns" /> from BIS_INSP_WIU_RGSTR
- </select>
- <select id="findList" resultMap="bisInspWiuRgstrResultMap">
- select <include refid="table_columns" /> from BIS_INSP_WIU_RGSTR <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from BIS_INSP_WIU_RGSTR <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspWiuRgstr">
- insert into BIS_INSP_WIU_RGSTR( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_WIU_RGSTR where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspWiuRgstr">
- delete from BIS_INSP_WIU_RGSTR <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_WIU_RGSTR set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspWiuRgstr">
- update BIS_INSP_WIU_RGSTR
- <trim prefix="set" suffixOverrides=",">
- <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
- <if test="province != null and province != ''"> PROVINCE = #{province},</if>
- <if test="wiuId != null and wiuId != ''">WIU_ID = #{wiuId},</if>
- <if test="wiuName != null and wiuName != ''">WIU_NAME = #{wiuName},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="wiuLoc != null and wiuLoc != ''">WIU_LOC = #{wiuLoc},</if>
- <if test="wiuLong != null and wiuLong != ''">WIU_LONG = #{wiuLong},</if>
- <if test="wiuLat != null and wiuLat != ''">WIU_LAT = #{wiuLat},</if>
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="watLicCode != null and watLicCode != ''">WAT_LIC_CODE = #{watLicCode},</if>
- <if test="wiuContact != null and wiuContact != ''">WIU_CONTACT = #{wiuContact},</if>
- <if test="wiuContactTel != null and wiuContactTel != ''">WIU_CONTACT_TEL = #{wiuContactTel},</if>
- <if test="apprContact != null and apprContact != ''">APPR_CONTACT = #{apprContact},</if>
- <if test="apprContactTel != null and apprContactTel != ''">APPR_CONTACT_TEL = #{apprContactTel},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="intInfoStat != null and intInfoStat != ''">INT_INFO_STAT = #{intInfoStat},</if>
- <if test="apprInfoStat != null and apprInfoStat != ''">APPR_INFO_STAT = #{apprInfoStat},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="inTm != null">IN_TM = #{inTm},</if>
- <if test="upTm != null">UP_TM = #{upTm},</if>
- <if test="apprUnit != null and apprUnit != ''">APPR_UNIT = #{apprUnit},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspWiuRgstr">
- update BIS_INSP_WIU_RGSTR
- <trim prefix="set" suffixOverrides=",">
- <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
- <if test="province != null and province != ''"> PROVINCE = #{province},</if>
- <if test="wiuId != null and wiuId != ''">WIU_ID = #{wiuId},</if>
- <if test="wiuName != null and wiuName != ''">WIU_NAME = #{wiuName},</if>
- <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="wiuLoc != null and wiuLoc != ''">WIU_LOC = #{wiuLoc},</if>
- <if test="wiuLong != null and wiuLong != ''">WIU_LONG = #{wiuLong},</if>
- <if test="wiuLat != null and wiuLat != ''">WIU_LAT = #{wiuLat},</if>
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="watLicCode != null and watLicCode != ''">WAT_LIC_CODE = #{watLicCode},</if>
- <if test="wiuContact != null and wiuContact != ''">WIU_CONTACT = #{wiuContact},</if>
- <if test="wiuContactTel != null and wiuContactTel != ''">WIU_CONTACT_TEL = #{wiuContactTel},</if>
- <if test="apprContact != null and apprContact != ''">APPR_CONTACT = #{apprContact},</if>
- <if test="apprContactTel != null and apprContactTel != ''">APPR_CONTACT_TEL = #{apprContactTel},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="intInfoStat != null and intInfoStat != ''">INT_INFO_STAT = #{intInfoStat},</if>
- <if test="apprInfoStat != null and apprInfoStat != ''">APPR_INFO_STAT = #{apprInfoStat},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="inTm != null">IN_TM = #{inTm},</if>
- <if test="upTm != null">UP_TM = #{upTm},</if>
- <if test="apprUnit != null and apprUnit != ''">APPR_UNIT = #{apprUnit},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <sql id="choseSql">
- <choose>
- <when test="province !=null and province !=''">
- and B.province like '${province}%'
- </when>
- <otherwise>
- and B.province is null
- </otherwise>
- </choose>
- </sql>
- <select id="getListByInspGroupIdObjType" parameterType="cn.com.goldenwater.dcproj.param.PagePersObjParam"
- resultType="cn.com.goldenwater.dcproj.dto.BisInspWiuRgstrDto">
- select t.*,C.id groupId,C.PNM groupName,B.obj_id,r.wiu_loc
- from att_wiu_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}
- left join BIS_INSP_WIU_RGSTR r on B.obj_id=r.obj_id
- where 1 = 1
- <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="orgIdSql">
- <choose>
- <when test="orgId !=null and orgId !=''">
- and ORG_ID=#{orgId}
- </when>
- <otherwise>
- and ORG_ID is null
- </otherwise>
- </choose>
- </sql>
- <!-- 其他自定义SQL -->
- <select id="findWiuList" resultType="cn.com.goldenwater.dcproj.dto.BisInspRgstrDto" parameterType="cn.com.goldenwater.dcproj.param.TypeParam">
- SELECT * FROM (
- select A.CODE,A.ID nodeId,
- A.NM,
- #{pType} PTYPE,
- B.WIU_LONG as centerX,
- B.WIU_LAT as centerY,
- B.GD_X as lgtd,
- B.GD_Y as lttd,
- B.GD_X,
- B.GD_y,
- A.OBJ_ID,B.ID ID,B.ID AS RGSTRID,
- b.WIU_LOC as location,
- (case when b.State is null then '0' else b.state end)STATE
- ,B.IN_TM,
- x.ad_full_name as adName,
- ia.pnm groupName,
- B.INT_INFO_STAT,
- B.APPR_INFO_STAT,c.wint_code as wintCode
- from BIS_INSP_ALL_OBJ
- A LEFT JOIN BIS_INSP_WIU_RGSTR B ON A.OBJ_ID=B.OBJ_ID
- LEFT JOIN ATT_WIU_BASE C ON A.CODE=C.ID
- left JOin ATT_AD_X_BASE x on B.ad_code = x.ad_code
- LEFT JOIN BIS_INSP_ALL ia on A.ID = ia.id
- where A.ptype= #{pType}
- <if test="tabType =='2'.toString()">
- and ia.entm < DATE_FORMAT(#{nowTime},'%Y-%m-%d')
- </if>
- <if test="tabType =='1'.toString()">
- and ia.entm >= DATE_FORMAT(#{nowTime},'%Y-%m-%d')
- </if>
- <if test="inIdsSql != null and inIdsSql != '' ">
- and A.id in (${inIdsSql})
- </if>
- ) A WHERE a.PTYPE=#{pType}
- <if test="adName != null and adName != ''">
- and a.adName like '%${adName}%'
- </if>
- <if test="plnaId !=null and plnaId !=''">
- and a.nodeId like '${plnaId}%'
- </if>
- <if test="groupId != null and groupId != ''">
- AND a.nodeId like '${groupId}%'
- </if>
- <if test="state !=null and state !=''">
- and STATE=#{state}
- </if>
- <if test="rsName !=null and rsName !=''">
- and a.nm like '%${rsName}%'
- </if>
- <if test="code !=null and code !=''">
- and a.code = #{code}
- </if>
- <if test="sttm != null and sttm != ''">and a.IN_TM>= DATE_FORMAT(#{sttm},'%Y-%m-%d')</if>
- <if test="entm != null and entm != ''">and a.IN_TM <= DATE_FORMAT(#{entm},'%Y-%m-%d')</if>
- order by nodeId asc
- <if test="orderBy != null and orderBy != ''">
- ,CONVERT( nm USING gbk ) COLLATE gbk_chinese_ci ASC
- </if>
- </select>
- </mapper>
|