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

    <select id="findCashDetailPageList" parameterType="HashMap" resultType="HashMap">
        select czyh, trade_date, jyje, sjlx
        from cash_record
        <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>
        </where>
        order by trade_date desc
    </select>

    <insert id="insertCash" parameterType="java.util.List">
        insert into cash_record(czyh, trade_date, jyje ,create_time)
        values
        <foreach collection="list" index="index" item="itm" separator=","  >
            (#{itm.czyh},#{itm.trade_date},#{itm.jyje},#{itm.create_time})
        </foreach>
    </insert>

    <update id="editCash" parameterType="HashMap">
        update cash_record set jyje=#{jyje} where czyh=#{czyh} and trade_date=#{trade_date}
    </update>

    <delete id="deleteCash" parameterType="HashMap">
        delete from cash_record where czyh=#{czyh} and trade_date=#{trade_date}
    </delete>

    <select id="findCashDetailList" parameterType="HashMap" resultType="HashMap">
        select czyh, trade_date, jyje, sjlx
        from cash_record where trade_date=#{trade_date}
    </select>
</mapper>