12345678910111213141516171819202122232425262728293031 |
- <?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.NewsMapper" >
- <resultMap id="BaseResultMap" type="com.yc.education.model.News" >
- <!--
- WARNING - @mbggenerated
- -->
- <id column="id" property="id" jdbcType="BIGINT" />
- <id column="sort" property="sort" jdbcType="INTEGER" />
- <result column="title" property="title" jdbcType="VARCHAR" />
- <result column="sketch" property="sketch" jdbcType="VARCHAR" />
- <result column="covermap" property="covermap" jdbcType="VARCHAR" />
- <result column="releasetime" property="releasetime" jdbcType="DATE" />
- <result column="label" property="label" jdbcType="VARCHAR" />
- <result column="banner" property="banner" jdbcType="VARCHAR" />
- <result column="details" property="details" jdbcType="VARCHAR" />
- <result column="recommend" property="recommend" jdbcType="INTEGER" />
- <result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
- <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
- </resultMap>
- <!-- 后台新闻根据标题查询 -->
- <select id="listNewsTitle" resultMap="BaseResultMap">
- select * from news
- <where>
- <if test="title != null and title != '' ">
- and title like concat('%',#{title},'%')
- </if>
- </where>
- order by sort desc
- </select>
- </mapper>
|