| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- <?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.BisInsNtfctnDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInsNtfctn" id="bisInsNtfctnResultMap">
- <result property="id" column="ID"/>
- <result property="inspType" column="INSP_TYPE"/>
- <result property="plnNm" column="PLN_NM"/>
- <result property="planYr" column="PLAN_YR"/>
- <result property="planNo" column="PLAN_NO"/>
- <result property="orgId" column="ORG_ID"/>
- <result property="planUnt" column="PLAN_UNT"/>
- <result property="intm" column="INTM"/>
- <result property="planCnt" column="PLAN_CNT"/>
- <result property="planCar" column="PLAN_CAR"/>
- <result property="pesrid" column="PESRID"/>
- <result property="flagValid" column="FLAG_VALID"/>
- <result property="sendState" column="SEND_STATE"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- INSP_TYPE,
- PLN_NM,
- PLAN_YR,
- PLAN_NO,
- ORG_ID,
- PLAN_UNT,
- INTM,
- PLAN_CNT,
- PLAN_CAR,
- PESRID,
- FLAG_VALID,
- SEND_STATE
- </sql>
- <sql id="entity_properties">
- #{id},
- #{inspType},
- #{plnNm},
- #{planYr},
- #{planNo},
- #{orgId},
- #{planUnt},
- #{intm},
- #{planCnt},
- #{planCar},
- #{pesrid},
- #{flagValid},
- #{sendState}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="inspType != null and inspType != ''">and INSP_TYPE = #{inspType}</if>
- <if test="plnNm != null and plnNm != ''">and PLN_NM = #{plnNm}</if>
- <if test="planYr != null and planYr != ''">and PLAN_YR = #{planYr}</if>
- <if test="planNo != null and planNo != ''">and PLAN_NO = #{planNo}</if>
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- <if test="planUnt != null and planUnt != ''">and PLAN_UNT = #{planUnt}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="planCnt != null and planCnt != ''">and PLAN_CNT = #{planCnt}</if>
- <if test="planCar != null and planCar != ''">and PLAN_CAR = #{planCar}</if>
- <if test="pesrid != null and pesrid != ''">and PESRID = #{pesrid}</if>
- <if test="flagValid != null">and FLAG_VALID = #{flagValid}</if>
- <if test="sendState != null and sendState != ''">and SEND_STATE = #{sendState}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInsNtfctnResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INS_NTFCTN where ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInsNtfctnResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INS_NTFCTN
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInsNtfctnResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INS_NTFCTN
- </select>
- <select id="findList" resultMap="bisInsNtfctnResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INS_NTFCTN
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from BIS_INS_NTFCTN
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInsNtfctn">
- insert into BIS_INS_NTFCTN(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INS_NTFCTN where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInsNtfctn">
- delete from BIS_INS_NTFCTN
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INS_NTFCTN set flag_valid = '0' where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInsNtfctn">
- update BIS_INS_NTFCTN
- <trim prefix="set" suffixOverrides=",">
- <if test="inspType != null and inspType != ''">INSP_TYPE = #{inspType},</if>
- <if test="plnNm != null and plnNm != ''">PLN_NM = #{plnNm},</if>
- <if test="planYr != null and planYr != ''">PLAN_YR = #{planYr},</if>
- <if test="planNo != null and planNo != ''">PLAN_NO = #{planNo},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="planUnt != null and planUnt != ''">PLAN_UNT = #{planUnt},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="planCnt != null and planCnt != ''">PLAN_CNT = #{planCnt},</if>
- <if test="planCar != null and planCar != ''">PLAN_CAR = #{planCar},</if>
- <if test="pesrid != null and pesrid != ''">PESRID = #{pesrid},</if>
- <if test="flagValid != null">FLAG_VALID = #{flagValid},</if>
- <if test="sendState != null and sendState != ''">SEND_STATE = #{sendState},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInsNtfctn">
- update BIS_INS_NTFCTN
- <trim prefix="set" suffixOverrides=",">
- <if test="inspType != null and inspType != ''">INSP_TYPE = #{inspType},</if>
- <if test="plnNm != null and plnNm != ''">PLN_NM = #{plnNm},</if>
- <if test="planYr != null and planYr != ''">PLAN_YR = #{planYr},</if>
- <if test="planNo != null and planNo != ''">PLAN_NO = #{planNo},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="planUnt != null and planUnt != ''">PLAN_UNT = #{planUnt},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="planCnt != null and planCnt != ''">PLAN_CNT = #{planCnt},</if>
- <if test="planCar != null and planCar != ''">PLAN_CAR = #{planCar},</if>
- <if test="pesrid != null and pesrid != ''">PESRID = #{pesrid},</if>
- <if test="flagValid != null">FLAG_VALID = #{flagValid},</if>
- <if test="sendState != null and sendState != ''">SENG_STATE = #{sendState},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="queryNtfctn" resultType="cn.com.goldenwater.dcproj.dto.BisInsNtfctnDto">
- select A.*,B.PERS_NAME,B.ORG_NM from BIS_INS_NTFCTN A
- LEFT JOIN BIS_INSP_ALL_RLATION_PERS B ON A.PESRID=B.GUID
- where A.FLAG_VALID='1'
- <if test="inspType != null and inspType != ''">and A.INSP_TYPE = #{inspType}</if>
- <if test="plnNm != null and plnNm != ''">and A.PLN_NM = #{plnNm}</if>
- <if test="planYr != null and planYr != ''">and A.PLAN_YR = #{planYr}</if>
- <if test="planNo != null and planNo != ''">and A.PLAN_NO = #{planNo}</if>
- <if test="orgId != null and orgId != ''">and A.ORG_ID = #{orgId}</if>
- <if test="planUnt != null and planUnt != ''">and A.PLAN_UNT = #{planUnt}</if>
- <if test="planCnt != null and planCnt != ''">and A.PLAN_CNT = #{planCnt}</if>
- <if test="planCar != null and planCar != ''">and A.PLAN_CAR = #{planCar}</if>
- <if test="pesrid != null and pesrid != ''">and A.PESRID = #{pesrid}</if>
- <if test="sendState != null and sendState != ''">and SENG_STATE = #{sendState}</if>
- </select>
- <select id="getNtfcById" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.NtfctnAndDvdwkDto">
- SELECT A.ID,
- A.INSP_TYPE,
- A.PLN_NM,
- A.PLAN_YR,
- A.PLAN_NO,
- A.ORG_ID,
- A.PLAN_UNT,
- A.INTM,
- A.PLAN_CNT,
- A.PLAN_CAR,
- A.PESRID,
- A.FLAG_VALID,
- A.SEND_STATE,B.PERS_NAME,B.ORG_NM FROM BIS_INS_NTFCTN A LEFT JOIN BIS_INSP_ALL_RLATION_PERS B ON A.PESRID=B.GUID
- where A.FLAG_VALID='1' AND A.ID = #{id}
- </select>
- <select id="queryNtfctnAndDvdwk" parameterType="cn.com.goldenwater.dcproj.param.BisInsNtfctnParam"
- resultType="cn.com.goldenwater.dcproj.dto.NtfctnDvdwkDto">
- SELECT A.*,B.DVDWK_ID,
- B.GUID,
- B.ORG_DP,
- B.DTYPE,
- B.CONTENT,
- B.INSP_NUM,
- B.AD_CODE,
- B.AD_NAME,
- B.ORG_NAME,
- B.INSP_COUNT,
- B.INSP_SCALE FROM BIS_INS_NTFCTN A LEFT JOIN BIS_INSP_DVDWK B ON A.ID = B.SCHM_ID
- WHERE A.FLAG_VALID='1' AND A.SEND_STATE = '1'
- AND A.ID IN (SELECT NTFCTN_ID FROM BIS_INSP_RECV_UNIT WHERE ORG_ID IN (SELECT ORG_ID FROM bis_insp_all_rlation_pers WHERE GUID = #{pesrid}))
- <if test="inspType != null and inspType != ''">and A.INSP_TYPE = #{inspType}</if>
- <if test="plnNm != null and plnNm != ''">and A.PLN_NM = #{plnNm}</if>
- <if test="planYr != null and planYr != ''">and A.PLAN_YR = #{planYr}</if>
- <if test="planNo != null and planNo != ''">and A.PLAN_NO = #{planNo}</if>
- <if test="orgId != null and orgId != ''">and A.ORG_ID = #{orgId}</if>
- <if test="planUnt != null and planUnt != ''">and A.PLAN_UNT = #{planUnt}</if>
- <if test="planCnt != null and planCnt != ''">and A.PLAN_CNT = #{planCnt}</if>
- <if test="planCar != null and planCar != ''">and A.PLAN_CAR = #{planCar}</if>
- <if test="pesrid != null and pesrid != ''">and A.PESRID = #{pesrid}</if>
- <if test="sendState != null and sendState != ''">and SENG_STATE = #{sendState}</if>
- </select>
- </mapper>
|