| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <?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.BisInspPlanYearDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPlanYear" id="bisInspPlanYearResultMap">
- <result property="id" column="ID"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="chkYear" column="CHK_YEAR"/>
- <result property="chkName" column="CHK_NAME"/>
- <result property="chkType" column="CHK_TYPE"/>
- <result property="planSttm" column="PLAN_STTM"/>
- <result property="planEntm" column="PLAN_ENTM"/>
- <result property="leadDep" column="LEAD_DEP"/>
- <result property="joinDep" column="JOIN_DEP"/>
- <result property="chkForm" column="CHK_FORM"/>
- <result property="chkScope" column="CHK_SCOPE"/>
- <result property="chkRly" column="CHK_RLY"/>
- <result property="note" column="NOTE"/>
- <result property="persId" column="PERS_ID"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="dataStat" column="DATA_STAT"/>
- <result property="state" column="STATE"/>
- <result property="ordr" column="ORDR"/>
- <result property="objType" column="OBJ_TYPE"/>
- <result property="objName" column="OBJ_NAME"/>
- <result property="leadDepId" column="LEAD_DEP_ID"/>
- <result property="chkContent" column="CHK_CONTENT"/>
- </resultMap>
-
- <sql id="table_columns">
- ID,
- AD_CODE,
- CHK_YEAR,
- CHK_NAME,
- CHK_TYPE,
- PLAN_STTM,
- PLAN_ENTM,
- LEAD_DEP,
- JOIN_DEP,
- CHK_FORM,
- CHK_SCOPE,
- CHK_RLY,
- NOTE,
- PERS_ID,
- INTM,
- UPTM,
- DATA_STAT,
- STATE,
- ORDR,
- OBJ_TYPE,
- OBJ_NAME,
- LEAD_DEP_ID,
- CHK_CONTENT
- </sql>
- <sql id="entity_properties">
- #{id},
- #{adCode},
- #{chkYear},
- #{chkName},
- #{chkType},
- #{planSttm},
- #{planEntm},
- #{leadDep},
- #{joinDep},
- #{chkForm},
- #{chkScope},
- #{chkRly},
- #{note},
- #{persId},
- #{intm},
- #{uptm},
- #{dataStat},
- #{state},
- #{ordr},
- #{objType},
- #{objName},
- #{leadDepId},
- #{chkContent}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="adCode != null and adCode != ''">and AD_CODE LIKE '${adCode}%'</if>
- <if test="adGrad != null and adGrad != ''">and AD_CODE in (select AD_CODE from ATT_AD_BASE where AD_GRAD = #{adGrad})</if>
- <if test="chkName != null and chkName != ''">and CHK_NAME like '%${chkName}%'</if>
- <if test="chkType != null and chkType != ''">and CHK_TYPE like '%${chkType}%'</if>
- <if test="chkYear != null">
- and (to_char(PLAN_STTM,'yyyy') = #{chkYear} or to_char(PLAN_ENTM,'yyyy') = #{chkYear})
- </if>
- <if test="leadDep != null and leadDep != ''">and LEAD_DEP like '%${leadDep}%'</if>
- <if test='leadDepId != null and ""!=leadDepId '>and LEAD_DEP_ID = #{leadDepId} </if>
- <if test="joinDep != null and joinDep != ''">and JOIN_DEP = #{joinDep}</if>
- <if test="chkForm != null and chkForm != ''">and CHK_FORM = #{chkForm}</if>
- <if test="chkScope != null and chkScope != ''">and CHK_SCOPE = #{chkScope}</if>
- <if test="chkRly != null and chkRly != ''">and CHK_RLY = #{chkRly}</if>
- <if test="note != null and note != ''">and NOTE = #{note}</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 = #{state}</if>
- <if test='planDpId != null and null !=planDpId '>
- AND (ID IN (SELECT DISTINCT PLAN_ID FROM BIS_INSP_PLANDP_RL WHERE PLAN_DP_ID = #{planDpId})
- OR LEAD_DEP_ID = #{planDpId})
- </if>
- <if test='chkContent != null and "" != chkContent '>and CHK_CONTENT like '%${chkContent}%' </if>
- and DATA_STAT = '0'
- </trim>
- </sql>
- <select id="get" resultMap="bisInspPlanYearResultMap" parameterType="String" >
- select <include refid="table_columns" /> from BIS_INSP_PLAN_YEAR where ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspPlanYearResultMap">
- select <include refid="table_columns" /> from BIS_INSP_PLAN_YEAR <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="bisInspPlanYearResultMap">
- select <include refid="table_columns" /> from BIS_INSP_PLAN_YEAR
- </select>
- <select id="findList" resultMap="bisInspPlanYearResultMap">
- select <include refid="table_columns" /> from BIS_INSP_PLAN_YEAR <include refid="page_where" />
- order by ORDR ASC
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from BIS_INSP_PLAN_YEAR <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanYear">
- insert into BIS_INSP_PLAN_YEAR( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- update BIS_INSP_PLAN_YEAR set DATA_STAT='9' where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanYear">
- delete from BIS_INSP_PLAN_YEAR <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_PLAN_YEAR set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanYear">
- update BIS_INSP_PLAN_YEAR
- <trim prefix="set" suffixOverrides=",">
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="chkYear != null and chkYear != ''">CHK_YEAR = #{chkYear},</if>
- <if test="chkName != null and chkName != ''">CHK_NAME = #{chkName},</if>
- <if test="chkType != null and chkType != ''">CHK_TYPE = #{chkType},</if>
- <if test="planSttm != null">PLAN_STTM = #{planSttm},</if>
- <if test="planEntm != null">PLAN_ENTM = #{planEntm},</if>
- <if test="leadDep != null and leadDep != ''">LEAD_DEP = #{leadDep},</if>
- <if test="joinDep != null and joinDep != ''">JOIN_DEP = #{joinDep},</if>
- <if test="chkForm != null and chkForm != ''">CHK_FORM = #{chkForm},</if>
- <if test="chkScope != null and chkScope != ''">CHK_SCOPE = #{chkScope},</if>
- <if test="chkRly != null and chkRly != ''">CHK_RLY = #{chkRly},</if>
- <if test="note != null and note != ''">NOTE = #{note},</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="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="ordr != null and ordr != ''">ORDR = #{ordr},</if>
- <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
- <if test="objName != null and objName != ''">OBJ_NAME = #{objName},</if>
- <if test="leadDepId != null and leadDepId != ''">LEAD_DEP_ID = #{leadDepId},</if>
- <if test='chkContent != null and "" != chkContent ' >CHK_CONTENT = #{chkContent},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanYear">
- update BIS_INSP_PLAN_YEAR
- <trim prefix="set" suffixOverrides=",">
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="chkYear != null and chkYear != ''">CHK_YEAR = #{chkYear},</if>
- <if test="chkName != null and chkName != ''">CHK_NAME = #{chkName},</if>
- <if test="chkType != null and chkType != ''">CHK_TYPE = #{chkType},</if>
- <if test="planSttm != null">PLAN_STTM = #{planSttm},</if>
- <if test="planEntm != null">PLAN_ENTM = #{planEntm},</if>
- <if test="leadDep != null and leadDep != ''">LEAD_DEP = #{leadDep},</if>
- <if test="joinDep != null and joinDep != ''">JOIN_DEP = #{joinDep},</if>
- <if test="chkForm != null and chkForm != ''">CHK_FORM = #{chkForm},</if>
- <if test="chkScope != null and chkScope != ''">CHK_SCOPE = #{chkScope},</if>
- <if test="chkRly != null and chkRly != ''">CHK_RLY = #{chkRly},</if>
- <if test="note != null and note != ''">NOTE = #{note},</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="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="state != null and state != ''">STATE = #{dataStat},</if>
- <if test="ordr != null and ordr != ''">ORDR = #{ordr},</if>
- <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
- <if test="objName != null and objName != ''">OBJ_NAME = #{objName},</if>
- <if test="leadDepId != null and leadDepId != ''">LEAD_DEP_ID = #{leadDepId},</if>
- <if test='chkContent != null and "" != chkContent ' >CHK_CONTENT = #{chkContent},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|