| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- <?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.ImpRsInfoDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.ImpRsInfo" id="impRsInfoResultMap">
- <result property="id" column="ID"/>
- <result property="sn" column="SN"/>
- <result property="proCode" column="PRO_CODE"/>
- <result property="proName" column="PRO_NAME"/>
- <result property="cityCode" column="CITY_CODE"/>
- <result property="cityName" column="CITY_NAME"/>
- <result property="countyCode" column="COUNTY_CODE"/>
- <result property="countyName" column="COUNTY_NAME"/>
- <result property="rsCode" column="RS_CODE"/>
- <result property="rsName" column="RS_NAME"/>
- <result property="engScal" column="ENG_SCAL"/>
- <result property="totCap" column="TOT_CAP"/>
- <result property="isPoor" column="IS_POOR"/>
- <result property="isCheck" column="IS_CHECK"/>
- <result property="note" column="NOTE"/>
- <result property="orgId" column="ORG_ID"/>
- <result property="orgNm" column="ORG_NM"/>
- <result property="mnth" column="MNTH"/>
- <result property="oldGroupId" column="OLD_GROUP_ID"/>
- <result property="groupId" column="GROUP_ID"/>
- <result property="groupNm" column="GROUP_NM"/>
- <result property="regId" column="REG_ID"/>
- <result property="objId" column="OBJ_ID"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- SN,
- PRO_CODE,
- PRO_NAME,
- CITY_CODE,
- CITY_NAME,
- COUNTY_CODE,
- COUNTY_NAME,
- RS_CODE,
- RS_NAME,
- ENG_SCAL,
- TOT_CAP,
- IS_POOR,
- IS_CHECK,
- NOTE,
- ORG_ID,
- ORG_NM,
- MNTH,
- OLD_GROUP_ID,
- GROUP_ID,
- GROUP_NM,
- REG_ID,
- OBJ_ID
- </sql>
- <sql id="entity_properties">
- #{id},
- #{sn},
- #{proCode},
- #{proName},
- #{cityCode},
- #{cityName},
- #{countyCode},
- #{countyName},
- #{rsCode},
- #{rsName},
- #{engScal},
- #{totCap},
- #{isPoor},
- #{isCheck},
- #{note},
- #{orgId},
- #{orgNm},
- #{mnth},
- #{oldGroupId},
- #{groupId},
- #{groupNm},
- #{regId},
- #{objId}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="sn != null and sn != ''">and SN = #{sn}</if>
- <if test="proCode != null and proCode != ''">and PRO_CODE = #{proCode}</if>
- <if test="proName != null and proName != ''">and PRO_NAME = #{proName}</if>
- <if test="cityCode != null and cityCode != ''">and CITY_CODE = #{cityCode}</if>
- <if test="cityName != null and cityName != ''">and CITY_NAME = #{cityName}</if>
- <if test="countyCode != null and countyCode != ''">and COUNTY_CODE = #{countyCode}</if>
- <if test="countyName != null and countyName != ''">and COUNTY_NAME = #{countyName}</if>
- <if test="rsCode != null and rsCode != ''">and RS_CODE = #{rsCode}</if>
- <if test="rsName != null and rsName != ''">and (RS_NAME like '%${rsName}%' or #{rsName} like '%'||RS_NAME||'%')</if>
- <if test="engScal != null and engScal != ''">and ENG_SCAL = #{engScal}</if>
- <if test="totCap != null and totCap != ''">and TOT_CAP = #{totCap}</if>
- <if test="isPoor != null and isPoor != ''">and IS_POOR = #{isPoor}</if>
- <if test="isCheck != null and isCheck != ''">and IS_CHECK = #{isCheck}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</if>
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- <if test="orgNm != null and orgNm != ''">and ORG_NM = #{orgNm}</if>
- <if test="mnth != null and mnth != ''">and MNTH = #{mnth}</if>
- <if test="oldGroupId != null and oldGroupId != ''">and OLD_GROUP_ID = #{oldGroupId}</if>
- <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
- <if test="groupNm != null and groupNm != ''">and GROUP_NM = #{groupNm}</if>
- <if test="regId != null and regId != ''">and REG_ID = #{regId}</if>
- <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
- </trim>
- </sql>
- <select id="get" resultMap="impRsInfoResultMap" parameterType="String" >
- select <include refid="table_columns" /> from IMP_RS_INFO where ID = #{id}
- </select>
- <select id="getBy" resultMap="impRsInfoResultMap">
- select <include refid="table_columns" /> from IMP_RS_INFO <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="impRsInfoResultMap">
- select <include refid="table_columns" /> from IMP_RS_INFO
- </select>
- <select id="findList" resultMap="impRsInfoResultMap">
- select <include refid="table_columns" /> from IMP_RS_INFO <include refid="page_where" />
- ORDER BY TO_NUMBER(SN)
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from IMP_RS_INFO <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ImpRsInfo">
- insert into IMP_RS_INFO( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from IMP_RS_INFO where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.ImpRsInfo">
- delete from IMP_RS_INFO <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update IMP_RS_INFO set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ImpRsInfo">
- update IMP_RS_INFO
- <trim prefix="set" suffixOverrides=",">
- <if test="sn != null and sn != ''">SN = #{sn},</if>
- <if test="proCode != null and proCode != ''">PRO_CODE = #{proCode},</if>
- <if test="proName != null and proName != ''">PRO_NAME = #{proName},</if>
- <if test="cityCode != null and cityCode != ''">CITY_CODE = #{cityCode},</if>
- <if test="cityName != null and cityName != ''">CITY_NAME = #{cityName},</if>
- <if test="countyCode != null and countyCode != ''">COUNTY_CODE = #{countyCode},</if>
- <if test="countyName != null and countyName != ''">COUNTY_NAME = #{countyName},</if>
- <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
- <if test="rsName != null and rsName != ''">RS_NAME = #{rsName},</if>
- <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
- <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
- <if test="isPoor != null and isPoor != ''">IS_POOR = #{isPoor},</if>
- <if test="isCheck != null and isCheck != ''">IS_CHECK = #{isCheck},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
- <if test="mnth != null and mnth != ''">MNTH = #{mnth},</if>
- <if test="oldGroupId != null and oldGroupId != ''">OLD_GROUP_ID = #{oldGroupId},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="groupNm != null and groupNm != ''">GROUP_NM = #{groupNm},</if>
- <if test="regId != null and regId != ''">REG_ID = #{regId},</if>
- <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.ImpRsInfo">
- update IMP_RS_INFO
- <trim prefix="set" suffixOverrides=",">
- <if test="sn != null and sn != ''">SN = #{sn},</if>
- <if test="proCode != null and proCode != ''">PRO_CODE = #{proCode},</if>
- <if test="proName != null and proName != ''">PRO_NAME = #{proName},</if>
- <if test="cityCode != null and cityCode != ''">CITY_CODE = #{cityCode},</if>
- <if test="cityName != null and cityName != ''">CITY_NAME = #{cityName},</if>
- <if test="countyCode != null and countyCode != ''">COUNTY_CODE = #{countyCode},</if>
- <if test="countyName != null and countyName != ''">COUNTY_NAME = #{countyName},</if>
- <if test="rsCode != null and rsCode != ''">RS_CODE = #{rsCode},</if>
- <if test="rsName != null and rsName != ''">RS_NAME = #{rsName},</if>
- <if test="engScal != null and engScal != ''">ENG_SCAL = #{engScal},</if>
- <if test="totCap != null and totCap != ''">TOT_CAP = #{totCap},</if>
- <if test="isPoor != null and isPoor != ''">IS_POOR = #{isPoor},</if>
- <if test="isCheck != null and isCheck != ''">IS_CHECK = #{isCheck},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
- <if test="mnth != null and mnth != ''">MNTH = #{mnth},</if>
- <if test="oldGroupId != null and oldGroupId != ''">OLD_GROUP_ID = #{oldGroupId},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="groupNm != null and groupNm != ''">GROUP_NM = #{groupNm},</if>
- <if test="regId != null and regId != ''">REG_ID = #{regId},</if>
- <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- <select id="getRegGroupList" resultType="java.util.Map" parameterType="java.util.Map">
- select c.*,a.* from BIS_INSP_RSVR_RGSTR a
- left join bis_insp_all_obj b on a.obj_id = b.obj_id
- left join bis_insp_all c on b.id = c.id
- where 1=1
- <if test="regId != null and regId != ''">and a.rgstr_id = #{regId}</if>
- order by c.id
- </select>
- <select id="getPersIdByReg" resultType="java.util.Map" parameterType="java.util.Map">
- select d.rec_pers_id,c.pers_name,c.id from bis_insp_rsvr_rgstr b
- left join BIS_INSP_BASE_EXT d on b.rgstr_id = d.rgstr_id
- left join BIS_INSP_ALL_RLATION_PERS c on d.rec_pers_id = c.guid
- where 1=1
- <if test="regId != null and regId != ''">and b.rgstr_id = #{regId}</if>
- order by c.id
- </select>
- </mapper>
|