<?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.docus.server.reportmanager.mapper.CollectTaskMapper">
    <update id="cancel">
        UPDATE `docus_archivefile`.`af_collect_task`
        SET `state` = '4'
        WHERE `id` in
        <foreach collection="ids" item="id" separator="," open="(" close=")">
            #{id}
        </foreach>
    </update>

    <select id="getTasks" resultType="com.docus.server.reportmanager.entity.AfCollectTask">
        SELECT
        id,
        patient_id as patientId
        FROM
        `docus_archivefile`.`af_collect_task`
        <where>
            <if test="task.sysflag !=null and task.sysflag != ''">
                and sysflag=#{task.sysflag}
            </if>
            <if test="task.patientId !=null and task.patientId != ''">
                and patient_id=#{task.patientId}
            </if>
            <if test="task.C1 !=null and task.C1 != ''">
                and C1=#{task.C1}
            </if>
        </where>
    </select>
</mapper>
