<?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.template.mapper.AlumniCategoryMapper">
    <select id="queryCategoryPages" resultType="com.template.model.pojo.AlumniCategory">
        select ac.id,ac.name,ac.create_time,ac.update_time,au.name as create_user,ac.update_user,ac.deleted from alumni_category ac
        inner join alumni_user au on au.deleted = 0 and au.id = ac.create_user
        <if test="userName != null and userName != ''">
            and au.name like '%' #{userName} '%'
        </if>
        where ac.deleted = 0
        <if test="name != null and name != ''">
            and ac.name like '%' #{name} '%'
        </if>
        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
            and ac.create_time BETWEEN #{startTime} AND #{endTime}
        </if>
        order by ac.create_time desc
    </select>
</mapper>
