<?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.goldenwater.slaj.eme.mapper.BusiInsureEvaMapper">
    <resultMap type="com.goldenwater.slaj.eme.domain.BusiInsureEva" id="BusiInsureEvaResult">
        <result property="guid" column="guid"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="createTime" column="create_time"/>
        <result property="startDate" column="start_date"/>
        <result property="endDate" column="end_date"/>
        <result property="engTotal" column="eng_total"/>
        <result property="isInsure" column="is_insure"/>
        <result property="notInsure" column="not_insure"/>
        <result property="tendTotal" column="tend_total"/>
        <result property="tendIsInsure" column="tend_is_insure"/>
        <result property="tendNotInsure" column="tend_not_insure"/>
        <result property="bxl" column="bxl"/>
        <result property="nbxl" column="nbxl"/>
        <result property="bxFx" column="bx_fx"/>
        <result property="dateType" column="date_type"/>
        <result property="dateYear" column="date_year"/>
        <result property="dateQuarter" column="date_quarter"/>
    </resultMap>
    <sql id="selectBusiInsureEvaVo">
        select guid, org_guid, create_time, start_date, end_date, eng_total,
               is_insure, not_insure, tend_total, tend_is_insure, tend_not_insure,
               bxl, nbxl, bx_fx, date_type, date_year, date_quarter
        from t_busi_insure_eva
    </sql>
    <select id="selectBusiInsureEvaByGuid" parameterType="String" resultMap="BusiInsureEvaResult">
        <include refid="selectBusiInsureEvaVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBusiInsureEvaList" parameterType="com.goldenwater.slaj.eme.domain.BusiInsureEva" resultMap="BusiInsureEvaResult">
        <include refid="selectBusiInsureEvaVo"/>
        <where>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid = #{orgGuid}</if>
            <if test="dateType != null and dateType != ''">AND date_type = #{dateType}</if>
            <if test="dateYear != null and dateYear != ''">AND date_year = #{dateYear}</if>
        </where>
    </select>
    <insert id="insertBusiInsureEva" parameterType="com.goldenwater.slaj.eme.domain.BusiInsureEva">
        insert into t_busi_insure_eva (
            guid, org_guid, create_time, start_date, end_date, eng_total,
            is_insure, not_insure, tend_total, tend_is_insure, tend_not_insure,
            bxl, nbxl, bx_fx, date_type, date_year, date_quarter
        ) values (
            #{guid}, #{orgGuid}, #{createTime}, #{startDate}, #{endDate}, #{engTotal},
            #{isInsure}, #{notInsure}, #{tendTotal}, #{tendIsInsure}, #{tendNotInsure},
            #{bxl}, #{nbxl}, #{bxFx}, #{dateType}, #{dateYear}, #{dateQuarter}
        )
    </insert>
    <update id="updateBusiInsureEva" parameterType="com.goldenwater.slaj.eme.domain.BusiInsureEva">
        update t_busi_insure_eva
        <set>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="startDate != null">start_date = #{startDate},</if>
            <if test="endDate != null">end_date = #{endDate},</if>
            <if test="engTotal != null">eng_total = #{engTotal},</if>
            <if test="isInsure != null">is_insure = #{isInsure},</if>
            <if test="notInsure != null">not_insure = #{notInsure},</if>
            <if test="tendTotal != null">tend_total = #{tendTotal},</if>
            <if test="tendIsInsure != null">tend_is_insure = #{tendIsInsure},</if>
            <if test="tendNotInsure != null">tend_not_insure = #{tendNotInsure},</if>
            <if test="bxl != null">bxl = #{bxl},</if>
            <if test="nbxl != null">nbxl = #{nbxl},</if>
            <if test="bxFx != null">bx_fx = #{bxFx},</if>
            <if test="dateType != null">date_type = #{dateType},</if>
            <if test="dateYear != null">date_year = #{dateYear},</if>
            <if test="dateQuarter != null">date_quarter = #{dateQuarter},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBusiInsureEvaByGuid" parameterType="String">
        delete from t_busi_insure_eva where guid = #{guid}
    </delete>
    <delete id="deleteBusiInsureEvaByGuids" parameterType="String">
        delete from t_busi_insure_eva where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
