123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447 |
- <?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.macro.mall.mapper.CmsSubjectMapper">
- <resultMap id="BaseResultMap" type="com.macro.mall.model.CmsSubject">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="category_id" jdbcType="BIGINT" property="categoryId" />
- <result column="title" jdbcType="VARCHAR" property="title" />
- <result column="pic" jdbcType="VARCHAR" property="pic" />
- <result column="product_count" jdbcType="INTEGER" property="productCount" />
- <result column="recommend_status" jdbcType="INTEGER" property="recommendStatus" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="collect_count" jdbcType="INTEGER" property="collectCount" />
- <result column="read_count" jdbcType="INTEGER" property="readCount" />
- <result column="comment_count" jdbcType="INTEGER" property="commentCount" />
- <result column="album_pics" jdbcType="VARCHAR" property="albumPics" />
- <result column="description" jdbcType="VARCHAR" property="description" />
- <result column="show_status" jdbcType="INTEGER" property="showStatus" />
- <result column="forward_count" jdbcType="INTEGER" property="forwardCount" />
- <result column="category_name" jdbcType="VARCHAR" property="categoryName" />
- </resultMap>
- <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.macro.mall.model.CmsSubject">
- <result column="content" jdbcType="LONGVARCHAR" property="content" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- id, category_id, title, pic, product_count, recommend_status, create_time, collect_count,
- read_count, comment_count, album_pics, description, show_status, forward_count, category_name
- </sql>
- <sql id="Blob_Column_List">
- content
- </sql>
- <select id="selectByExampleWithBLOBs" parameterType="com.macro.mall.model.CmsSubjectExample" resultMap="ResultMapWithBLOBs">
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from cms_subject
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByExample" parameterType="com.macro.mall.model.CmsSubjectExample" resultMap="BaseResultMap">
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from cms_subject
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
- select
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from cms_subject
- where id = #{id,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from cms_subject
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <delete id="deleteByExample" parameterType="com.macro.mall.model.CmsSubjectExample">
- delete from cms_subject
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.macro.mall.model.CmsSubject">
- <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into cms_subject (category_id, title, pic,
- product_count, recommend_status, create_time,
- collect_count, read_count, comment_count,
- album_pics, description, show_status,
- forward_count, category_name, content
- )
- values (#{categoryId,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR}, #{pic,jdbcType=VARCHAR},
- #{productCount,jdbcType=INTEGER}, #{recommendStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
- #{collectCount,jdbcType=INTEGER}, #{readCount,jdbcType=INTEGER}, #{commentCount,jdbcType=INTEGER},
- #{albumPics,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{showStatus,jdbcType=INTEGER},
- #{forwardCount,jdbcType=INTEGER}, #{categoryName,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.macro.mall.model.CmsSubject">
- <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into cms_subject
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="categoryId != null">
- category_id,
- </if>
- <if test="title != null">
- title,
- </if>
- <if test="pic != null">
- pic,
- </if>
- <if test="productCount != null">
- product_count,
- </if>
- <if test="recommendStatus != null">
- recommend_status,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="collectCount != null">
- collect_count,
- </if>
- <if test="readCount != null">
- read_count,
- </if>
- <if test="commentCount != null">
- comment_count,
- </if>
- <if test="albumPics != null">
- album_pics,
- </if>
- <if test="description != null">
- description,
- </if>
- <if test="showStatus != null">
- show_status,
- </if>
- <if test="forwardCount != null">
- forward_count,
- </if>
- <if test="categoryName != null">
- category_name,
- </if>
- <if test="content != null">
- content,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="categoryId != null">
- #{categoryId,jdbcType=BIGINT},
- </if>
- <if test="title != null">
- #{title,jdbcType=VARCHAR},
- </if>
- <if test="pic != null">
- #{pic,jdbcType=VARCHAR},
- </if>
- <if test="productCount != null">
- #{productCount,jdbcType=INTEGER},
- </if>
- <if test="recommendStatus != null">
- #{recommendStatus,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="collectCount != null">
- #{collectCount,jdbcType=INTEGER},
- </if>
- <if test="readCount != null">
- #{readCount,jdbcType=INTEGER},
- </if>
- <if test="commentCount != null">
- #{commentCount,jdbcType=INTEGER},
- </if>
- <if test="albumPics != null">
- #{albumPics,jdbcType=VARCHAR},
- </if>
- <if test="description != null">
- #{description,jdbcType=VARCHAR},
- </if>
- <if test="showStatus != null">
- #{showStatus,jdbcType=INTEGER},
- </if>
- <if test="forwardCount != null">
- #{forwardCount,jdbcType=INTEGER},
- </if>
- <if test="categoryName != null">
- #{categoryName,jdbcType=VARCHAR},
- </if>
- <if test="content != null">
- #{content,jdbcType=LONGVARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.macro.mall.model.CmsSubjectExample" resultType="java.lang.Long">
- select count(*) from cms_subject
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- update cms_subject
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=BIGINT},
- </if>
- <if test="record.categoryId != null">
- category_id = #{record.categoryId,jdbcType=BIGINT},
- </if>
- <if test="record.title != null">
- title = #{record.title,jdbcType=VARCHAR},
- </if>
- <if test="record.pic != null">
- pic = #{record.pic,jdbcType=VARCHAR},
- </if>
- <if test="record.productCount != null">
- product_count = #{record.productCount,jdbcType=INTEGER},
- </if>
- <if test="record.recommendStatus != null">
- recommend_status = #{record.recommendStatus,jdbcType=INTEGER},
- </if>
- <if test="record.createTime != null">
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.collectCount != null">
- collect_count = #{record.collectCount,jdbcType=INTEGER},
- </if>
- <if test="record.readCount != null">
- read_count = #{record.readCount,jdbcType=INTEGER},
- </if>
- <if test="record.commentCount != null">
- comment_count = #{record.commentCount,jdbcType=INTEGER},
- </if>
- <if test="record.albumPics != null">
- album_pics = #{record.albumPics,jdbcType=VARCHAR},
- </if>
- <if test="record.description != null">
- description = #{record.description,jdbcType=VARCHAR},
- </if>
- <if test="record.showStatus != null">
- show_status = #{record.showStatus,jdbcType=INTEGER},
- </if>
- <if test="record.forwardCount != null">
- forward_count = #{record.forwardCount,jdbcType=INTEGER},
- </if>
- <if test="record.categoryName != null">
- category_name = #{record.categoryName,jdbcType=VARCHAR},
- </if>
- <if test="record.content != null">
- content = #{record.content,jdbcType=LONGVARCHAR},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExampleWithBLOBs" parameterType="map">
- update cms_subject
- set id = #{record.id,jdbcType=BIGINT},
- category_id = #{record.categoryId,jdbcType=BIGINT},
- title = #{record.title,jdbcType=VARCHAR},
- pic = #{record.pic,jdbcType=VARCHAR},
- product_count = #{record.productCount,jdbcType=INTEGER},
- recommend_status = #{record.recommendStatus,jdbcType=INTEGER},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- collect_count = #{record.collectCount,jdbcType=INTEGER},
- read_count = #{record.readCount,jdbcType=INTEGER},
- comment_count = #{record.commentCount,jdbcType=INTEGER},
- album_pics = #{record.albumPics,jdbcType=VARCHAR},
- description = #{record.description,jdbcType=VARCHAR},
- show_status = #{record.showStatus,jdbcType=INTEGER},
- forward_count = #{record.forwardCount,jdbcType=INTEGER},
- category_name = #{record.categoryName,jdbcType=VARCHAR},
- content = #{record.content,jdbcType=LONGVARCHAR}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- update cms_subject
- set id = #{record.id,jdbcType=BIGINT},
- category_id = #{record.categoryId,jdbcType=BIGINT},
- title = #{record.title,jdbcType=VARCHAR},
- pic = #{record.pic,jdbcType=VARCHAR},
- product_count = #{record.productCount,jdbcType=INTEGER},
- recommend_status = #{record.recommendStatus,jdbcType=INTEGER},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- collect_count = #{record.collectCount,jdbcType=INTEGER},
- read_count = #{record.readCount,jdbcType=INTEGER},
- comment_count = #{record.commentCount,jdbcType=INTEGER},
- album_pics = #{record.albumPics,jdbcType=VARCHAR},
- description = #{record.description,jdbcType=VARCHAR},
- show_status = #{record.showStatus,jdbcType=INTEGER},
- forward_count = #{record.forwardCount,jdbcType=INTEGER},
- category_name = #{record.categoryName,jdbcType=VARCHAR}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsSubject">
- update cms_subject
- <set>
- <if test="categoryId != null">
- category_id = #{categoryId,jdbcType=BIGINT},
- </if>
- <if test="title != null">
- title = #{title,jdbcType=VARCHAR},
- </if>
- <if test="pic != null">
- pic = #{pic,jdbcType=VARCHAR},
- </if>
- <if test="productCount != null">
- product_count = #{productCount,jdbcType=INTEGER},
- </if>
- <if test="recommendStatus != null">
- recommend_status = #{recommendStatus,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="collectCount != null">
- collect_count = #{collectCount,jdbcType=INTEGER},
- </if>
- <if test="readCount != null">
- read_count = #{readCount,jdbcType=INTEGER},
- </if>
- <if test="commentCount != null">
- comment_count = #{commentCount,jdbcType=INTEGER},
- </if>
- <if test="albumPics != null">
- album_pics = #{albumPics,jdbcType=VARCHAR},
- </if>
- <if test="description != null">
- description = #{description,jdbcType=VARCHAR},
- </if>
- <if test="showStatus != null">
- show_status = #{showStatus,jdbcType=INTEGER},
- </if>
- <if test="forwardCount != null">
- forward_count = #{forwardCount,jdbcType=INTEGER},
- </if>
- <if test="categoryName != null">
- category_name = #{categoryName,jdbcType=VARCHAR},
- </if>
- <if test="content != null">
- content = #{content,jdbcType=LONGVARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.macro.mall.model.CmsSubject">
- update cms_subject
- set category_id = #{categoryId,jdbcType=BIGINT},
- title = #{title,jdbcType=VARCHAR},
- pic = #{pic,jdbcType=VARCHAR},
- product_count = #{productCount,jdbcType=INTEGER},
- recommend_status = #{recommendStatus,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- collect_count = #{collectCount,jdbcType=INTEGER},
- read_count = #{readCount,jdbcType=INTEGER},
- comment_count = #{commentCount,jdbcType=INTEGER},
- album_pics = #{albumPics,jdbcType=VARCHAR},
- description = #{description,jdbcType=VARCHAR},
- show_status = #{showStatus,jdbcType=INTEGER},
- forward_count = #{forwardCount,jdbcType=INTEGER},
- category_name = #{categoryName,jdbcType=VARCHAR},
- content = #{content,jdbcType=LONGVARCHAR}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsSubject">
- update cms_subject
- set category_id = #{categoryId,jdbcType=BIGINT},
- title = #{title,jdbcType=VARCHAR},
- pic = #{pic,jdbcType=VARCHAR},
- product_count = #{productCount,jdbcType=INTEGER},
- recommend_status = #{recommendStatus,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- collect_count = #{collectCount,jdbcType=INTEGER},
- read_count = #{readCount,jdbcType=INTEGER},
- comment_count = #{commentCount,jdbcType=INTEGER},
- album_pics = #{albumPics,jdbcType=VARCHAR},
- description = #{description,jdbcType=VARCHAR},
- show_status = #{showStatus,jdbcType=INTEGER},
- forward_count = #{forwardCount,jdbcType=INTEGER},
- category_name = #{categoryName,jdbcType=VARCHAR}
- where id = #{id,jdbcType=BIGINT}
- </update>
- </mapper>
|