ProductMapper.xml 1.3 KB

1234567891011121314151617181920212223242526272829
  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.ProductMapper" >
  4. <resultMap id="BaseResultMap" type="com.yc.education.model.Product" >
  5. <!--
  6. WARNING - @mbggenerated
  7. -->
  8. <id column="id" property="id" jdbcType="BIGINT" />
  9. <id column="sort" property="sort" jdbcType="INTEGER" />
  10. <result column="homepage" property="homepage" jdbcType="INTEGER" />
  11. <result column="photo" property="photo" jdbcType="VARCHAR" />
  12. <result column="banner" property="banner" jdbcType="VARCHAR" />
  13. <result column="name" property="name" jdbcType="VARCHAR" />
  14. <result column="title" property="title" jdbcType="VARCHAR" />
  15. <result column="details" property="details" jdbcType="VARCHAR" />
  16. <result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
  17. <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
  18. </resultMap>
  19. <!-- 后台产品列表根据产品名称查询 -->
  20. <select id="listProduct" resultMap="BaseResultMap">
  21. select * from product
  22. <where>
  23. <if test="name != null and name != '' ">
  24. and name like concat('%',#{name},'%')
  25. </if>
  26. </where>
  27. order by sort desc
  28. </select>
  29. </mapper>