BAutoReportFinanceMapper.xml 3.57 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.bAutoReportFinance.mapper.BAutoReportFinanceMapper">
    
    <resultMap type="BAutoReportFinance" id="BAutoReportFinanceResult">
        <result property="id"    column="id"    />
        <result property="ename"    column="ename"    />
        <result property="type"    column="type"    />
        <result property="curYear"    column="cur_year"    />
        <result property="jsonStr"    column="jsonStr"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>
	
	<sql id="selectBAutoReportFinanceVo">
        select id, ename, type, cur_year, jsonStr, create_time from b_auto_report_finance
    </sql>
	
    <select id="selectBAutoReportFinanceList" parameterType="BAutoReportFinance" resultMap="BAutoReportFinanceResult">
        <include refid="selectBAutoReportFinanceVo"/>
        <where>  
            <if test="id != null "> and id = #{id}</if>
            <if test="ename != null  and ename != '' "> and ename = #{ename}</if>
            <if test="type != null  and type != '' "> and type = #{type}</if>
            <if test="curYear != null "> and cur_year = #{curYear}</if>
            <if test="jsonStr != null  and jsonStr != '' "> and jsonStr = #{jsonStr}</if>
            <if test="createTime != null "> and create_time = #{createTime}</if>
        </where>
    </select>
    
    <select id="selectBAutoReportFinanceById" parameterType="Integer" resultMap="BAutoReportFinanceResult">
        <include refid="selectBAutoReportFinanceVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertBAutoReportFinance" parameterType="BAutoReportFinance" useGeneratedKeys="true" keyProperty="id">
        insert into b_auto_report_finance
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="ename != null  and ename != ''  ">ename,</if>
			<if test="type != null  and type != ''  ">type,</if>
			<if test="curYear != null  ">cur_year,</if>
			<if test="jsonStr != null  and jsonStr != ''  ">jsonStr,</if>
			<if test="createTime != null  ">create_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="ename != null  and ename != ''  ">#{ename},</if>
			<if test="type != null  and type != ''  ">#{type},</if>
			<if test="curYear != null  ">#{curYear},</if>
			<if test="jsonStr != null  and jsonStr != ''  ">#{jsonStr},</if>
			<if test="createTime != null  ">#{createTime},</if>
         </trim>
    </insert>
	 
    <update id="updateBAutoReportFinance" parameterType="BAutoReportFinance">
        update b_auto_report_finance
        <trim prefix="SET" suffixOverrides=",">
            <if test="ename != null  and ename != ''  ">ename = #{ename},</if>
            <if test="type != null  and type != ''  ">type = #{type},</if>
            <if test="curYear != null  ">cur_year = #{curYear},</if>
            <if test="jsonStr != null  and jsonStr != ''  ">jsonStr = #{jsonStr},</if>
            <if test="createTime != null  ">create_time = #{createTime},</if>
        </trim>
        where id = #{id}
    </update>

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