<?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.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
        from test t
        <where>
            t.is_deleted = '0'
            <if test="name != null and name != ''">
                and t.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
            </if>
            order by create_time desc
        </where>
    </select>

</mapper>