<?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.sqx.modules.appeal.dao.AppealDao">

    <select id="getAppealPage" resultType="com.sqx.modules.appeal.entity.Appeal">
        select * from appeal
        where 1=1
        <if test="userId!=null">
            and  user_id=#{userId}
        </if>
        <if test="appeal.process !=null">
            and process = #{appeal.process}
        </if>
        <if test="startTime!=null and startTime!=''and endTime!=null and endTime!='' ">
            and str_to_date(create_time, '%Y-%m-%d') between str_to_date(#{startTime}, '%Y-%m-%d') AND
            str_to_date(#{endTime}, '%Y-%m-%d')
        </if>
        order by create_time desc
    </select>
</mapper>