<?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.common.mapper.SdryPacsPrintExceptMapper">


    <insert id="saveExcept">
        INSERT INTO `docus_archivefile`.`sdry_pacs_print_except`(`id`, `inpatient_no`, `admiss_times`, `jzh`, `report_message_path`, `state`, `create_time`, `service_flag`)
        VALUES (#{except.id}, #{except.inpatientNo}, #{except.admissTimes}, #{except.jzh}, #{except.reportMessagePath}, 0, #{except.createTime}, #{except.serviceFlag})
    </insert>
    <update id="compensateSuccuss">
        update
            `docus_archivefile`.`sdry_pacs_print_except`
        set `state`=1
        where id=#{id}
    </update>
    <select id="getById" resultType="com.docus.server.common.entity.SdryPacsPrintExcept">
        select
            `id`,
               `inpatient_no`,
               `admiss_times`,
               `jzh`,
               `report_message_path`,
               `state`,
               `create_time`,
               `service_flag`
         from `docus_archivefile`.`sdry_pacs_print_except`
        where id=#{id}
    </select>
    <select id="getCompensateIds" resultType="java.lang.Long">
        select
            `id`
        from
             `docus_archivefile`.`sdry_pacs_print_except`
        where `state`=0 and  `create_time` > #{beginDateTime}
    </select>
</mapper>
