| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <?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.TacInspYearBatchGroupMegDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.TacInspYearBatchGroupMeg" id="tacInspYearBatchGroupMegResultMap">
- <result property="id" column="ID"/>
- <result property="yearBatchId" column="YEAR_BATCH_ID"/>
- <result property="year" column="YEAR"/>
- <result property="batch" column="BATCH"/>
- <result property="groupId" column="GROUP_ID"/>
- <result property="groupNm" column="GROUP_NM"/>
- <result property="exptId" column="EXPT_ID"/>
- <result property="exptNm" column="EXPT_NM"/>
- <result property="exptPhone" column="EXPT_PHONE"/>
- <result property="noticeInfo" column="NOTICE_INFO"/>
- <result property="assId" column="ASS_ID"/>
- <result property="assNm" column="ASS_NM"/>
- <result property="assPhone" column="ASS_PHONE"/>
- <result property="sdPersId" column="SD_PERS_ID"/>
- <result property="sdTm" column="SD_TM"/>
- <result property="sdState" column="SD_STATE"/>
- <result property="inTm" column="IN_TM"/>
- <result property="upTm" column="UP_TM"/>
- <result property="dataStat" column="DATA_STAT"/>
- </resultMap>
-
- <sql id="table_columns">
- ID,
- YEAR_BATCH_ID,
- YEAR,
- BATCH,
- GROUP_ID,
- GROUP_NM,
- EXPT_ID,
- EXPT_NM,
- EXPT_PHONE,
- NOTICE_INFO,
- ASS_ID,
- ASS_NM,
- ASS_PHONE,
- SD_PERS_ID,
- SD_TM,
- SD_STATE,
- IN_TM,
- UP_TM,
- DATA_STAT
- </sql>
- <sql id="entity_properties">
- #{id},
- #{yearBatchId},
- #{year},
- #{batch},
- #{groupId},
- #{groupNm},
- #{exptId},
- #{exptNm},
- #{exptPhone},
- #{noticeInfo},
- #{assId},
- #{assNm},
- #{assPhone},
- #{sdPersId},
- #{sdTm},
- #{sdState},
- #{inTm},
- #{upTm},
- #{dataStat}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="yearBatchId != null and yearBatchId != ''">and YEAR_BATCH_ID = #{yearBatchId}</if>
- <if test="year != null and year != ''">and YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and BATCH = #{batch}</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="exptId != null and exptId != ''">and EXPT_ID = #{exptId}</if>
- <if test="exptNm != null and exptNm != ''">and EXPT_NM = #{exptNm}</if>
- <if test="exptPhone != null and exptPhone != ''">and EXPT_PHONE = #{exptPhone}</if>
- <if test="noticeInfo != null and noticeInfo != ''">and NOTICE_INFO = #{noticeInfo}</if>
- <if test="assId != null and assId != ''">and ASS_ID = #{assId}</if>
- <if test="assNm != null and assNm != ''">and ASS_NM = #{assNm}</if>
- <if test="assPhone != null and assPhone != ''">and ASS_PHONE = #{assPhone}</if>
- <if test="sdPersId != null and sdPersId != ''">and SD_PERS_ID = #{sdPersId}</if>
- <if test="sdTm != null">and SD_TM = #{sdTm}</if>
- <if test="sdState != null and sdState != ''">and SD_STATE = #{sdState}</if>
- <if test="inTm != null">and IN_TM = #{inTm}</if>
- <if test="upTm != null">and UP_TM = #{upTm}</if>
- </trim>
- </sql>
- <select id="get" resultMap="tacInspYearBatchGroupMegResultMap" parameterType="String" >
- select <include refid="table_columns" /> from TAC_INSP_YEAR_BATCH_GROUP_MEG where ID = #{id}
- </select>
- <select id="getBy" resultMap="tacInspYearBatchGroupMegResultMap">
- select <include refid="table_columns" /> from TAC_INSP_YEAR_BATCH_GROUP_MEG <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="tacInspYearBatchGroupMegResultMap">
- select <include refid="table_columns" /> from TAC_INSP_YEAR_BATCH_GROUP_MEG
- </select>
- <select id="findList" resultMap="tacInspYearBatchGroupMegResultMap">
- select <include refid="table_columns" /> from TAC_INSP_YEAR_BATCH_GROUP_MEG <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from TAC_INSP_YEAR_BATCH_GROUP_MEG <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacInspYearBatchGroupMeg">
- insert into TAC_INSP_YEAR_BATCH_GROUP_MEG( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from TAC_INSP_YEAR_BATCH_GROUP_MEG where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacInspYearBatchGroupMeg">
- delete from TAC_INSP_YEAR_BATCH_GROUP_MEG <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update TAC_INSP_YEAR_BATCH_GROUP_MEG set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacInspYearBatchGroupMeg">
- update TAC_INSP_YEAR_BATCH_GROUP_MEG
- <trim prefix="set" suffixOverrides=",">
- <if test="yearBatchId != null and yearBatchId != ''">YEAR_BATCH_ID = #{yearBatchId},</if>
- <if test="year != null and year != ''">YEAR = #{year},</if>
- <if test="batch != null and batch != ''">BATCH = #{batch},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="groupNm != null and groupNm != ''">GROUP_NM = #{groupNm},</if>
- <if test="exptId != null and exptId != ''">EXPT_ID = #{exptId},</if>
- <if test="exptNm != null and exptNm != ''">EXPT_NM = #{exptNm},</if>
- <if test="exptPhone != null and exptPhone != ''">EXPT_PHONE = #{exptPhone},</if>
- <if test="noticeInfo != null and noticeInfo != ''">NOTICE_INFO = #{noticeInfo},</if>
- <if test="assId != null and assId != ''">ASS_ID = #{assId},</if>
- <if test="assNm != null and assNm != ''">ASS_NM = #{assNm},</if>
- <if test="assPhone != null and assPhone != ''">ASS_PHONE = #{assPhone},</if>
- <if test="sdPersId != null and sdPersId != ''">SD_PERS_ID = #{sdPersId},</if>
- <if test="sdTm != null">SD_TM = #{sdTm},</if>
- <if test="sdState != null and sdState != ''">SD_STATE = #{sdState},</if>
- <if test="inTm != null">IN_TM = #{inTm},</if>
- <if test="upTm != null">UP_TM = #{upTm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacInspYearBatchGroupMeg">
- update TAC_INSP_YEAR_BATCH_GROUP_MEG
- <trim prefix="set" suffixOverrides=",">
- <if test="yearBatchId != null and yearBatchId != ''">YEAR_BATCH_ID = #{yearBatchId},</if>
- <if test="year != null and year != ''">YEAR = #{year},</if>
- <if test="batch != null and batch != ''">BATCH = #{batch},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="groupNm != null and groupNm != ''">GROUP_NM = #{groupNm},</if>
- <if test="exptId != null and exptId != ''">EXPT_ID = #{exptId},</if>
- <if test="exptNm != null and exptNm != ''">EXPT_NM = #{exptNm},</if>
- <if test="exptPhone != null and exptPhone != ''">EXPT_PHONE = #{exptPhone},</if>
- <if test="noticeInfo != null and noticeInfo != ''">NOTICE_INFO = #{noticeInfo},</if>
- <if test="assId != null and assId != ''">ASS_ID = #{assId},</if>
- <if test="assNm != null and assNm != ''">ASS_NM = #{assNm},</if>
- <if test="assPhone != null and assPhone != ''">ASS_PHONE = #{assPhone},</if>
- <if test="sdPersId != null and sdPersId != ''">SD_PERS_ID = #{sdPersId},</if>
- <if test="sdTm != null">SD_TM = #{sdTm},</if>
- <if test="sdState != null and sdState != ''">SD_STATE = #{sdState},</if>
- <if test="inTm != null">IN_TM = #{inTm},</if>
- <if test="upTm != null">UP_TM = #{upTm},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- <select id="getGroupMegListBySize" parameterType="cn.com.goldenwater.dcproj.param.TacInspYearBatchGroupMegParam" resultType="cn.com.goldenwater.dcproj.model.TacInspYearBatchGroupMeg">
- select <include refid="table_columns" /> from TAC_INSP_YEAR_BATCH_GROUP_MEG
- where EXPT_ID in (Select id from tac_worker_b where login_id =#{persId})
- <if test="year != null">
- and YEAR = #{year}
- </if>
- order by UP_TM desc
- </select>
- </mapper>
|