| <?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.zy.crm.manager.mapper.CompanyTargetMapper"> | 
|   | 
|     <!-- 通用查询映射结果 --> | 
|     <resultMap id="BaseResultMap" type="com.zy.crm.manager.entity.CompanyTarget"> | 
|         <id column="id" property="id" /> | 
|         <result column="year" property="year" /> | 
|         <result column="target" property="target" /> | 
|         <result column="create_time" property="createTime" /> | 
|         <result column="user_id" property="userId" /> | 
|         <result column="update_time" property="updateTime" /> | 
|         <result column="update_user_id" property="updateUserId" /> | 
|         <result column="staff" property="staff" /> | 
|         <result column="complete" property="complete" /> | 
|   | 
|     </resultMap> | 
|   | 
|     <select id="selectCompanyByYear" resultMap="BaseResultMap"> | 
|         select top 1 * from man_company_target | 
|         where year = #{year} | 
|         and staff is null | 
|     </select> | 
|   | 
|     <select id="selectPersonByYear" resultMap="BaseResultMap"> | 
|         select top 1 * from man_company_target | 
|         where year = #{year} | 
|         and staff = #{staff} | 
|     </select> | 
|   | 
| </mapper> |