<?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.PreOrganMapper">
  <resultMap id="OrganResultMap" type="cn.com.countrygarden.bi.main.model.PreOrgan">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="is_delete" jdbcType="TINYINT" property="isDelete" />
    <result column="organ_code" jdbcType="VARCHAR" property="organCode" />
    <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" />
  </resultMap>

  <select fetchSize="1" id="findByUk" parameterType="String" resultMap="OrganResultMap">
    SELECT o.*
    FROM preOrgan o
    WHERE o.name = #{name} AND o.is_delete = 0
    LIMIT 1
  </select>
</mapper>