EmailMapper.xml 846 B

12345678910111213141516171819202122
  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.EmailMapper" >
  4. <resultMap id="BaseResultMap" type="com.yc.education.model.Email" >
  5. <!--
  6. WARNING - @mbggenerated
  7. -->
  8. <id column="id" property="id" jdbcType="BIGINT" />
  9. <result column="name" property="name" jdbcType="VARCHAR" />
  10. <result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
  11. </resultMap>
  12. <!-- 后台通讯订阅根据邮箱名称模糊查询 -->
  13. <select id="listEmail" resultMap="BaseResultMap">
  14. select * from email
  15. <where>
  16. <if test="name != null and name != '' ">
  17. and name like concat('%',#{name},'%')
  18. </if>
  19. </where>
  20. order by createtime desc
  21. </select>
  22. </mapper>