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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="org.springblade.audit.entity.AuditUploadUser">
        <id column="id" property="id" />
        <result column="upload_id" property="uploadId" />
        <result column="upload_user" property="uploadUser" />
        <result column="audit_id" property="auditId" />
        <result column="audit_user" property="auditUser" />
        <result column="report_type" property="reportType" />
        <result column="create_time" property="createTime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, upload_id, upload_user, audit_id, audit_user, report_type, create_time
    </sql>

    <select id="getPageByQuery" resultMap="BaseResultMap">
        SELECT
        *
        FROM
        audit_upload_user
        where 1=1
        <if test="query.auditName != null and query.auditName != ''">
            and audit_user LIKE CONCAT('%',#{query.auditName},'%')
        </if>
        <if test="query.reportType != null and query.reportType != ''">
            and report_type = #{query.reportType}
        </if>
        order by create_time desc
    </select>

</mapper>
