<?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.ObjHiddMapper">
    <resultMap type="com.goldenwater.slaj.hidd.domain.ObjHidd" id="ObjHiddResult">
        <result property="guid" column="guid"/>
        <result property="hiddName" column="hidd_name"/>
        <result property="engGuid" column="eng_guid"/>
        <result property="tendGuid" column="tend_guid"/>
        <result property="seGuid" column="se_guid"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="hiddSour" column="hidd_sour"/>
        <result property="hiddGrad" column="hidd_grad"/>
        <result property="hiddClas" column="hidd_clas"/>
        <result property="ifFound" column="if_found"/>
        <result property="proPart" column="pro_part"/>
        <result property="partLong" column="part_long"/>
        <result property="partLat" column="part_lat"/>
        <result property="otlcolQiffFnvu" column="otlcol_qiff_fnvu"/>
        <result property="inspRecGuid" column="insp_rec_guid"/>
        <result property="seCheckItemGuid" column="se_check_item_guid"/>
        <result property="hiddStat" column="hidd_stat"/>
        <result property="hiddMergGuid" column="hidd_merg_guid"/>
        <result property="recOrgGuid" column="rec_org_guid"/>
        <result property="note" column="note"/>
        <result property="collTime" column="coll_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="recPers" column="rec_pers"/>
        <result property="hiddsGuid" column="hidds_guid"/>
        <result property="occuNum" column="occu_num"/>
        <result property="sinsScheGuid" column="sins_sche_guid"/>
        <result property="groupGuid" column="group_guid"/>
        <result property="temp" column="temp"/>
        <result property="toDate" column="to_date"/>
        <result property="dictGuid" column="dict_guid"/>
    </resultMap>
    <sql id="selectObjHiddVo">
        select guid, hidd_name, eng_guid, tend_guid, se_guid, org_guid, hidd_sour, hidd_grad, hidd_clas, if_found, pro_part, part_long, part_lat, otlcol_qiff_fnvu, insp_rec_guid, se_check_item_guid, hidd_stat, hidd_merg_guid, rec_org_guid, note, coll_time, upd_time, rec_pers, hidds_guid, occu_num, sins_sche_guid, group_guid, temp, to_date, dict_guid
        from obj_hidd
    </sql>
    <select id="selectObjHiddByGuid" parameterType="String" resultMap="ObjHiddResult">
        <include refid="selectObjHiddVo"/>
        where guid = #{guid}
    </select>
    <select id="selectObjHiddList" parameterType="com.goldenwater.slaj.hidd.domain.ObjHidd" resultMap="ObjHiddResult">
        <include refid="selectObjHiddVo"/>
        <where>
            <if test="hiddName != null and hiddName != ''">AND hidd_name like '%' || #{hiddName} || '%'</if>
            <if test="hiddGrad != null and hiddGrad != ''">AND hidd_grad = #{hiddGrad}</if>
            <if test="hiddStat != null and hiddStat != ''">AND hidd_stat = #{hiddStat}</if>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid = #{orgGuid}</if>
            <if test="guid != null and guid != ''">AND guid = #{guid}</if>
        </where>
    </select>
    <insert id="insertObjHidd" parameterType="com.goldenwater.slaj.hidd.domain.ObjHidd">
        insert into obj_hidd (guid, hidd_name, eng_guid, tend_guid, se_guid, org_guid, hidd_sour, hidd_grad, hidd_clas, if_found, pro_part, part_long, part_lat, otlcol_qiff_fnvu, insp_rec_guid, se_check_item_guid, hidd_stat, hidd_merg_guid, rec_org_guid, note, coll_time, upd_time, rec_pers, hidds_guid, occu_num, sins_sche_guid, group_guid, temp, to_date, dict_guid)
        values (#{guid}, #{hiddName}, #{engGuid}, #{tendGuid}, #{seGuid}, #{orgGuid}, #{hiddSour}, #{hiddGrad}, #{hiddClas}, #{ifFound}, #{proPart}, #{partLong}, #{partLat}, #{otlcolQiffFnvu}, #{inspRecGuid}, #{seCheckItemGuid}, #{hiddStat}, #{hiddMergGuid}, #{recOrgGuid}, #{note}, #{collTime}, #{updTime}, #{recPers}, #{hiddsGuid}, #{occuNum}, #{sinsScheGuid}, #{groupGuid}, #{temp}, #{toDate}, #{dictGuid})
    </insert>
    <update id="updateObjHidd" parameterType="com.goldenwater.slaj.hidd.domain.ObjHidd">
        update obj_hidd
        <set>
            <if test="hiddName != null">hidd_name = #{hiddName},</if>
            <if test="engGuid != null">eng_guid = #{engGuid},</if>
            <if test="tendGuid != null">tend_guid = #{tendGuid},</if>
            <if test="seGuid != null">se_guid = #{seGuid},</if>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
            <if test="hiddSour != null">hidd_sour = #{hiddSour},</if>
            <if test="hiddGrad != null">hidd_grad = #{hiddGrad},</if>
            <if test="hiddClas != null">hidd_clas = #{hiddClas},</if>
            <if test="ifFound != null">if_found = #{ifFound},</if>
            <if test="proPart != null">pro_part = #{proPart},</if>
            <if test="partLong != null">part_long = #{partLong},</if>
            <if test="partLat != null">part_lat = #{partLat},</if>
            <if test="otlcolQiffFnvu != null">otlcol_qiff_fnvu = #{otlcolQiffFnvu},</if>
            <if test="inspRecGuid != null">insp_rec_guid = #{inspRecGuid},</if>
            <if test="seCheckItemGuid != null">se_check_item_guid = #{seCheckItemGuid},</if>
            <if test="hiddStat != null">hidd_stat = #{hiddStat},</if>
            <if test="hiddMergGuid != null">hidd_merg_guid = #{hiddMergGuid},</if>
            <if test="recOrgGuid != null">rec_org_guid = #{recOrgGuid},</if>
            <if test="note != null">note = #{note},</if>
            <if test="collTime != null">coll_time = #{collTime},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null">rec_pers = #{recPers},</if>
            <if test="hiddsGuid != null">hidds_guid = #{hiddsGuid},</if>
            <if test="occuNum != null">occu_num = #{occuNum},</if>
            <if test="sinsScheGuid != null">sins_sche_guid = #{sinsScheGuid},</if>
            <if test="groupGuid != null">group_guid = #{groupGuid},</if>
            <if test="temp != null">temp = #{temp},</if>
            <if test="toDate != null">to_date = #{toDate},</if>
            <if test="dictGuid != null">dict_guid = #{dictGuid},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteObjHiddByGuid" parameterType="String">
        delete from obj_hidd where guid = #{guid}
    </delete>
    <delete id="deleteObjHiddByGuids" parameterType="String">
        delete from obj_hidd where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>

    <select id="selectObjHiddListByName" parameterType="com.goldenwater.slaj.hidd.domain.ObjHidd" resultMap="ObjHiddResult">
        <include refid="selectObjHiddVo"/>
        <where>
            <if test="hiddName != null and hiddName != ''">AND hidd_name like '%' || #{hiddName} || '%'</if>
            <if test="hiddGrad != null and hiddGrad != ''">AND hidd_grad = #{hiddGrad}</if>
            <if test="hiddStat != null and hiddStat != ''">AND hidd_stat = #{hiddStat}</if>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid = #{orgGuid}</if>
        </where>
        order by coll_time desc
    </select>

    <select id="selectNextDepHiddList" parameterType="com.goldenwater.slaj.hidd.domain.ObjHidd" resultMap="ObjHiddResult">
        <include refid="selectObjHiddVo"/>
        <where>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid in (select guid from att_org_base where parent_org_guid = #{orgGuid})</if>
            <if test="hiddName != null and hiddName != ''">AND hidd_name like '%' || #{hiddName} || '%'</if>
            <if test="hiddGrad != null and hiddGrad != ''">AND hidd_grad = #{hiddGrad}</if>
            <if test="hiddStat != null and hiddStat != ''">AND hidd_stat = #{hiddStat}</if>
        </where>
        order by coll_time desc
    </select>

    <insert id="insertNextHidd" parameterType="com.goldenwater.slaj.hidd.domain.ObjHidd">
        insert into obj_hidd (guid, hidd_name, eng_guid, tend_guid, se_guid, org_guid, hidd_sour, hidd_grad, hidd_clas, if_found, pro_part, part_long, part_lat, otlcol_qiff_fnvu, insp_rec_guid, se_check_item_guid, hidd_stat, hidd_merg_guid, rec_org_guid, note, coll_time, upd_time, rec_pers, hidds_guid, occu_num, sins_sche_guid, group_guid, temp, to_date, dict_guid)
        values (#{guid}, #{hiddName}, #{engGuid}, #{tendGuid}, #{seGuid}, #{orgGuid}, #{hiddSour}, #{hiddGrad}, #{hiddClas}, #{ifFound}, #{proPart}, #{partLong}, #{partLat}, #{otlcolQiffFnvu}, #{inspRecGuid}, #{seCheckItemGuid}, #{hiddStat}, #{hiddMergGuid}, #{recOrgGuid}, #{note}, #{collTime}, #{updTime}, #{recPers}, #{hiddsGuid}, #{occuNum}, #{sinsScheGuid}, #{groupGuid}, #{temp}, #{toDate}, #{dictGuid})
    </insert>
</mapper>
