<?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.bank.autodata.mapper.AutoDataMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="autoDataResultMap" type="org.springblade.bank.autodata.entity.AutoData">
        <result column="id" property="id"/>
        <result column="table_id" property="tableId"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="params1" property="params1"/>
        <result column="params2" property="params2"/>
        <result column="params3" property="params3"/>
        <result column="params4" property="params4"/>
        <result column="params5" property="params5"/>
        <result column="params6" property="params6"/>
        <result column="params7" property="params7"/>
        <result column="params8" property="params8"/>
        <result column="params9" property="params9"/>
        <result column="params10" property="params10"/>
        <result column="params11" property="params11"/>
        <result column="params12" property="params12"/>
        <result column="params13" property="params13"/>
        <result column="params14" property="params14"/>
        <result column="params15" property="params15"/>
        <result column="params16" property="params16"/>
        <result column="params17" property="params17"/>
        <result column="params18" property="params18"/>
        <result column="params19" property="params19"/>
        <result column="params20" property="params20"/>
        <result column="params21" property="params21"/>
        <result column="params22" property="params22"/>
        <result column="params23" property="params23"/>
        <result column="params24" property="params24"/>
        <result column="params25" property="params25"/>
        <result column="params26" property="params26"/>
        <result column="params27" property="params27"/>
        <result column="params28" property="params28"/>
        <result column="params29" property="params29"/>
        <result column="params30" property="params30"/>
    </resultMap>


    <select id="selectAutoDataPage" resultMap="autoDataResultMap">
        select * from zh_auto_data where is_deleted = 0 and table_id = #{autoData.tableId}
        <if test="autoData!=null">
            <if test="autoData.params1!=null">
                AND params1 like '${autoData.params1}%'
            </if>
            <if test="autoData.params2!=null">
                AND params2 like '${autoData.params2}%'
            </if>
            <if test="autoData.params3!=null">
                AND params3 like '${autoData.params3}%'
            </if>
            <if test="autoData.params4!=null">
                AND params4 like '${autoData.params4}%'
            </if>
            <if test="autoData.params5!=null">
                AND params5 like '${autoData.params5}%'
            </if>
        </if>
    </select>

</mapper>
