<?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.css.simulation.resource.server.infra.common.demo.mapper.TestMapper" >

    <resultMap id="TestVOMap" type="api.common.pojo.vo.demo.TestVO">
        <id column="ID" property="id" jdbcType="VARCHAR" />
        <result column="NAME" property="name" jdbcType="VARCHAR" />
        <result column="AGE" property="age" jdbcType="INTEGER" />
    </resultMap>

    <select id="getTestPageList" parameterType="api.common.pojo.param.demo.TestPageParam" resultMap="TestVOMap">
        select
          id,
          name,
          age,
          level
        from test t
        <where>
            t.is_deleted = '0'
            <if test="name != null and name != ''">
                and t.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
            </if>
            <if test="createUserId != null and createUserId != ''">
                and t.create_user_id like CONCAT('%',#{createUserId,jdbcType=VARCHAR},'%')
            </if>
            order by t.create_time desc
        </where>
    </select>

</mapper>
