1234567891011121314151617181920212223242526272829 |
- <?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.yc.education.mapper.ProductMapper" >
- <resultMap id="BaseResultMap" type="com.yc.education.model.Product" >
- <!--
- WARNING - @mbggenerated
- -->
- <id column="id" property="id" jdbcType="BIGINT" />
- <id column="sort" property="sort" jdbcType="INTEGER" />
- <result column="homepage" property="homepage" jdbcType="INTEGER" />
- <result column="photo" property="photo" jdbcType="VARCHAR" />
- <result column="banner" property="banner" jdbcType="VARCHAR" />
- <result column="name" property="name" jdbcType="VARCHAR" />
- <result column="title" property="title" jdbcType="VARCHAR" />
- <result column="details" property="details" jdbcType="VARCHAR" />
- <result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
- <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
- </resultMap>
- <!-- 后台产品列表根据产品名称查询 -->
- <select id="listProduct" resultMap="BaseResultMap">
- select * from product
- <where>
- <if test="name != null and name != '' ">
- and name like concat('%',#{name},'%')
- </if>
- </where>
- order by sort desc
- </select>
- </mapper>
|