<?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.BisHiddZeroAssessRecMapper">
    <resultMap type="com.goldenwater.slaj.hidd.domain.BisHiddZeroAssessRec" id="BisHiddZeroAssessRecResult">
        <result property="id" column="id"/>
        <result property="assessId" column="assess_id"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="orgName" column="org_name"/>
        <result property="orgCode" column="org_code"/>
        <result property="unitSum" column="unit_sum"/>
        <result property="zeroHiddUnitSum" column="zero_hidd_unit_sum"/>
        <result property="zeroHiddRank" column="zero_hidd_rank"/>
    </resultMap>
    <sql id="selectBisHiddZeroAssessRecVo">
        select id, assess_id, org_guid, org_name, org_code, unit_sum, zero_hidd_unit_sum, zero_hidd_rank
        from bis_hidd_zero_assess_rec
    </sql>
    <select id="selectBisHiddZeroAssessRecById" parameterType="Long" resultMap="BisHiddZeroAssessRecResult">
        <include refid="selectBisHiddZeroAssessRecVo"/>
        where id = #{id}
    </select>
    <select id="selectBisHiddZeroAssessRecList" parameterType="com.goldenwater.slaj.hidd.domain.BisHiddZeroAssessRec" resultMap="BisHiddZeroAssessRecResult">
        <include refid="selectBisHiddZeroAssessRecVo"/>
        <where>
            <if test="assessId != null">AND assess_id = #{assessId}</if>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid = #{orgGuid}</if>
        </where>
    </select>
    <insert id="insertBisHiddZeroAssessRec" parameterType="com.goldenwater.slaj.hidd.domain.BisHiddZeroAssessRec">
        insert into bis_hidd_zero_assess_rec (assess_id, org_guid, org_name, org_code, unit_sum, zero_hidd_unit_sum, zero_hidd_rank)
        values (#{assessId}, #{orgGuid}, #{orgName}, #{orgCode}, #{unitSum}, #{zeroHiddUnitSum}, #{zeroHiddRank})
    </insert>
    <update id="updateBisHiddZeroAssessRec" parameterType="com.goldenwater.slaj.hidd.domain.BisHiddZeroAssessRec">
        update bis_hidd_zero_assess_rec
        <set>
            <if test="assessId != null">assess_id = #{assessId},</if>
            <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="unitSum != null">unit_sum = #{unitSum},</if>
            <if test="zeroHiddUnitSum != null">zero_hidd_unit_sum = #{zeroHiddUnitSum},</if>
            <if test="zeroHiddRank != null">zero_hidd_rank = #{zeroHiddRank},</if>
        </set>
        where id = #{id}
    </update>
    <delete id="deleteBisHiddZeroAssessRecById" parameterType="Long">
        delete from bis_hidd_zero_assess_rec where id = #{id}
    </delete>
    <delete id="deleteBisHiddZeroAssessRecByIds" parameterType="Long">
        delete from bis_hidd_zero_assess_rec where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
