<?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="org.springblade.audit.mapper.AuditComplaintDetailMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="org.springblade.audit.entity.AuditComplaintDetail">
        <id column="id" property="id" />
        <result column="report_name" property="reportName" />
        <result column="category_code" property="categoryCode" />
        <result column="report_url" property="reportUrl" />
        <result column="create_user" property="createUser" />
        <result column="create_time" property="createTime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, report_name, category_code, report_url, create_user, create_time
    </sql>

    <select id="getPageByQuery" resultMap="BaseResultMap">
        SELECT
        *
        FROM
        audit_complaint_detail
        where 1=1
        <if test="query.reportName != null and query.reportName != ''">
            and report_name LIKE CONCAT('%',#{query.reportName},'%')
        </if>
        ORDER BY
        create_time DESC
    </select>
</mapper>
