| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <?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.TacEvalationInformDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.TacEvalationInform" id="tacEvalationInformResultMap">
- <result property="id" column="ID"/>
- <result property="type" column="TYPE"/>
- <result property="year" column="YEAR"/>
- <result property="batch" column="BATCH"/>
- <result property="cutTm" column="CUT_TM"/>
- <result property="zolPersId" column="ZOL_PERS_ID"/>
- <result property="informNum" column="INFORM_NUM"/>
- <result property="inTm" column="IN_TM"/>
- <result property="upTm" column="UP_TM"/>
- <result property="persId" column="PERS_ID"/>
- </resultMap>
-
- <sql id="table_columns">
- ID,
- TYPE,
- YEAR,
- BATCH,
- CUT_TM,
- ZOL_PERS_ID,
- INFORM_NUM,
- IN_TM,
- UP_TM,
- PERS_ID
- </sql>
- <sql id="entity_properties">
- #{id},
- #{type},
- #{year},
- #{batch},
- #{cutTm},
- #{zolPersId},
- #{informNum},
- #{inTm},
- #{upTm},
- #{persId}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="type != null and type != ''">and TYPE = #{type}</if>
- <if test="year != null and year != ''">and YEAR = #{year}</if>
- <if test="batch != null and batch != ''">and BATCH = #{batch}</if>
- <if test="cutTm != null">and CUT_TM = #{cutTm}</if>
- <if test="zolPersId != null and zolPersId != ''">and ZOL_PERS_ID = #{zolPersId}</if>
- <if test="informNum != null and informNum != ''">and INFORM_NUM = #{informNum}</if>
- <if test="inTm != null">and IN_TM = #{inTm}</if>
- <if test="upTm != null">and UP_TM = #{upTm}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- </trim>
- </sql>
- <select id="get" resultMap="tacEvalationInformResultMap" parameterType="String" >
- select <include refid="table_columns" /> from TAC_EVALATION_INFORM where ID = #{id}
- </select>
- <select id="getBy" resultMap="tacEvalationInformResultMap">
- select <include refid="table_columns" /> from TAC_EVALATION_INFORM <include refid="page_where" />
- </select>
- <select id="findAll" resultMap="tacEvalationInformResultMap">
- select <include refid="table_columns" /> from TAC_EVALATION_INFORM
- </select>
- <select id="findList" resultMap="tacEvalationInformResultMap">
- select <include refid="table_columns" /> from TAC_EVALATION_INFORM <include refid="page_where" />
- </select>
- <select id="selectCount" resultType="int" >
- select count(ID) from TAC_EVALATION_INFORM <include refid="page_where" />
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacEvalationInform">
- insert into TAC_EVALATION_INFORM( <include refid="table_columns" /> )
- values ( <include refid="entity_properties" /> )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from TAC_EVALATION_INFORM where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacEvalationInform">
- delete from TAC_EVALATION_INFORM <include refid="page_where" />
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update TAC_EVALATION_INFORM set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacEvalationInform">
- update TAC_EVALATION_INFORM
- <trim prefix="set" suffixOverrides=",">
- <if test="type != null and type != ''">TYPE = #{type},</if>
- <if test="year != null and year != ''">YEAR = #{year},</if>
- <if test="batch != null and batch != ''">BATCH = #{batch},</if>
- <if test="cutTm != null">CUT_TM = #{cutTm},</if>
- <if test="zolPersId != null and zolPersId != ''">ZOL_PERS_ID = #{zolPersId},</if>
- <if test="informNum != null and informNum != ''">INFORM_NUM = #{informNum},</if>
- <if test="inTm != null">IN_TM = #{inTm},</if>
- <if test="upTm != null">UP_TM = #{upTm},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacEvalationInform">
- update TAC_EVALATION_INFORM
- <trim prefix="set" suffixOverrides=",">
- <if test="type != null and type != ''">TYPE = #{type},</if>
- <if test="year != null and year != ''">YEAR = #{year},</if>
- <if test="batch != null and batch != ''">BATCH = #{batch},</if>
- <if test="cutTm != null">CUT_TM = #{cutTm},</if>
- <if test="zolPersId != null and zolPersId != ''">ZOL_PERS_ID = #{zolPersId},</if>
- <if test="informNum != null and informNum != ''">INFORM_NUM = #{informNum},</if>
- <if test="inTm != null">IN_TM = #{inTm},</if>
- <if test="upTm != null">UP_TM = #{upTm},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- </trim>
- <include refid="page_where" />
- </update>
- <!-- 其他自定义SQL -->
- <select id="getInformList" resultType="cn.com.goldenwater.dcproj.dto.TacEvalationInformDto" parameterType="cn.com.goldenwater.dcproj.param.TacEvalationInformParam">
- select * from (
- select DISTINCT b.id,b.name,b.age,b.mobilenumb,b.ID_NO,b.role_type,
- (case when i.id is null then '0' else '1' end) as state,i.INFORM_NUM as count
- from tac_insp_year_batch_group_pers p left join tac_worker_b b on p.pers_id = b.id left join ( select * from TAC_EVALATION_INFORM
- t where 1=1
- <if test="year != null">
- and t.year = #{year}
- </if>
- <if test="batch != null">
- and t.batch = #{batch}
- </if>
- )i on b.id = i.ZOL_PERS_ID
- where 1=1 and b.id is not null
- <if test="year != null">
- and p.year = #{year}
- </if>
- <if test="batch != null">
- and p.batch = ${batch}
- </if>
- <if test="roleType != null and roleType != ''"> and b.role_type = #{roleType}</if>
- <if test="notRoleType != null and notRoleType != ''"> and p.role_type not in (${notRoleType})</if>
- <if test="name != null and name != ''"> and b.name like '%${name}%'</if>
- ) t where 1=1
- <if test="state != null and state != ''">
- and t.state = #{state}
- </if>
- </select>
- <select id="getInformListBySize" resultType="cn.com.goldenwater.dcproj.model.TacEvalationInform" parameterType="cn.com.goldenwater.dcproj.param.TacEvalationInformParam">
- select <include refid="table_columns" /> from TAC_EVALATION_INFORM
- where ZOL_PERS_ID in (select id from tac_worker_b where login_id = #{persId})
- <if test="year != null">
- and year = #{year}
- </if>
- <if test="size != null">
- limit cast(#{size} as signed)-1
- </if>
- </select>
- </mapper>
|