TestMapper.xml 1.1 KB

123456789101112131415161718192021222324252627282930
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.css.simulation.resource.demo.mapper.TestMapper" >
  4. <resultMap id="TestVOMap" type="api.common.pojo.vo.demo.TestVO">
  5. <id column="ID" property="id" jdbcType="VARCHAR" />
  6. <result column="NAME" property="name" jdbcType="VARCHAR" />
  7. <result column="AGE" property="age" jdbcType="INTEGER" />
  8. </resultMap>
  9. <select id="getTestPageList" parameterType="api.common.pojo.param.demo.TestPageParam" resultMap="TestVOMap">
  10. select
  11. id,
  12. name,
  13. age,
  14. level
  15. from test t
  16. <where>
  17. t.is_deleted = '0'
  18. <if test="name != null and name != ''">
  19. and t.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  20. </if>
  21. <if test="createUserId != null and createUserId != ''">
  22. and t.create_user_id like CONCAT('%',#{createUserId,jdbcType=VARCHAR},'%')
  23. </if>
  24. order by t.create_time desc
  25. </where>
  26. </select>
  27. </mapper>