<?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.hazard.mapper.ObjTendMapper">
    <resultMap type="com.goldenwater.slaj.hazard.domain.ObjTend" id="ObjTendResult">
        <result property="guid" column="guid"/>
        <result property="tendName" column="tend_name"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="engGuid" column="eng_guid"/>
        <result property="orgProjDeptGuid" column="org_proj_dept_guid"/>
        <result property="legPers" column="leg_pers"/>
        <result property="legTel" column="leg_tel"/>
        <result property="conAmout" column="con_amout"/>
        <result property="totalSpc" column="total_spc"/>
        <result property="consCont" column="cons_cont"/>
        <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="toDate" column="to_date"/>
        <result property="stat" column="stat"/>
    </resultMap>
    <sql id="selectObjTendVo">
        select guid, tend_name, org_guid, eng_guid, org_proj_dept_guid,
               leg_pers, leg_tel, con_amout, total_spc, cons_cont,
               note, coll_time, upd_time, rec_pers, to_date, stat
        from obj_tend
    </sql>
    <select id="selectObjTendList" parameterType="com.goldenwater.slaj.hazard.domain.ObjTend" resultMap="ObjTendResult">
        <include refid="selectObjTendVo"/>
        <where>
            <if test="guid != null and guid != ''">AND guid = #{guid}</if>
            <if test="engGuid != null and engGuid != ''">AND eng_guid = #{engGuid}</if>
            <if test="tendName != null and tendName != ''">AND tend_name like '%' || #{tendName} || '%'</if>
        </where>
    </select>
    <select id="selectObjTendByGuid" parameterType="String" resultMap="ObjTendResult">
        <include refid="selectObjTendVo"/>
        where guid = #{guid}
    </select>
</mapper>
