| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- <?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.BisInspPlanYearPrgDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspPlanYearPrg" id="bisInspPlanYearPrgResultMap">
- <result property="id" column="ID"/>
- <result property="chkYearId" column="CHK_YEAR_ID"/>
- <result property="chkForm" column="CHK_FORM"/>
- <result property="chkMnth" column="CHK_MNTH"/>
- <result property="chkNote" column="CHK_NOTE"/>
- <result property="chkGroup" column="CHK_GROUP"/>
- <result property="chkPers" column="CHK_PERS"/>
- <result property="chkPblm" column="CHK_PBLM"/>
- <result property="chkLeder" column="CHK_LEDER"/>
- <result property="trainNum" column="TRAIN_NUM"/>
- <result property="trainPers" column="TRAIN_PERS"/>
- <result property="nextPlan" column="NEXT_PLAN"/>
- <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="leadDep" column="LEAD_DEP"/>
- <result property="joinDep" column="JOIN_DEP"/>
- <result property="chkName" column="CHK_NAME"/>
- <result property="objType" column="OBJ_TYPE"/>
- <result property="sttm" column="STTM"/>
- <result property="entm" column="ENTM"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="isFinish" column="IS_FINISH"/>
- <result property="objTypeNm" column="OBJ_TYPE_NM"/>
- <result property="chkFormNm" column="CHK_FORM_NM"/>
- <result property="isPlanned" column="IS_PLANNED"/>
- <result property="unplannedChkNm" column="UNPLANNED_CHK_NM"/>
- <result property="nextSttm" column="NEXT_STTM"/>
- <result property="nextEntm" column="NEXT_ENTM"/>
- <result property="addvnm" column="ADDVNM"/>
- <result property="addvcd" column="ADDVCD"/>
- <association property="chkYear" javaType="java.lang.String" column="{chkYearId = CHK_YEAR_ID}" select="selectPlanYearByChkYearId"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- CHK_YEAR_ID,
- CHK_FORM,
- CHK_MNTH,
- CHK_NOTE,
- CHK_GROUP,
- CHK_PERS,
- CHK_PBLM,
- CHK_LEDER,
- TRAIN_NUM,
- TRAIN_PERS,
- NEXT_PLAN,
- NOTE,
- PERS_ID,
- INTM,
- UPTM,
- LEAD_DEP,
- STTM,
- ENTM,
- OBJ_TYPE,
- AD_CODE,
- IS_FINISH,
- OBJ_TYPE_NM,
- CHK_FORM_NM,
- DATA_STAT,
- IS_PLANNED,
- UNPLANNED_CHK_NM,
- CHK_NAME,
- NEXT_STTM,
- NEXT_ENTM,
- ADDVNM,
- ADDVCD
- </sql>
- <sql id="entity_properties">
- #{id},
- #{chkYearId},
- #{chkForm},
- #{chkMnth},
- #{chkNote},
- #{chkGroup},
- #{chkPers},
- #{chkPblm},
- #{chkLeder},
- #{trainNum},
- #{trainPers},
- #{nextPlan},
- #{note},
- #{persId},
- #{intm},
- #{uptm},
- #{leadDep},
- #{sttm},
- #{entm},
- #{objType},
- #{adCode},
- #{isFinish},
- #{objTypeNm},
- #{chkFormNm},
- #{dataStat},
- #{isPlanned},
- #{unplannedChkNm},
- #{chkName},
- #{nextSttm},
- #{nextEntm},
- #{addvnm},
- #{addvcd}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="chkYearId != null and chkYearId != ''">and CHK_YEAR_ID = #{chkYearId}</if>
- <if test="chkForm != null and chkForm != ''">and CHK_FORM = #{chkForm}</if>
- <if test="chkMnth != null">and CHK_MNTH = #{chkMnth}</if>
- <if test="chkNote != null and chkNote != ''">and CHK_NOTE = #{chkNote}</if>
- <if test="chkGroup != null and chkGroup != ''">and CHK_GROUP = #{chkGroup}</if>
- <if test="chkPers != null and chkPers != ''">and CHK_PERS = #{chkPers}</if>
- <if test="chkPblm != null and chkPblm != ''">and CHK_PBLM = #{chkPblm}</if>
- <if test="chkLeder != null and chkLeder != ''">and CHK_LEDER = #{chkLeder}</if>
- <if test="trainNum != null and trainNum != ''">and TRAIN_NUM = #{trainNum}</if>
- <if test="trainPers != null and trainPers != ''">and TRAIN_PERS = #{trainPers}</if>
- <if test="nextPlan != null and nextPlan != ''">and NEXT_PLAN = #{nextPlan}</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="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- <if test="isPlanned != null and isPlanned != ''">and IS_PLANNED = #{isPlanned}</if>
- <if test="chkName != null and chkName != ''">and ( CHK_NAME LIKE CONCAT('%',#{chkName},'%') or UNPLANNED_CHK_NM LIKE CONCAT('%',#{chkName},'%') ) </if>
- <if test="nextSttm != null">and NEXT_STTM = #{nextSttm}</if>
- <if test="nextEntm != null">and NEXT_ENTM = #{nextEntm}</if>
- <if test="addvnm != null and addvnm != ''">and ADDVNM = #{addvnm}</if>
- <if test="addvcd != null and addvcd != ''">and ADDVCD = #{addvcd}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspPlanYearPrgResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_PLAN_YEAR_PRG where ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspPlanYearPrgResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_PLAN_YEAR_PRG
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspPlanYearPrgResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_PLAN_YEAR_PRG
- </select>
- <select id="findList" resultMap="bisInspPlanYearPrgResultMap">
- SELECT <include refid="table_columns"/>
- from BIS_INSP_PLAN_YEAR_PRG
- where 1=1
- <if test="adCode != null and adCode != ''">and AD_CODE LIKE '${adCode}%'</if>
- <if test="chkName != null and chkName != ''">and (CHK_NAME LIKE '${chkName}%' or UNPLANNED_CHK_NM LIKE '${chkName}%' ) </if>
- <if test="isPlanned != null and isPlanned != ''">and IS_PLANNED = #{isPlanned} </if>
- <if test="sttm != null and sttm != ''">and STTM >= to_date(substr(#{sttm},0,10),'yyyy-mm-dd')</if>
- <if test="entm != null and entm != ''">and ENTM <= to_date(substr(#{entm},0,10),'yyyy-mm-dd')</if>
- <if test="objType != null and objType != ''">and
- <foreach item="item" index="index" collection="objType.split(',')" open="(" separator="or" close=")" >
- OBJ_TYPE LIKE concat('%${item}','%')
- </foreach>
- </if>
- <if test="leadDep != null and leadDep != ''">and LEAD_DEP LIKE '%${leadDep}%'</if>
- <if test="chkForm != null and chkForm != ''">and
- <foreach item="item" index="index" collection="chkForm.split(',')" open="(" separator="or" close=")" >
- CHK_FORM LIKE concat('%${item}','%')
- </foreach>
- </if>
- and DATA_STAT = '0'
- <if test="chkYearId != null and chkYearId != ''">
- and CHK_YEAR_ID = #{chkYearId}
- </if>
- order by ENTM desc
- </select>
- <select id="findListByMonth" resultMap="bisInspPlanYearPrgResultMap">
- SELECT <include refid="table_columns"/>
- from BIS_INSP_PLAN_YEAR_PRG
- where 1=1
- <if test="adCode != null and adCode != ''">and AD_CODE LIKE '${adCode}%'</if>
- <if test="sttm != null and sttm != ''">and to_char(STTM,'yyyy-MM') >= #{sttm}</if>
- <if test="entm != null and entm != ''">and to_char(ENTM,'yyyy-MM') <= #{entm}</if>
- <if test="objType != null and objType != ''">and
- <foreach item="item" index="index" collection="objType.split(',')" open="(" separator="or" close=")" >
- OBJ_TYPE LIKE concat('%${item}','%')
- </foreach>
- </if>
- <if test="leadDep != null and leadDep != ''">and LEAD_DEP LIKE '%${leadDep}%'</if>
- <if test="chkForm != null and chkForm != ''">and
- <foreach item="item" index="index" collection="chkForm.split(',')" open="(" separator="or" close=")" >
- CHK_FORM LIKE concat('%${item}','%')
- </foreach>
- </if>
- and DATA_STAT = '0'
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from BIS_INSP_PLAN_YEAR_PRG
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanYearPrg">
- insert into BIS_INSP_PLAN_YEAR_PRG(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- update BIS_INSP_PLAN_YEAR_PRG set DATA_STAT='9' where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanYearPrg">
- delete from BIS_INSP_PLAN_YEAR_PRG
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_PLAN_YEAR_PRG set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanYearPrg">
- update BIS_INSP_PLAN_YEAR_PRG
- <trim prefix="set" suffixOverrides=",">
- <if test="chkYearId != null and chkYearId != ''">CHK_YEAR_ID = #{chkYearId},</if>
- <if test="chkName != null and chkName != ''">CHK_NAME = #{chkName},</if>
- <if test="chkForm != null and chkForm != ''">CHK_FORM = #{chkForm},</if>
- <if test="chkMnth != null">CHK_MNTH = #{chkMnth},</if>
- <if test="chkNote != null and chkNote != ''">CHK_NOTE = #{chkNote},</if>
- <if test="chkGroup != null and chkGroup != ''">CHK_GROUP = #{chkGroup},</if>
- <if test="chkPers != null and chkPers != ''">CHK_PERS = #{chkPers},</if>
- <if test="chkPblm != null and chkPblm != ''">CHK_PBLM = #{chkPblm},</if>
- <if test="chkLeder != null and chkLeder != ''">CHK_LEDER = #{chkLeder},</if>
- <if test="trainNum != null and trainNum != ''">TRAIN_NUM = #{trainNum},</if>
- <if test="trainPers != null and trainPers != ''">TRAIN_PERS = #{trainPers},</if>
- <if test="nextPlan != null and nextPlan != ''">NEXT_PLAN = #{nextPlan},</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="leadDep != null and leadDep != ''">LEAD_DEP = #{leadDep},</if>
- <if test="objType != null and objType != ''">OBJ_TYPE = #{objType},</if>
- <if test="sttm != null">STTM = #{sttm},</if>
- <if test="entm != null">ENTM = #{entm},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="isFinish != null and isFinish != ''">IS_FINISH = #{isFinish},</if>
- <if test="objTypeNm != null and objTypeNm != ''">OBJ_TYPE_NM = #{objTypeNm},</if>
- <if test="chkFormNm != null and chkFormNm != ''">CHK_FORM_NM = #{chkFormNm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="isPlanned != null and isPlanned != ''">IS_PLANNED = #{isPlanned},</if>
- <if test="unplannedChkNm != null ">UNPLANNED_CHK_NM = #{unplannedChkNm},</if>
- <if test="nextSttm != null"> NEXT_STTM = #{nextSttm},</if>
- <if test="nextEntm != null">NEXT_ENTM = #{nextEntm},</if>
- <if test="addvnm != null and addvnm != ''">ADDVNM = #{addvnm},</if>
- <if test="addvcd != null and addvcd != ''">ADDVCD = #{addvcd},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspPlanYearPrg">
- update BIS_INSP_PLAN_YEAR_PRG
- <trim prefix="set" suffixOverrides=",">
- <if test="chkYearId != null and chkYearId != ''">CHK_YEAR_ID = #{chkYearId},</if>
- <if test="chkName != null and chkName != ''">CHK_NAME = #{chkName},</if>
- <if test="chkForm != null and chkForm != ''">CHK_FORM = #{chkForm},</if>
- <if test="chkMnth != null">CHK_MNTH = #{chkMnth},</if>
- <if test="chkNote != null and chkNote != ''">CHK_NOTE = #{chkNote},</if>
- <if test="chkGroup != null and chkGroup != ''">CHK_GROUP = #{chkGroup},</if>
- <if test="chkPers != null and chkPers != ''">CHK_PERS = #{chkPers},</if>
- <if test="chkPblm != null and chkPblm != ''">CHK_PBLM = #{chkPblm},</if>
- <if test="chkLeder != null and chkLeder != ''">CHK_LEDER = #{chkLeder},</if>
- <if test="trainNum != null and trainNum != ''">TRAIN_NUM = #{trainNum},</if>
- <if test="trainPers != null and trainPers != ''">TRAIN_PERS = #{trainPers},</if>
- <if test="nextPlan != null and nextPlan != ''">NEXT_PLAN = #{nextPlan},</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="isPlanned != null and isPlanned != ''">IS_PLANNED = #{isPlanned},</if>
- <if test="unplannedChkNm != null ">UNPLANNED_CHK_NM = #{unplannedChkNm},</if>
- <if test="nextSttm != null">NEXT_STTM = #{nextSttm},</if>
- <if test="nextEntm != null">NEXT_ENTM = #{nextEntm},</if>
- <if test="addvnm != null and addvnm != ''"> ADDVNM = #{addvnm},</if>
- <if test="addvcd != null and addvcd != ''"> ADDVCD = #{addvcd},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="getPlanByYearId" resultType="cn.com.goldenwater.dcproj.model.BisInspPlanYearPrg">
- select * from BIS_INSP_PLAN_YEAR_PRG where chk_year_id=#{yearId}
- </select>
- <select id="selectPlanYearByChkYearId" resultType="String">
- select CHK_YEAR from BIS_INSP_PLAN_YEAR where ID = #{chkYearId}
- </select>
- </mapper>
|