<?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="cn.com.countrygarden.bi.main.dao.PreCommMapper">
    <resultMap id="CommResultMap" type="cn.com.countrygarden.bi.main.model.PreComm">
        <!--
          WARNING - @mbg.generated
        -->
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="organ_id" jdbcType="INTEGER" property="organId"/>
        <result column="is_delete" jdbcType="TINYINT" property="isDelete"/>
        <result column="project_type" jdbcType="VARCHAR" property="projectType"/>
        <result column="corp_type" jdbcType="VARCHAR" property="corpType"/>
        <result column="project_nature" jdbcType="VARCHAR" property="projectNature"/>
        <result column="develop_subject" jdbcType="VARCHAR" property="developSubject"/>
        <result column="area" jdbcType="DECIMAL" property="area"/>
        <result column="nc_account" jdbcType="VARCHAR" property="ncAccount"/>
        <result column="nc_number" jdbcType="VARCHAR" property="ncNumber"/>
        <result column="contacts" jdbcType="VARCHAR" property="contacts"/>
        <result column="comm_code" jdbcType="INTEGER" property="commCode"/>
        <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate"/>
        <result column="create_by" jdbcType="VARCHAR" property="createBy"/>
        <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified"/>
        <result column="modified_by" jdbcType="VARCHAR" property="modifiedBy"/>
        <result column="proposal_organ_id" jdbcType="INTEGER" property="proposalOrganId"/>
    </resultMap>

    <select fetchSize="1" id="findByUk" parameterType="Map" resultMap="CommResultMap">
    SELECT t.*
    FROM preComm t
    WHERE t.name = #{name} AND t.organ_id = #{organId} AND t.is_delete = 0
    LIMIT 1
  </select>
</mapper>