<?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.ReconciliationLogMapper">

    <select id="findReconciliationLogPageList" parameterType="HashMap" resultType="HashMap">
        select trade_date,modify_time,create_time,manager_num,status,user_name,remark
        from reconciliation_info

        <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="status!=null and status!=''">
                and status=#{status}
            </if>
        </where>
        order by trade_date desc
    </select>

    <select id="findReconciliationLogByParam" parameterType="HashMap" resultType="HashMap">
        select trade_date,
               modify_time,
               create_time,
               manager_num,
               status,
               user_name,
               remark,
               quartz_id,
               quartz_name
        from reconciliation_info
        where trade_date = #{trade_date}
    </select>

    <insert id="insertReconciliationLog" parameterType="HashMap">
        insert into reconciliation_info(trade_date, modify_time, create_time, manager_num,
                                        status, user_name, quartz_id, quartz_name)
        values (#{trade_date}, #{modify_time}, #{create_time}, #{manager_num},
                #{status}, #{user_name}, #{quartz_id}, #{quartz_name})
        ON DUPLICATE KEY UPDATE modify_time=values(modify_time),
                                user_name=values(user_name),
                                status=values(status),
                                manager_num=values(manager_num)
    </insert>
</mapper>