| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <?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.kede.common.dao.PopularCitiesMapper">
- <resultMap id="BaseResultMap" type="com.kede.common.model.PopularCities">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="sort" jdbcType="INTEGER" property="sort" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="name" jdbcType="VARCHAR" property="name" />
- <result column="url" jdbcType="VARCHAR" property="url" />
- <result column="remarks" jdbcType="VARCHAR" property="remarks" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- </resultMap>
- <sql id="Base_Column_List">
- id, sort, `status`, `name`, url, remarks, create_time
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from popular_cities
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from popular_cities
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.kede.common.model.PopularCities" useGeneratedKeys="true">
- insert into popular_cities (sort, `status`, `name`,
- url, remarks, create_time
- )
- values (#{sort,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
- #{url,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
- )
- </insert>
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.kede.common.model.PopularCities" useGeneratedKeys="true">
- insert into popular_cities
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="sort != null">
- sort,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="name != null">
- `name`,
- </if>
- <if test="url != null">
- url,
- </if>
- <if test="remarks != null">
- remarks,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="sort != null">
- #{sort,jdbcType=INTEGER},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="name != null">
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="url != null">
- #{url,jdbcType=VARCHAR},
- </if>
- <if test="remarks != null">
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.kede.common.model.PopularCities">
- update popular_cities
- <set>
- <if test="sort != null">
- sort = #{sort,jdbcType=INTEGER},
- </if>
- <if test="status != null">
- `status` = #{status,jdbcType=INTEGER},
- </if>
- <if test="name != null">
- `name` = #{name,jdbcType=VARCHAR},
- </if>
- <if test="url != null">
- url = #{url,jdbcType=VARCHAR},
- </if>
- <if test="remarks != null">
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.kede.common.model.PopularCities">
- update popular_cities
- set sort = #{sort,jdbcType=INTEGER},
- `status` = #{status,jdbcType=INTEGER},
- `name` = #{name,jdbcType=VARCHAR},
- url = #{url,jdbcType=VARCHAR},
- remarks = #{remarks,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="popularCitiesList" resultType="com.kede.linksAndHot.bo.outPopularCitiesList">
- select id,sort,status,name,url,remarks, date_format(create_time,'%Y-%m-%d %H:%i:%S') createTimes
- from popular_cities where 1=1
- <if test="name !=null">
- and name like concat('%',#{name},'%')
- </if>
- <if test="status !=null">
- and status = #{status}
- </if>
- order by sort
- <if test="sortType ==0">
- desc
- </if>
- <if test="page_sql !=null">
- ${page_sql}
- </if>
- </select>
- <select id="popularCitiesCount" resultType="integer">
- select count(*)
- from popular_cities where 1=1
- <if test="name !=null">
- and name like concat('%',#{name},'%')
- </if>
- <if test="status !=null">
- and status = #{status}
- </if>
- </select>
- </mapper>
|