<?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.hidd.mapper.BisHiddAssessMapper">
    <resultMap type="com.goldenwater.slaj.hidd.domain.BisHiddAssess" id="BisHiddAssessResult">
        <result property="id" column="id"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="orgName" column="org_name"/>
        <result property="orgCode" column="org_code"/>
        <result property="assessYear" column="assess_year"/>
        <result property="assessDateNum" column="assess_date_num"/>
        <result property="unitRange" column="unit_range"/>
        <result property="coeffHiddScore" column="coeff_hidd_score"/>
        <result property="coeffHiddSo" column="coeff_hidd_so"/>
        <result property="coeffHiddSoMajor" column="coeff_hidd_so_major"/>
        <result property="coeffHiddSoNormal" column="coeff_hidd_so_normal"/>
        <result property="coeffHiddMissing" column="coeff_hidd_missing"/>
        <result property="collTime" column="coll_time"/>
    </resultMap>
    <sql id="selectBisHiddAssessVo">
        select id, org_guid, org_name, org_code, assess_year, assess_date_num, unit_range, coeff_hidd_score, coeff_hidd_so, coeff_hidd_so_major, coeff_hidd_so_normal, coeff_hidd_missing, coll_time
        from bis_hidd_assess
    </sql>
    <select id="selectBisHiddAssessById" parameterType="Long" resultMap="BisHiddAssessResult">
        <include refid="selectBisHiddAssessVo"/>
        where id = #{id}
    </select>
    <select id="selectBisHiddAssessList" parameterType="com.goldenwater.slaj.hidd.domain.BisHiddAssess" resultMap="BisHiddAssessResult">
        <include refid="selectBisHiddAssessVo"/>
        <where>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid = #{orgGuid}</if>
            <if test="assessYear != null">AND assess_year = #{assessYear}</if>
            <if test="assessDateNum != null">AND assess_date_num = #{assessDateNum}</if>
        </where>
    </select>
    <insert id="insertBisHiddAssess" parameterType="com.goldenwater.slaj.hidd.domain.BisHiddAssess">
        insert into bis_hidd_assess (org_guid, org_name, org_code, assess_year, assess_date_num, unit_range, coeff_hidd_score, coeff_hidd_so, coeff_hidd_so_major, coeff_hidd_so_normal, coeff_hidd_missing, coll_time)
        values (#{orgGuid}, #{orgName}, #{orgCode}, #{assessYear}, #{assessDateNum}, #{unitRange}, #{coeffHiddScore}, #{coeffHiddSo}, #{coeffHiddSoMajor}, #{coeffHiddSoNormal}, #{coeffHiddMissing}, #{collTime})
    </insert>
    <update id="updateBisHiddAssess" parameterType="com.goldenwater.slaj.hidd.domain.BisHiddAssess">
        update bis_hidd_assess
        <set>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
            <if test="orgName != null">org_name = #{orgName},</if>
            <if test="orgCode != null">org_code = #{orgCode},</if>
            <if test="assessYear != null">assess_year = #{assessYear},</if>
            <if test="assessDateNum != null">assess_date_num = #{assessDateNum},</if>
            <if test="unitRange != null">unit_range = #{unitRange},</if>
            <if test="coeffHiddScore != null">coeff_hidd_score = #{coeffHiddScore},</if>
            <if test="coeffHiddSo != null">coeff_hidd_so = #{coeffHiddSo},</if>
            <if test="coeffHiddSoMajor != null">coeff_hidd_so_major = #{coeffHiddSoMajor},</if>
            <if test="coeffHiddSoNormal != null">coeff_hidd_so_normal = #{coeffHiddSoNormal},</if>
            <if test="coeffHiddMissing != null">coeff_hidd_missing = #{coeffHiddMissing},</if>
            <if test="collTime != null">coll_time = #{collTime},</if>
        </set>
        where id = #{id}
    </update>
    <delete id="deleteBisHiddAssessById" parameterType="Long">
        delete from bis_hidd_assess where id = #{id}
    </delete>
    <delete id="deleteBisHiddAssessByIds" parameterType="Long">
        delete from bis_hidd_assess where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
