JudicialCasesStatisticsYearMapper.xml 6.74 KB
<?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="com.lhcredit.project.business.judicialCasesStatisticsYear.mapper.JudicialCasesStatisticsYearMapper">
    
    <resultMap type="JudicialCasesStatisticsYear" id="JudicialCasesStatisticsYearResult">
        <result property="id"    column="id"    />
        <result property="caseType"    column="caseType"    />
        <result property="caseTypeStr"    column="caseTypeStr"    />
        <result property="oneyear"    column="oneyear"    />
        <result property="onetothreeyear"    column="onetothreeyear"    />
        <result property="threetofiveyear"    column="threetofiveyear"    />
        <result property="fiveyear"    column="fiveyear"    />
        <result property="countTotal"    column="countTotal"    />
        <result property="reportId"    column="report_id"    />
        <result property="dataStatus"    column="dataStatus"    />
        <result property="ename"    column="ename"    />
        <result property="lastUpdateTime"    column="lastUpdateTime"    />
        <result property="cgId"    column="cg_id"    />
    </resultMap>
	
	<sql id="selectJudicialCasesStatisticsYearVo">
        select id, caseType, caseTypeStr, oneyear, onetothreeyear, threetofiveyear, fiveyear, countTotal, report_id, dataStatus, ename, lastUpdateTime, cg_id from judicial_cases_statistics_year
    </sql>
	
    <select id="selectJudicialCasesStatisticsYearList" parameterType="JudicialCasesStatisticsYear" resultMap="JudicialCasesStatisticsYearResult">
        <include refid="selectJudicialCasesStatisticsYearVo"/>
        <where>  
            <if test="id != null "> and id = #{id}</if>
            <if test="caseType != null "> and caseType = #{caseType}</if>
            <if test="caseTypeStr != null  and caseTypeStr != '' "> and caseTypeStr = #{caseTypeStr}</if>
            <if test="oneyear != null  and oneyear != '' "> and oneyear = #{oneyear}</if>
            <if test="onetothreeyear != null  and onetothreeyear != '' "> and onetothreeyear = #{onetothreeyear}</if>
            <if test="threetofiveyear != null  and threetofiveyear != '' "> and threetofiveyear = #{threetofiveyear}</if>
            <if test="fiveyear != null  and fiveyear != '' "> and fiveyear = #{fiveyear}</if>
            <if test="countTotal != null  and countTotal != '' "> and countTotal = #{countTotal}</if>
            <if test="reportId != null  and reportId != '' "> and report_id = #{reportId}</if>
            <if test="dataStatus != null "> and dataStatus = #{dataStatus}</if>
            <if test="ename != null  and ename != '' "> and ename = #{ename}</if>
            <if test="lastUpdateTime != null "> and lastUpdateTime = #{lastUpdateTime}</if>
            <if test="cgId != null "> and cg_id = #{cgId}</if>
        </where>
    </select>
    
    <select id="selectJudicialCasesStatisticsYearById" parameterType="Integer" resultMap="JudicialCasesStatisticsYearResult">
        <include refid="selectJudicialCasesStatisticsYearVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertJudicialCasesStatisticsYear" parameterType="JudicialCasesStatisticsYear" useGeneratedKeys="true" keyProperty="id">
        insert into judicial_cases_statistics_year
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="caseType != null  ">caseType,</if>
			<if test="caseTypeStr != null  and caseTypeStr != ''  ">caseTypeStr,</if>
			<if test="oneyear != null  and oneyear != ''  ">oneyear,</if>
			<if test="onetothreeyear != null  and onetothreeyear != ''  ">onetothreeyear,</if>
			<if test="threetofiveyear != null  and threetofiveyear != ''  ">threetofiveyear,</if>
			<if test="fiveyear != null  and fiveyear != ''  ">fiveyear,</if>
			<if test="countTotal != null  and countTotal != ''  ">countTotal,</if>
			<if test="reportId != null  and reportId != ''  ">report_id,</if>
			<if test="dataStatus != null  ">dataStatus,</if>
			<if test="ename != null  and ename != ''  ">ename,</if>
			<if test="lastUpdateTime != null  ">lastUpdateTime,</if>
			<if test="cgId != null  ">cg_id,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="caseType != null  ">#{caseType},</if>
			<if test="caseTypeStr != null  and caseTypeStr != ''  ">#{caseTypeStr},</if>
			<if test="oneyear != null  and oneyear != ''  ">#{oneyear},</if>
			<if test="onetothreeyear != null  and onetothreeyear != ''  ">#{onetothreeyear},</if>
			<if test="threetofiveyear != null  and threetofiveyear != ''  ">#{threetofiveyear},</if>
			<if test="fiveyear != null  and fiveyear != ''  ">#{fiveyear},</if>
			<if test="countTotal != null  and countTotal != ''  ">#{countTotal},</if>
			<if test="reportId != null  and reportId != ''  ">#{reportId},</if>
			<if test="dataStatus != null  ">#{dataStatus},</if>
			<if test="ename != null  and ename != ''  ">#{ename},</if>
			<if test="lastUpdateTime != null  ">#{lastUpdateTime},</if>
			<if test="cgId != null  ">#{cgId},</if>
         </trim>
    </insert>
	 
    <update id="updateJudicialCasesStatisticsYear" parameterType="JudicialCasesStatisticsYear">
        update judicial_cases_statistics_year
        <trim prefix="SET" suffixOverrides=",">
            <if test="caseType != null  ">caseType = #{caseType},</if>
            <if test="caseTypeStr != null  and caseTypeStr != ''  ">caseTypeStr = #{caseTypeStr},</if>
            <if test="oneyear != null  and oneyear != ''  ">oneyear = #{oneyear},</if>
            <if test="onetothreeyear != null  and onetothreeyear != ''  ">onetothreeyear = #{onetothreeyear},</if>
            <if test="threetofiveyear != null  and threetofiveyear != ''  ">threetofiveyear = #{threetofiveyear},</if>
            <if test="fiveyear != null  and fiveyear != ''  ">fiveyear = #{fiveyear},</if>
            <if test="countTotal != null  and countTotal != ''  ">countTotal = #{countTotal},</if>
            <if test="reportId != null  and reportId != ''  ">report_id = #{reportId},</if>
            <if test="dataStatus != null  ">dataStatus = #{dataStatus},</if>
            <if test="ename != null  and ename != ''  ">ename = #{ename},</if>
            <if test="lastUpdateTime != null  ">lastUpdateTime = #{lastUpdateTime},</if>
            <if test="cgId != null  ">cg_id = #{cgId},</if>
        </trim>
        where id = #{id}
    </update>

	<delete id="deleteJudicialCasesStatisticsYearById" parameterType="Integer">
        delete from judicial_cases_statistics_year where id = #{id}
    </delete>
	
    <delete id="deleteJudicialCasesStatisticsYearByIds" parameterType="String">
        delete from judicial_cases_statistics_year where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>