<?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="cn.ezhizao.project.business.archiveTicket.mapper.BizArchiveReceiveTicketMapper">

    <resultMap type="cn.ezhizao.project.business.archiveTicket.domain.BizArchiveReceiveTicket" id="BizArchiveReceiveTicketResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizArchiveReceiveTicket" resultMap="BizArchiveReceiveTicketResult">
        SELECT * FROM biz_archive_receive_ticket
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="year != null  and year != ''"> AND year = #{year}</if>
            <if test="month != null  and month != ''"> AND month = #{month}</if>
            <if test="fileUrl != null  and fileUrl != ''"> AND file_url = #{fileUrl}</if>
            <if test="fileName != null  and fileName != ''"> AND file_name like concat('%', #{fileName}, '%')</if>
        </trim>
    </select>

    <delete id="physicalDelete">
        DELETE FROM biz_archive_receive_ticket
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            <if test="id != null">
                id = #{id} AND
            </if>
       <!-- 删除条件为其他外键可以在这里加 -->
        </trim>
    </delete>
</mapper>
