123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?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.kmall.admin.dao.TopicCategoryDao">
- <resultMap type="com.kmall.admin.entity.TopicCategoryEntity" id="topicCategoryMap">
- <result property="id" column="id"/>
- <result property="title" column="title"/>
- <result property="picUrl" column="pic_url"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.TopicCategoryEntity">
- select
- `id`,
- `title`,
- `pic_url`
- from mall_topic_category
- where id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.TopicCategoryEntity">
- select
- `id`,
- `title`,
- `pic_url`
- from mall_topic_category
- WHERE 1=1
- <if test="title != null and title.trim() != ''">
- AND title LIKE concat('%',#{title},'%')
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
- <select id="queryTotal" resultType="int">
- select count(*) from mall_topic_category
- WHERE 1=1
- <if test="title != null and title.trim() != ''">
- AND title LIKE concat('%',#{title},'%')
- </if>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.TopicCategoryEntity" useGeneratedKeys="true" keyProperty="id">
- insert into mall_topic_category(
- `title`,
- `pic_url`)
- values(
- #{title},
- #{picUrl})
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.TopicCategoryEntity">
- update mall_topic_category
- <set>
- <if test="title != null">`title` = #{title},</if>
- <if test="picUrl != null">`pic_url` = #{picUrl}</if>
- </set>
- where id = #{id}
- </update>
- <delete id="delete">
- delete from mall_topic_category where id = #{value}
- </delete>
- <delete id="deleteBatch">
- delete from mall_topic_category where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|