<?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.saye.hospitalgd.mapper.historyLog.HisBillLogMapper">

    <!--查询his记录下载情况-->
    <select id="findHisBillLogPageList" parameterType="HashMap" resultType="HashMap">
        select trade_date,quartz_id,quartz_name,is_ok,modify_time,his_wsdl_id from hisbill_getinfo
        <where>
            <if test="startTime!=null and startTime!=''">
                and trade_date &gt;=#{startTime}
            </if>
            <if test="endTime!=null and endTime!=''">
                and trade_date &lt;=#{endTime}
            </if>
            <if test="is_ok!=null and is_ok!=''">
                and is_ok=#{is_ok}
            </if>
            <if test="his_wsdl_id!=null and his_wsdl_id!=''">
                and his_wsdl_id=#{his_wsdl_id}
            </if>
        </where>
        order by trade_date desc
    </select>

    <insert id="insertHisbillGetinfo" parameterType="HashMap">
        insert into hisbill_getinfo(trade_date,quartz_id,quartz_name,is_ok,modify_time,his_wsdl_id)
        values (#{trade_date},#{quartz_id},#{quartz_name},#{is_ok},#{modify_time},#{his_wsdl_id})
        ON DUPLICATE KEY UPDATE
        quartz_id=values(quartz_id),
        quartz_name=values(quartz_name),
        is_ok=values(is_ok),
        modify_time=values(modify_time),
        his_wsdl_id=values(his_wsdl_id)
    </insert>

    <select id="findHisBillLogByParam" parameterType="HashMap" resultType="HashMap">
        select trade_date,quartz_id,quartz_name,is_ok,modify_time from hisbill_getinfo
        where  trade_date=#{trade_date}
          <if test="is_ok!=null and is_ok!=''">
              and is_ok=#{is_ok}
          </if>
    </select>

</mapper>