<?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.cslg.report.mapper.AssoTaskPersonelMapper">
    <select id="getPatentNumber" resultType="java.lang.String">
        select PATENT_NO  from ASSO_TASK_PERSONEL
       where PERSON_ID=#{personelId} and STATE=#{state} and TASK_ID=#{taskId}
    </select>
    <select id="getSplitMessage" resultType="cn.cslg.report.entity.asso.AssoTaskPatentSplit">
        select b.* from ASSO_TASK_PATENT a left join ASSO_TASK_PATENT_SPLIT as b on a.id=b.TASK_PATENT_ID
        where a.PATENT_NO=#{patentNo} and a.TASK_ID=#{taskId} limit 1;
    </select>
    <select id="getPatents" resultType="java.lang.String">
        select distinct  PATENT_NO  from ASSO_TASK_PATENT
      <where>
            <foreach collection="params" index="index" item="item" open="(" separator=" or " close=")">
          PERSON_ID=#{item.personId} and STATE=#{item.state} and TASK_ID in
                <foreach collection="item.taskIds" index="index" item="item1" open="(" separator="," close=")">
                    #{item1}
                </foreach>
            </foreach>
      </where>
    </select>
</mapper>