MessageMapper.xml 988 B

123456789101112131415161718192021222324
  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.yc.education.mapper.MessageMapper" >
  4. <resultMap id="BaseResultMap" type="com.yc.education.model.Message" >
  5. <!--
  6. WARNING - @mbggenerated
  7. -->
  8. <id column="id" property="id" jdbcType="BIGINT" />
  9. <result column="name" property="name" jdbcType="VARCHAR" />
  10. <result column="email" property="email" jdbcType="VARCHAR" />
  11. <result column="details" property="details" jdbcType="VARCHAR" />
  12. <result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
  13. </resultMap>
  14. <!-- 后台留言根据姓名模糊查询 -->
  15. <select id="listMessageCreatetime" resultMap="BaseResultMap">
  16. select * from message
  17. <where>
  18. <if test="name != null and name != '' ">
  19. and name like concat('%',#{name},'%')
  20. </if>
  21. </where>
  22. order by createtime desc
  23. </select>
  24. </mapper>