update cms-dao

This commit is contained in:
shuzheng 2016-10-05 19:34:10 +08:00
parent 8c6cf75b13
commit bbade2d285
39 changed files with 4066 additions and 365 deletions

View File

@ -1,4 +1,4 @@
package com.zheng.interceptor;
package com.zheng.cms.interceptor;
import java.sql.Connection;
import java.util.Map;
@ -15,7 +15,7 @@ import org.apache.ibatis.plugin.Signature;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.SystemMetaObject;
import com.zheng.util.Paginator;
import com.zheng.cms.util.Paginator;
/**

View File

@ -1,7 +1,7 @@
package com.zheng.mapper;
package com.zheng.cms.mapper;
import com.zheng.model.Book;
import com.zheng.model.BookExample;
import com.zheng.cms.model.Book;
import com.zheng.cms.model.BookExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

View File

@ -0,0 +1,358 @@
<?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.zheng.cms.mapper.BookMapper">
<resultMap id="BaseResultMap" type="com.zheng.cms.model.Book">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="userid" jdbcType="INTEGER" property="userid" />
<result column="name" jdbcType="VARCHAR" property="name" />
</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, userid, name
</sql>
<select id="selectByExample" parameterType="com.zheng.cms.model.BookExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from book
<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.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from book
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from book
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.model.BookExample">
delete from book
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.model.Book">
insert into book (id, userid, name
)
values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.model.Book">
insert into book
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userid != null">
userid,
</if>
<if test="name != null">
name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="userid != null">
#{userid,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.cms.model.BookExample" resultType="java.lang.Integer">
select count(*) from book
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update book
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.userid != null">
userid = #{record.userid,jdbcType=INTEGER},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update book
set id = #{record.id,jdbcType=INTEGER},
userid = #{record.userid,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.model.Book">
update book
<set>
<if test="userid != null">
userid = #{userid,jdbcType=INTEGER},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.model.Book">
update book
set userid = #{userid,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<resultMap id="BaseResultMap" type="com.zheng.cms.model.Book">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="userid" jdbcType="INTEGER" property="userid" />
<result column="name" jdbcType="VARCHAR" property="name" />
</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, userid, name
</sql>
<select id="selectByExample" parameterType="com.zheng.cms.model.BookExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from book
<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.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from book
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from book
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.model.BookExample">
delete from book
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.model.Book">
insert into book (id, userid, name
)
values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.model.Book">
insert into book
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userid != null">
userid,
</if>
<if test="name != null">
name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="userid != null">
#{userid,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.cms.model.BookExample" resultType="java.lang.Integer">
select count(*) from book
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update book
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.userid != null">
userid = #{record.userid,jdbcType=INTEGER},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update book
set id = #{record.id,jdbcType=INTEGER},
userid = #{record.userid,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.model.Book">
update book
<set>
<if test="userid != null">
userid = #{userid,jdbcType=INTEGER},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.model.Book">
update book
set userid = #{userid,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@ -0,0 +1,30 @@
package com.zheng.cms.mapper;
import com.zheng.cms.model.CmsArticleCategory;
import com.zheng.cms.model.CmsArticleCategoryExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CmsArticleCategoryMapper {
int countByExample(CmsArticleCategoryExample example);
int deleteByExample(CmsArticleCategoryExample example);
int deleteByPrimaryKey(Integer articleCategoryId);
int insert(CmsArticleCategory record);
int insertSelective(CmsArticleCategory record);
List<CmsArticleCategory> selectByExample(CmsArticleCategoryExample example);
CmsArticleCategory selectByPrimaryKey(Integer articleCategoryId);
int updateByExampleSelective(@Param("record") CmsArticleCategory record, @Param("example") CmsArticleCategoryExample example);
int updateByExample(@Param("record") CmsArticleCategory record, @Param("example") CmsArticleCategoryExample example);
int updateByPrimaryKeySelective(CmsArticleCategory record);
int updateByPrimaryKey(CmsArticleCategory record);
}

View File

@ -0,0 +1,181 @@
<?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.zheng.cms.mapper.CmsArticleCategoryMapper" >
<resultMap id="BaseResultMap" type="com.zheng.cms.model.CmsArticleCategory" >
<id column="article_category_id" property="articleCategoryId" jdbcType="INTEGER" />
<result column="article_id" property="articleId" jdbcType="INTEGER" />
<result column="category_id" property="categoryId" jdbcType="INTEGER" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
article_category_id, article_id, category_id
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.cms.model.CmsArticleCategoryExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from cms_article_category
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from cms_article_category
where article_category_id = #{articleCategoryId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from cms_article_category
where article_category_id = #{articleCategoryId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.model.CmsArticleCategoryExample" >
delete from cms_article_category
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.model.CmsArticleCategory" >
insert into cms_article_category (article_category_id, article_id, category_id
)
values (#{articleCategoryId,jdbcType=INTEGER}, #{articleId,jdbcType=INTEGER}, #{categoryId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.model.CmsArticleCategory" >
insert into cms_article_category
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="articleCategoryId != null" >
article_category_id,
</if>
<if test="articleId != null" >
article_id,
</if>
<if test="categoryId != null" >
category_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="articleCategoryId != null" >
#{articleCategoryId,jdbcType=INTEGER},
</if>
<if test="articleId != null" >
#{articleId,jdbcType=INTEGER},
</if>
<if test="categoryId != null" >
#{categoryId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.cms.model.CmsArticleCategoryExample" resultType="java.lang.Integer" >
select count(*) from cms_article_category
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update cms_article_category
<set >
<if test="record.articleCategoryId != null" >
article_category_id = #{record.articleCategoryId,jdbcType=INTEGER},
</if>
<if test="record.articleId != null" >
article_id = #{record.articleId,jdbcType=INTEGER},
</if>
<if test="record.categoryId != null" >
category_id = #{record.categoryId,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update cms_article_category
set article_category_id = #{record.articleCategoryId,jdbcType=INTEGER},
article_id = #{record.articleId,jdbcType=INTEGER},
category_id = #{record.categoryId,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.model.CmsArticleCategory" >
update cms_article_category
<set >
<if test="articleId != null" >
article_id = #{articleId,jdbcType=INTEGER},
</if>
<if test="categoryId != null" >
category_id = #{categoryId,jdbcType=INTEGER},
</if>
</set>
where article_category_id = #{articleCategoryId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.model.CmsArticleCategory" >
update cms_article_category
set article_id = #{articleId,jdbcType=INTEGER},
category_id = #{categoryId,jdbcType=INTEGER}
where article_category_id = #{articleCategoryId,jdbcType=INTEGER}
</update>
</mapper>

View File

@ -0,0 +1,24 @@
package com.zheng.cms.mapper;
import com.zheng.cms.model.CmsArticle;
import com.zheng.cms.model.CmsArticleExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CmsArticleMapper {
int countByExample(CmsArticleExample example);
int deleteByExample(CmsArticleExample example);
int deleteByPrimaryKey(Integer articleId);
int insert(CmsArticle record);
int insertSelective(CmsArticle record);
List<CmsArticle> selectByExample(CmsArticleExample example);
int updateByExampleSelective(@Param("record") CmsArticle record, @Param("example") CmsArticleExample example);
int updateByExample(@Param("record") CmsArticle record, @Param("example") CmsArticleExample example);
}

View File

@ -0,0 +1,133 @@
<?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.zheng.cms.mapper.CmsArticleMapper" >
<resultMap id="BaseResultMap" type="com.zheng.cms.model.CmsArticle" >
<id column="article_id" property="articleId" jdbcType="INTEGER" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
article_id
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.cms.model.CmsArticleExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from cms_article
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from cms_article
where article_id = #{articleId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.model.CmsArticleExample" >
delete from cms_article
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.model.CmsArticle" >
insert into cms_article (article_id)
values (#{articleId,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.model.CmsArticle" >
insert into cms_article
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="articleId != null" >
article_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="articleId != null" >
#{articleId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.cms.model.CmsArticleExample" resultType="java.lang.Integer" >
select count(*) from cms_article
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update cms_article
<set >
<if test="record.articleId != null" >
article_id = #{record.articleId,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update cms_article
set article_id = #{record.articleId,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>

View File

@ -0,0 +1,30 @@
package com.zheng.cms.mapper;
import com.zheng.cms.model.CmsArticleTag;
import com.zheng.cms.model.CmsArticleTagExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CmsArticleTagMapper {
int countByExample(CmsArticleTagExample example);
int deleteByExample(CmsArticleTagExample example);
int deleteByPrimaryKey(Integer articleTagId);
int insert(CmsArticleTag record);
int insertSelective(CmsArticleTag record);
List<CmsArticleTag> selectByExample(CmsArticleTagExample example);
CmsArticleTag selectByPrimaryKey(Integer articleTagId);
int updateByExampleSelective(@Param("record") CmsArticleTag record, @Param("example") CmsArticleTagExample example);
int updateByExample(@Param("record") CmsArticleTag record, @Param("example") CmsArticleTagExample example);
int updateByPrimaryKeySelective(CmsArticleTag record);
int updateByPrimaryKey(CmsArticleTag record);
}

View File

@ -1,10 +1,10 @@
<?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.zheng.mapper.BookMapper" >
<resultMap id="BaseResultMap" type="com.zheng.model.Book" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="userid" property="userid" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<mapper namespace="com.zheng.cms.mapper.CmsArticleTagMapper" >
<resultMap id="BaseResultMap" type="com.zheng.cms.model.CmsArticleTag" >
<id column="article_tag_id" property="articleTagId" jdbcType="INTEGER" />
<result column="article_id" property="articleId" jdbcType="INTEGER" />
<result column="tag_id" property="tagId" jdbcType="INTEGER" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
@ -65,15 +65,15 @@
</where>
</sql>
<sql id="Base_Column_List" >
id, userid, name
article_tag_id, article_id, tag_id
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.model.BookExample" >
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.cms.model.CmsArticleTagExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from book
from cms_article_tag
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
@ -84,67 +84,67 @@
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from book
where id = #{id,jdbcType=INTEGER}
from cms_article_tag
where article_tag_id = #{articleTagId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from book
where id = #{id,jdbcType=INTEGER}
delete from cms_article_tag
where article_tag_id = #{articleTagId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.model.BookExample" >
delete from book
<delete id="deleteByExample" parameterType="com.zheng.cms.model.CmsArticleTagExample" >
delete from cms_article_tag
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.model.Book" >
insert into book (id, userid, name
<insert id="insert" parameterType="com.zheng.cms.model.CmsArticleTag" >
insert into cms_article_tag (article_tag_id, article_id, tag_id
)
values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}
values (#{articleTagId,jdbcType=INTEGER}, #{articleId,jdbcType=INTEGER}, #{tagId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.zheng.model.Book" >
insert into book
<insert id="insertSelective" parameterType="com.zheng.cms.model.CmsArticleTag" >
insert into cms_article_tag
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
<if test="articleTagId != null" >
article_tag_id,
</if>
<if test="userid != null" >
userid,
<if test="articleId != null" >
article_id,
</if>
<if test="name != null" >
name,
<if test="tagId != null" >
tag_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
<if test="articleTagId != null" >
#{articleTagId,jdbcType=INTEGER},
</if>
<if test="userid != null" >
#{userid,jdbcType=INTEGER},
<if test="articleId != null" >
#{articleId,jdbcType=INTEGER},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
<if test="tagId != null" >
#{tagId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.model.BookExample" resultType="java.lang.Integer" >
select count(*) from book
<select id="countByExample" parameterType="com.zheng.cms.model.CmsArticleTagExample" resultType="java.lang.Integer" >
select count(*) from cms_article_tag
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update book
update cms_article_tag
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=INTEGER},
<if test="record.articleTagId != null" >
article_tag_id = #{record.articleTagId,jdbcType=INTEGER},
</if>
<if test="record.userid != null" >
userid = #{record.userid,jdbcType=INTEGER},
<if test="record.articleId != null" >
article_id = #{record.articleId,jdbcType=INTEGER},
</if>
<if test="record.name != null" >
name = #{record.name,jdbcType=VARCHAR},
<if test="record.tagId != null" >
tag_id = #{record.tagId,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null" >
@ -152,30 +152,30 @@
</if>
</update>
<update id="updateByExample" parameterType="map" >
update book
set id = #{record.id,jdbcType=INTEGER},
userid = #{record.userid,jdbcType=INTEGER},
name = #{record.name,jdbcType=VARCHAR}
update cms_article_tag
set article_tag_id = #{record.articleTagId,jdbcType=INTEGER},
article_id = #{record.articleId,jdbcType=INTEGER},
tag_id = #{record.tagId,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.model.Book" >
update book
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.model.CmsArticleTag" >
update cms_article_tag
<set >
<if test="userid != null" >
userid = #{userid,jdbcType=INTEGER},
<if test="articleId != null" >
article_id = #{articleId,jdbcType=INTEGER},
</if>
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
<if test="tagId != null" >
tag_id = #{tagId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
where article_tag_id = #{articleTagId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.model.Book" >
update book
set userid = #{userid,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.model.CmsArticleTag" >
update cms_article_tag
set article_id = #{articleId,jdbcType=INTEGER},
tag_id = #{tagId,jdbcType=INTEGER}
where article_tag_id = #{articleTagId,jdbcType=INTEGER}
</update>
</mapper>

View File

@ -0,0 +1,24 @@
package com.zheng.cms.mapper;
import com.zheng.cms.model.CmsCategory;
import com.zheng.cms.model.CmsCategoryExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CmsCategoryMapper {
int countByExample(CmsCategoryExample example);
int deleteByExample(CmsCategoryExample example);
int deleteByPrimaryKey(Integer categoryId);
int insert(CmsCategory record);
int insertSelective(CmsCategory record);
List<CmsCategory> selectByExample(CmsCategoryExample example);
int updateByExampleSelective(@Param("record") CmsCategory record, @Param("example") CmsCategoryExample example);
int updateByExample(@Param("record") CmsCategory record, @Param("example") CmsCategoryExample example);
}

View File

@ -0,0 +1,133 @@
<?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.zheng.cms.mapper.CmsCategoryMapper" >
<resultMap id="BaseResultMap" type="com.zheng.cms.model.CmsCategory" >
<id column="category_id" property="categoryId" jdbcType="INTEGER" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
category_id
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.cms.model.CmsCategoryExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from cms_category
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from cms_category
where category_id = #{categoryId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.model.CmsCategoryExample" >
delete from cms_category
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.model.CmsCategory" >
insert into cms_category (category_id)
values (#{categoryId,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.model.CmsCategory" >
insert into cms_category
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="categoryId != null" >
category_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="categoryId != null" >
#{categoryId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.cms.model.CmsCategoryExample" resultType="java.lang.Integer" >
select count(*) from cms_category
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update cms_category
<set >
<if test="record.categoryId != null" >
category_id = #{record.categoryId,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update cms_category
set category_id = #{record.categoryId,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>

View File

@ -0,0 +1,30 @@
package com.zheng.cms.mapper;
import com.zheng.cms.model.CmsCategoryTag;
import com.zheng.cms.model.CmsCategoryTagExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CmsCategoryTagMapper {
int countByExample(CmsCategoryTagExample example);
int deleteByExample(CmsCategoryTagExample example);
int deleteByPrimaryKey(Integer categoryTagId);
int insert(CmsCategoryTag record);
int insertSelective(CmsCategoryTag record);
List<CmsCategoryTag> selectByExample(CmsCategoryTagExample example);
CmsCategoryTag selectByPrimaryKey(Integer categoryTagId);
int updateByExampleSelective(@Param("record") CmsCategoryTag record, @Param("example") CmsCategoryTagExample example);
int updateByExample(@Param("record") CmsCategoryTag record, @Param("example") CmsCategoryTagExample example);
int updateByPrimaryKeySelective(CmsCategoryTag record);
int updateByPrimaryKey(CmsCategoryTag record);
}

View File

@ -0,0 +1,181 @@
<?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.zheng.cms.mapper.CmsCategoryTagMapper" >
<resultMap id="BaseResultMap" type="com.zheng.cms.model.CmsCategoryTag" >
<id column="category_tag_id" property="categoryTagId" jdbcType="INTEGER" />
<result column="category_id" property="categoryId" jdbcType="INTEGER" />
<result column="tag_id" property="tagId" jdbcType="INTEGER" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
category_tag_id, category_id, tag_id
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.cms.model.CmsCategoryTagExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from cms_category_tag
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from cms_category_tag
where category_tag_id = #{categoryTagId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from cms_category_tag
where category_tag_id = #{categoryTagId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.model.CmsCategoryTagExample" >
delete from cms_category_tag
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.model.CmsCategoryTag" >
insert into cms_category_tag (category_tag_id, category_id, tag_id
)
values (#{categoryTagId,jdbcType=INTEGER}, #{categoryId,jdbcType=INTEGER}, #{tagId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.model.CmsCategoryTag" >
insert into cms_category_tag
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="categoryTagId != null" >
category_tag_id,
</if>
<if test="categoryId != null" >
category_id,
</if>
<if test="tagId != null" >
tag_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="categoryTagId != null" >
#{categoryTagId,jdbcType=INTEGER},
</if>
<if test="categoryId != null" >
#{categoryId,jdbcType=INTEGER},
</if>
<if test="tagId != null" >
#{tagId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.cms.model.CmsCategoryTagExample" resultType="java.lang.Integer" >
select count(*) from cms_category_tag
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update cms_category_tag
<set >
<if test="record.categoryTagId != null" >
category_tag_id = #{record.categoryTagId,jdbcType=INTEGER},
</if>
<if test="record.categoryId != null" >
category_id = #{record.categoryId,jdbcType=INTEGER},
</if>
<if test="record.tagId != null" >
tag_id = #{record.tagId,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update cms_category_tag
set category_tag_id = #{record.categoryTagId,jdbcType=INTEGER},
category_id = #{record.categoryId,jdbcType=INTEGER},
tag_id = #{record.tagId,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.model.CmsCategoryTag" >
update cms_category_tag
<set >
<if test="categoryId != null" >
category_id = #{categoryId,jdbcType=INTEGER},
</if>
<if test="tagId != null" >
tag_id = #{tagId,jdbcType=INTEGER},
</if>
</set>
where category_tag_id = #{categoryTagId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.model.CmsCategoryTag" >
update cms_category_tag
set category_id = #{categoryId,jdbcType=INTEGER},
tag_id = #{tagId,jdbcType=INTEGER}
where category_tag_id = #{categoryTagId,jdbcType=INTEGER}
</update>
</mapper>

View File

@ -0,0 +1,24 @@
package com.zheng.cms.mapper;
import com.zheng.cms.model.CmsTag;
import com.zheng.cms.model.CmsTagExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CmsTagMapper {
int countByExample(CmsTagExample example);
int deleteByExample(CmsTagExample example);
int deleteByPrimaryKey(Integer tagId);
int insert(CmsTag record);
int insertSelective(CmsTag record);
List<CmsTag> selectByExample(CmsTagExample example);
int updateByExampleSelective(@Param("record") CmsTag record, @Param("example") CmsTagExample example);
int updateByExample(@Param("record") CmsTag record, @Param("example") CmsTagExample example);
}

View File

@ -0,0 +1,133 @@
<?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.zheng.cms.mapper.CmsTagMapper" >
<resultMap id="BaseResultMap" type="com.zheng.cms.model.CmsTag" >
<id column="tag_id" property="tagId" jdbcType="INTEGER" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
tag_id
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.cms.model.CmsTagExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from cms_tag
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from cms_tag
where tag_id = #{tagId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.model.CmsTagExample" >
delete from cms_tag
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.model.CmsTag" >
insert into cms_tag (tag_id)
values (#{tagId,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.model.CmsTag" >
insert into cms_tag
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="tagId != null" >
tag_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="tagId != null" >
#{tagId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.cms.model.CmsTagExample" resultType="java.lang.Integer" >
select count(*) from cms_tag
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update cms_tag
<set >
<if test="record.tagId != null" >
tag_id = #{record.tagId,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update cms_tag
set tag_id = #{record.tagId,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>

View File

@ -1,7 +1,7 @@
package com.zheng.mapper;
package com.zheng.cms.mapper;
import com.zheng.model.User;
import com.zheng.model.UserExample;
import com.zheng.cms.model.User;
import com.zheng.cms.model.UserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

View File

@ -0,0 +1,570 @@
<?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.zheng.cms.mapper.UserMapper">
<resultMap id="BaseResultMap" type="com.zheng.cms.model.User">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="nickname" jdbcType="VARCHAR" property="nickname" />
<result column="sex" jdbcType="INTEGER" property="sex" />
<result column="ctime" jdbcType="BIGINT" property="ctime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.zheng.cms.model.User">
<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, username, password, nickname, sex, ctime
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.zheng.cms.model.UserExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.zheng.cms.model.UserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from user
<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.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from user
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from user
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.model.UserExample">
delete from user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.model.User">
insert into user (id, username, password,
nickname, sex, ctime,
content)
values (#{id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{nickname,jdbcType=VARCHAR}, #{sex,jdbcType=INTEGER}, #{ctime,jdbcType=BIGINT},
#{content,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.model.User">
insert into user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="username != null">
username,
</if>
<if test="password != null">
password,
</if>
<if test="nickname != null">
nickname,
</if>
<if test="sex != null">
sex,
</if>
<if test="ctime != null">
ctime,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
#{nickname,jdbcType=VARCHAR},
</if>
<if test="sex != null">
#{sex,jdbcType=INTEGER},
</if>
<if test="ctime != null">
#{ctime,jdbcType=BIGINT},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.cms.model.UserExample" resultType="java.lang.Integer">
select count(*) from user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update user
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.password != null">
password = #{record.password,jdbcType=VARCHAR},
</if>
<if test="record.nickname != null">
nickname = #{record.nickname,jdbcType=VARCHAR},
</if>
<if test="record.sex != null">
sex = #{record.sex,jdbcType=INTEGER},
</if>
<if test="record.ctime != null">
ctime = #{record.ctime,jdbcType=BIGINT},
</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 user
set id = #{record.id,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
password = #{record.password,jdbcType=VARCHAR},
nickname = #{record.nickname,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT},
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update user
set id = #{record.id,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
password = #{record.password,jdbcType=VARCHAR},
nickname = #{record.nickname,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.model.User">
update user
<set>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=INTEGER},
</if>
<if test="ctime != null">
ctime = #{ctime,jdbcType=BIGINT},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zheng.cms.model.User">
update user
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
sex = #{sex,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT},
content = #{content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.model.User">
update user
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
sex = #{sex,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT}
where id = #{id,jdbcType=INTEGER}
</update>
<resultMap id="BaseResultMap" type="com.zheng.cms.model.User">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="nickname" jdbcType="VARCHAR" property="nickname" />
<result column="sex" jdbcType="INTEGER" property="sex" />
<result column="ctime" jdbcType="BIGINT" property="ctime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.zheng.cms.model.User">
<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, username, password, nickname, sex, ctime
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.zheng.cms.model.UserExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.zheng.cms.model.UserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from user
<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.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from user
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from user
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.model.UserExample">
delete from user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.model.User">
insert into user (id, username, password,
nickname, sex, ctime,
content)
values (#{id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{nickname,jdbcType=VARCHAR}, #{sex,jdbcType=INTEGER}, #{ctime,jdbcType=BIGINT},
#{content,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.model.User">
insert into user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="username != null">
username,
</if>
<if test="password != null">
password,
</if>
<if test="nickname != null">
nickname,
</if>
<if test="sex != null">
sex,
</if>
<if test="ctime != null">
ctime,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
#{nickname,jdbcType=VARCHAR},
</if>
<if test="sex != null">
#{sex,jdbcType=INTEGER},
</if>
<if test="ctime != null">
#{ctime,jdbcType=BIGINT},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.cms.model.UserExample" resultType="java.lang.Integer">
select count(*) from user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update user
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.password != null">
password = #{record.password,jdbcType=VARCHAR},
</if>
<if test="record.nickname != null">
nickname = #{record.nickname,jdbcType=VARCHAR},
</if>
<if test="record.sex != null">
sex = #{record.sex,jdbcType=INTEGER},
</if>
<if test="record.ctime != null">
ctime = #{record.ctime,jdbcType=BIGINT},
</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 user
set id = #{record.id,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
password = #{record.password,jdbcType=VARCHAR},
nickname = #{record.nickname,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT},
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update user
set id = #{record.id,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
password = #{record.password,jdbcType=VARCHAR},
nickname = #{record.nickname,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.model.User">
update user
<set>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=INTEGER},
</if>
<if test="ctime != null">
ctime = #{ctime,jdbcType=BIGINT},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zheng.cms.model.User">
update user
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
sex = #{sex,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT},
content = #{content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.model.User">
update user
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
sex = #{sex,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@ -1,4 +1,4 @@
package com.zheng.model;
package com.zheng.cms.model;
public class Book {
private Integer id;

View File

@ -1,4 +1,4 @@
package com.zheng.model;
package com.zheng.cms.model;
import java.util.ArrayList;
import java.util.List;

View File

@ -0,0 +1,13 @@
package com.zheng.cms.model;
public class CmsArticle {
private Integer articleId;
public Integer getArticleId() {
return articleId;
}
public void setArticleId(Integer articleId) {
this.articleId = articleId;
}
}

View File

@ -0,0 +1,33 @@
package com.zheng.cms.model;
public class CmsArticleCategory {
private Integer articleCategoryId;
private Integer articleId;
private Integer categoryId;
public Integer getArticleCategoryId() {
return articleCategoryId;
}
public void setArticleCategoryId(Integer articleCategoryId) {
this.articleCategoryId = articleCategoryId;
}
public Integer getArticleId() {
return articleId;
}
public void setArticleId(Integer articleId) {
this.articleId = articleId;
}
public Integer getCategoryId() {
return categoryId;
}
public void setCategoryId(Integer categoryId) {
this.categoryId = categoryId;
}
}

View File

@ -0,0 +1,380 @@
package com.zheng.cms.model;
import java.util.ArrayList;
import java.util.List;
public class CmsArticleCategoryExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public CmsArticleCategoryExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andArticleCategoryIdIsNull() {
addCriterion("article_category_id is null");
return (Criteria) this;
}
public Criteria andArticleCategoryIdIsNotNull() {
addCriterion("article_category_id is not null");
return (Criteria) this;
}
public Criteria andArticleCategoryIdEqualTo(Integer value) {
addCriterion("article_category_id =", value, "articleCategoryId");
return (Criteria) this;
}
public Criteria andArticleCategoryIdNotEqualTo(Integer value) {
addCriterion("article_category_id <>", value, "articleCategoryId");
return (Criteria) this;
}
public Criteria andArticleCategoryIdGreaterThan(Integer value) {
addCriterion("article_category_id >", value, "articleCategoryId");
return (Criteria) this;
}
public Criteria andArticleCategoryIdGreaterThanOrEqualTo(Integer value) {
addCriterion("article_category_id >=", value, "articleCategoryId");
return (Criteria) this;
}
public Criteria andArticleCategoryIdLessThan(Integer value) {
addCriterion("article_category_id <", value, "articleCategoryId");
return (Criteria) this;
}
public Criteria andArticleCategoryIdLessThanOrEqualTo(Integer value) {
addCriterion("article_category_id <=", value, "articleCategoryId");
return (Criteria) this;
}
public Criteria andArticleCategoryIdIn(List<Integer> values) {
addCriterion("article_category_id in", values, "articleCategoryId");
return (Criteria) this;
}
public Criteria andArticleCategoryIdNotIn(List<Integer> values) {
addCriterion("article_category_id not in", values, "articleCategoryId");
return (Criteria) this;
}
public Criteria andArticleCategoryIdBetween(Integer value1, Integer value2) {
addCriterion("article_category_id between", value1, value2, "articleCategoryId");
return (Criteria) this;
}
public Criteria andArticleCategoryIdNotBetween(Integer value1, Integer value2) {
addCriterion("article_category_id not between", value1, value2, "articleCategoryId");
return (Criteria) this;
}
public Criteria andArticleIdIsNull() {
addCriterion("article_id is null");
return (Criteria) this;
}
public Criteria andArticleIdIsNotNull() {
addCriterion("article_id is not null");
return (Criteria) this;
}
public Criteria andArticleIdEqualTo(Integer value) {
addCriterion("article_id =", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdNotEqualTo(Integer value) {
addCriterion("article_id <>", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdGreaterThan(Integer value) {
addCriterion("article_id >", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdGreaterThanOrEqualTo(Integer value) {
addCriterion("article_id >=", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdLessThan(Integer value) {
addCriterion("article_id <", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdLessThanOrEqualTo(Integer value) {
addCriterion("article_id <=", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdIn(List<Integer> values) {
addCriterion("article_id in", values, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdNotIn(List<Integer> values) {
addCriterion("article_id not in", values, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdBetween(Integer value1, Integer value2) {
addCriterion("article_id between", value1, value2, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdNotBetween(Integer value1, Integer value2) {
addCriterion("article_id not between", value1, value2, "articleId");
return (Criteria) this;
}
public Criteria andCategoryIdIsNull() {
addCriterion("category_id is null");
return (Criteria) this;
}
public Criteria andCategoryIdIsNotNull() {
addCriterion("category_id is not null");
return (Criteria) this;
}
public Criteria andCategoryIdEqualTo(Integer value) {
addCriterion("category_id =", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotEqualTo(Integer value) {
addCriterion("category_id <>", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdGreaterThan(Integer value) {
addCriterion("category_id >", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdGreaterThanOrEqualTo(Integer value) {
addCriterion("category_id >=", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdLessThan(Integer value) {
addCriterion("category_id <", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdLessThanOrEqualTo(Integer value) {
addCriterion("category_id <=", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdIn(List<Integer> values) {
addCriterion("category_id in", values, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotIn(List<Integer> values) {
addCriterion("category_id not in", values, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdBetween(Integer value1, Integer value2) {
addCriterion("category_id between", value1, value2, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotBetween(Integer value1, Integer value2) {
addCriterion("category_id not between", value1, value2, "categoryId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,260 @@
package com.zheng.cms.model;
import java.util.ArrayList;
import java.util.List;
public class CmsArticleExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public CmsArticleExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andArticleIdIsNull() {
addCriterion("article_id is null");
return (Criteria) this;
}
public Criteria andArticleIdIsNotNull() {
addCriterion("article_id is not null");
return (Criteria) this;
}
public Criteria andArticleIdEqualTo(Integer value) {
addCriterion("article_id =", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdNotEqualTo(Integer value) {
addCriterion("article_id <>", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdGreaterThan(Integer value) {
addCriterion("article_id >", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdGreaterThanOrEqualTo(Integer value) {
addCriterion("article_id >=", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdLessThan(Integer value) {
addCriterion("article_id <", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdLessThanOrEqualTo(Integer value) {
addCriterion("article_id <=", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdIn(List<Integer> values) {
addCriterion("article_id in", values, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdNotIn(List<Integer> values) {
addCriterion("article_id not in", values, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdBetween(Integer value1, Integer value2) {
addCriterion("article_id between", value1, value2, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdNotBetween(Integer value1, Integer value2) {
addCriterion("article_id not between", value1, value2, "articleId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,33 @@
package com.zheng.cms.model;
public class CmsArticleTag {
private Integer articleTagId;
private Integer articleId;
private Integer tagId;
public Integer getArticleTagId() {
return articleTagId;
}
public void setArticleTagId(Integer articleTagId) {
this.articleTagId = articleTagId;
}
public Integer getArticleId() {
return articleId;
}
public void setArticleId(Integer articleId) {
this.articleId = articleId;
}
public Integer getTagId() {
return tagId;
}
public void setTagId(Integer tagId) {
this.tagId = tagId;
}
}

View File

@ -0,0 +1,380 @@
package com.zheng.cms.model;
import java.util.ArrayList;
import java.util.List;
public class CmsArticleTagExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public CmsArticleTagExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andArticleTagIdIsNull() {
addCriterion("article_tag_id is null");
return (Criteria) this;
}
public Criteria andArticleTagIdIsNotNull() {
addCriterion("article_tag_id is not null");
return (Criteria) this;
}
public Criteria andArticleTagIdEqualTo(Integer value) {
addCriterion("article_tag_id =", value, "articleTagId");
return (Criteria) this;
}
public Criteria andArticleTagIdNotEqualTo(Integer value) {
addCriterion("article_tag_id <>", value, "articleTagId");
return (Criteria) this;
}
public Criteria andArticleTagIdGreaterThan(Integer value) {
addCriterion("article_tag_id >", value, "articleTagId");
return (Criteria) this;
}
public Criteria andArticleTagIdGreaterThanOrEqualTo(Integer value) {
addCriterion("article_tag_id >=", value, "articleTagId");
return (Criteria) this;
}
public Criteria andArticleTagIdLessThan(Integer value) {
addCriterion("article_tag_id <", value, "articleTagId");
return (Criteria) this;
}
public Criteria andArticleTagIdLessThanOrEqualTo(Integer value) {
addCriterion("article_tag_id <=", value, "articleTagId");
return (Criteria) this;
}
public Criteria andArticleTagIdIn(List<Integer> values) {
addCriterion("article_tag_id in", values, "articleTagId");
return (Criteria) this;
}
public Criteria andArticleTagIdNotIn(List<Integer> values) {
addCriterion("article_tag_id not in", values, "articleTagId");
return (Criteria) this;
}
public Criteria andArticleTagIdBetween(Integer value1, Integer value2) {
addCriterion("article_tag_id between", value1, value2, "articleTagId");
return (Criteria) this;
}
public Criteria andArticleTagIdNotBetween(Integer value1, Integer value2) {
addCriterion("article_tag_id not between", value1, value2, "articleTagId");
return (Criteria) this;
}
public Criteria andArticleIdIsNull() {
addCriterion("article_id is null");
return (Criteria) this;
}
public Criteria andArticleIdIsNotNull() {
addCriterion("article_id is not null");
return (Criteria) this;
}
public Criteria andArticleIdEqualTo(Integer value) {
addCriterion("article_id =", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdNotEqualTo(Integer value) {
addCriterion("article_id <>", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdGreaterThan(Integer value) {
addCriterion("article_id >", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdGreaterThanOrEqualTo(Integer value) {
addCriterion("article_id >=", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdLessThan(Integer value) {
addCriterion("article_id <", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdLessThanOrEqualTo(Integer value) {
addCriterion("article_id <=", value, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdIn(List<Integer> values) {
addCriterion("article_id in", values, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdNotIn(List<Integer> values) {
addCriterion("article_id not in", values, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdBetween(Integer value1, Integer value2) {
addCriterion("article_id between", value1, value2, "articleId");
return (Criteria) this;
}
public Criteria andArticleIdNotBetween(Integer value1, Integer value2) {
addCriterion("article_id not between", value1, value2, "articleId");
return (Criteria) this;
}
public Criteria andTagIdIsNull() {
addCriterion("tag_id is null");
return (Criteria) this;
}
public Criteria andTagIdIsNotNull() {
addCriterion("tag_id is not null");
return (Criteria) this;
}
public Criteria andTagIdEqualTo(Integer value) {
addCriterion("tag_id =", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdNotEqualTo(Integer value) {
addCriterion("tag_id <>", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdGreaterThan(Integer value) {
addCriterion("tag_id >", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdGreaterThanOrEqualTo(Integer value) {
addCriterion("tag_id >=", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdLessThan(Integer value) {
addCriterion("tag_id <", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdLessThanOrEqualTo(Integer value) {
addCriterion("tag_id <=", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdIn(List<Integer> values) {
addCriterion("tag_id in", values, "tagId");
return (Criteria) this;
}
public Criteria andTagIdNotIn(List<Integer> values) {
addCriterion("tag_id not in", values, "tagId");
return (Criteria) this;
}
public Criteria andTagIdBetween(Integer value1, Integer value2) {
addCriterion("tag_id between", value1, value2, "tagId");
return (Criteria) this;
}
public Criteria andTagIdNotBetween(Integer value1, Integer value2) {
addCriterion("tag_id not between", value1, value2, "tagId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,13 @@
package com.zheng.cms.model;
public class CmsCategory {
private Integer categoryId;
public Integer getCategoryId() {
return categoryId;
}
public void setCategoryId(Integer categoryId) {
this.categoryId = categoryId;
}
}

View File

@ -0,0 +1,260 @@
package com.zheng.cms.model;
import java.util.ArrayList;
import java.util.List;
public class CmsCategoryExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public CmsCategoryExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andCategoryIdIsNull() {
addCriterion("category_id is null");
return (Criteria) this;
}
public Criteria andCategoryIdIsNotNull() {
addCriterion("category_id is not null");
return (Criteria) this;
}
public Criteria andCategoryIdEqualTo(Integer value) {
addCriterion("category_id =", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotEqualTo(Integer value) {
addCriterion("category_id <>", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdGreaterThan(Integer value) {
addCriterion("category_id >", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdGreaterThanOrEqualTo(Integer value) {
addCriterion("category_id >=", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdLessThan(Integer value) {
addCriterion("category_id <", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdLessThanOrEqualTo(Integer value) {
addCriterion("category_id <=", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdIn(List<Integer> values) {
addCriterion("category_id in", values, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotIn(List<Integer> values) {
addCriterion("category_id not in", values, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdBetween(Integer value1, Integer value2) {
addCriterion("category_id between", value1, value2, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotBetween(Integer value1, Integer value2) {
addCriterion("category_id not between", value1, value2, "categoryId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,33 @@
package com.zheng.cms.model;
public class CmsCategoryTag {
private Integer categoryTagId;
private Integer categoryId;
private Integer tagId;
public Integer getCategoryTagId() {
return categoryTagId;
}
public void setCategoryTagId(Integer categoryTagId) {
this.categoryTagId = categoryTagId;
}
public Integer getCategoryId() {
return categoryId;
}
public void setCategoryId(Integer categoryId) {
this.categoryId = categoryId;
}
public Integer getTagId() {
return tagId;
}
public void setTagId(Integer tagId) {
this.tagId = tagId;
}
}

View File

@ -0,0 +1,380 @@
package com.zheng.cms.model;
import java.util.ArrayList;
import java.util.List;
public class CmsCategoryTagExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public CmsCategoryTagExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andCategoryTagIdIsNull() {
addCriterion("category_tag_id is null");
return (Criteria) this;
}
public Criteria andCategoryTagIdIsNotNull() {
addCriterion("category_tag_id is not null");
return (Criteria) this;
}
public Criteria andCategoryTagIdEqualTo(Integer value) {
addCriterion("category_tag_id =", value, "categoryTagId");
return (Criteria) this;
}
public Criteria andCategoryTagIdNotEqualTo(Integer value) {
addCriterion("category_tag_id <>", value, "categoryTagId");
return (Criteria) this;
}
public Criteria andCategoryTagIdGreaterThan(Integer value) {
addCriterion("category_tag_id >", value, "categoryTagId");
return (Criteria) this;
}
public Criteria andCategoryTagIdGreaterThanOrEqualTo(Integer value) {
addCriterion("category_tag_id >=", value, "categoryTagId");
return (Criteria) this;
}
public Criteria andCategoryTagIdLessThan(Integer value) {
addCriterion("category_tag_id <", value, "categoryTagId");
return (Criteria) this;
}
public Criteria andCategoryTagIdLessThanOrEqualTo(Integer value) {
addCriterion("category_tag_id <=", value, "categoryTagId");
return (Criteria) this;
}
public Criteria andCategoryTagIdIn(List<Integer> values) {
addCriterion("category_tag_id in", values, "categoryTagId");
return (Criteria) this;
}
public Criteria andCategoryTagIdNotIn(List<Integer> values) {
addCriterion("category_tag_id not in", values, "categoryTagId");
return (Criteria) this;
}
public Criteria andCategoryTagIdBetween(Integer value1, Integer value2) {
addCriterion("category_tag_id between", value1, value2, "categoryTagId");
return (Criteria) this;
}
public Criteria andCategoryTagIdNotBetween(Integer value1, Integer value2) {
addCriterion("category_tag_id not between", value1, value2, "categoryTagId");
return (Criteria) this;
}
public Criteria andCategoryIdIsNull() {
addCriterion("category_id is null");
return (Criteria) this;
}
public Criteria andCategoryIdIsNotNull() {
addCriterion("category_id is not null");
return (Criteria) this;
}
public Criteria andCategoryIdEqualTo(Integer value) {
addCriterion("category_id =", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotEqualTo(Integer value) {
addCriterion("category_id <>", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdGreaterThan(Integer value) {
addCriterion("category_id >", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdGreaterThanOrEqualTo(Integer value) {
addCriterion("category_id >=", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdLessThan(Integer value) {
addCriterion("category_id <", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdLessThanOrEqualTo(Integer value) {
addCriterion("category_id <=", value, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdIn(List<Integer> values) {
addCriterion("category_id in", values, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotIn(List<Integer> values) {
addCriterion("category_id not in", values, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdBetween(Integer value1, Integer value2) {
addCriterion("category_id between", value1, value2, "categoryId");
return (Criteria) this;
}
public Criteria andCategoryIdNotBetween(Integer value1, Integer value2) {
addCriterion("category_id not between", value1, value2, "categoryId");
return (Criteria) this;
}
public Criteria andTagIdIsNull() {
addCriterion("tag_id is null");
return (Criteria) this;
}
public Criteria andTagIdIsNotNull() {
addCriterion("tag_id is not null");
return (Criteria) this;
}
public Criteria andTagIdEqualTo(Integer value) {
addCriterion("tag_id =", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdNotEqualTo(Integer value) {
addCriterion("tag_id <>", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdGreaterThan(Integer value) {
addCriterion("tag_id >", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdGreaterThanOrEqualTo(Integer value) {
addCriterion("tag_id >=", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdLessThan(Integer value) {
addCriterion("tag_id <", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdLessThanOrEqualTo(Integer value) {
addCriterion("tag_id <=", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdIn(List<Integer> values) {
addCriterion("tag_id in", values, "tagId");
return (Criteria) this;
}
public Criteria andTagIdNotIn(List<Integer> values) {
addCriterion("tag_id not in", values, "tagId");
return (Criteria) this;
}
public Criteria andTagIdBetween(Integer value1, Integer value2) {
addCriterion("tag_id between", value1, value2, "tagId");
return (Criteria) this;
}
public Criteria andTagIdNotBetween(Integer value1, Integer value2) {
addCriterion("tag_id not between", value1, value2, "tagId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -0,0 +1,13 @@
package com.zheng.cms.model;
public class CmsTag {
private Integer tagId;
public Integer getTagId() {
return tagId;
}
public void setTagId(Integer tagId) {
this.tagId = tagId;
}
}

View File

@ -0,0 +1,260 @@
package com.zheng.cms.model;
import java.util.ArrayList;
import java.util.List;
public class CmsTagExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public CmsTagExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andTagIdIsNull() {
addCriterion("tag_id is null");
return (Criteria) this;
}
public Criteria andTagIdIsNotNull() {
addCriterion("tag_id is not null");
return (Criteria) this;
}
public Criteria andTagIdEqualTo(Integer value) {
addCriterion("tag_id =", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdNotEqualTo(Integer value) {
addCriterion("tag_id <>", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdGreaterThan(Integer value) {
addCriterion("tag_id >", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdGreaterThanOrEqualTo(Integer value) {
addCriterion("tag_id >=", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdLessThan(Integer value) {
addCriterion("tag_id <", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdLessThanOrEqualTo(Integer value) {
addCriterion("tag_id <=", value, "tagId");
return (Criteria) this;
}
public Criteria andTagIdIn(List<Integer> values) {
addCriterion("tag_id in", values, "tagId");
return (Criteria) this;
}
public Criteria andTagIdNotIn(List<Integer> values) {
addCriterion("tag_id not in", values, "tagId");
return (Criteria) this;
}
public Criteria andTagIdBetween(Integer value1, Integer value2) {
addCriterion("tag_id between", value1, value2, "tagId");
return (Criteria) this;
}
public Criteria andTagIdNotBetween(Integer value1, Integer value2) {
addCriterion("tag_id not between", value1, value2, "tagId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -1,4 +1,4 @@
package com.zheng.model;
package com.zheng.cms.model;
public class User {
private Integer id;

View File

@ -1,4 +1,4 @@
package com.zheng.model;
package com.zheng.cms.model;
import java.util.ArrayList;
import java.util.List;

View File

@ -1,4 +1,4 @@
package com.zheng.util;
package com.zheng.cms.util;
/**

View File

@ -1,287 +0,0 @@
<?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.zheng.mapper.UserMapper" >
<resultMap id="BaseResultMap" type="com.zheng.model.User" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="username" property="username" jdbcType="VARCHAR" />
<result column="password" property="password" jdbcType="VARCHAR" />
<result column="nickname" property="nickname" jdbcType="VARCHAR" />
<result column="sex" property="sex" jdbcType="INTEGER" />
<result column="ctime" property="ctime" jdbcType="BIGINT" />
</resultMap>
<resultMap id="ResultMapWithBLOBs" type="com.zheng.model.User" extends="BaseResultMap" >
<result column="content" property="content" jdbcType="LONGVARCHAR" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
id, username, password, nickname, sex, ctime
</sql>
<sql id="Blob_Column_List" >
content
</sql>
<select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="com.zheng.model.UserExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from user
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.model.UserExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from user
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from user
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from user
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.model.UserExample" >
delete from user
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.model.User" >
insert into user (id, username, password,
nickname, sex, ctime,
content)
values (#{id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{nickname,jdbcType=VARCHAR}, #{sex,jdbcType=INTEGER}, #{ctime,jdbcType=BIGINT},
#{content,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.zheng.model.User" >
insert into user
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="username != null" >
username,
</if>
<if test="password != null" >
password,
</if>
<if test="nickname != null" >
nickname,
</if>
<if test="sex != null" >
sex,
</if>
<if test="ctime != null" >
ctime,
</if>
<if test="content != null" >
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="username != null" >
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null" >
#{password,jdbcType=VARCHAR},
</if>
<if test="nickname != null" >
#{nickname,jdbcType=VARCHAR},
</if>
<if test="sex != null" >
#{sex,jdbcType=INTEGER},
</if>
<if test="ctime != null" >
#{ctime,jdbcType=BIGINT},
</if>
<if test="content != null" >
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.model.UserExample" resultType="java.lang.Integer" >
select count(*) from user
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update user
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.username != null" >
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.password != null" >
password = #{record.password,jdbcType=VARCHAR},
</if>
<if test="record.nickname != null" >
nickname = #{record.nickname,jdbcType=VARCHAR},
</if>
<if test="record.sex != null" >
sex = #{record.sex,jdbcType=INTEGER},
</if>
<if test="record.ctime != null" >
ctime = #{record.ctime,jdbcType=BIGINT},
</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 user
set id = #{record.id,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
password = #{record.password,jdbcType=VARCHAR},
nickname = #{record.nickname,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT},
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update user
set id = #{record.id,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
password = #{record.password,jdbcType=VARCHAR},
nickname = #{record.nickname,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.model.User" >
update user
<set >
<if test="username != null" >
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null" >
password = #{password,jdbcType=VARCHAR},
</if>
<if test="nickname != null" >
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="sex != null" >
sex = #{sex,jdbcType=INTEGER},
</if>
<if test="ctime != null" >
ctime = #{ctime,jdbcType=BIGINT},
</if>
<if test="content != null" >
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zheng.model.User" >
update user
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
sex = #{sex,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT},
content = #{content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.model.User" >
update user
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
sex = #{sex,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@ -47,11 +47,11 @@
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:mybatis-config.xml" />
<property name="mapperLocations" value="classpath:com/zheng/mapper/*Mapper.xml" />
<property name="mapperLocations" value="classpath:com/zheng/cms/mapper/*Mapper.xml" />
</bean>
<!-- Mapper接口所在包名Spring会自动查找其下的Mapper -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.zheng.mapper" />
<property name="basePackage" value="com.zheng.cms.mapper" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>

View File

@ -22,16 +22,23 @@
password="${jdbc.password}" />
<!-- model生成 -->
<javaModelGenerator targetPackage="com.zheng.model" targetProject="src/main/java" />
<javaModelGenerator targetPackage="com.zheng.cms.model" targetProject="src/main/java" />
<!-- MapperXML生成 -->
<sqlMapGenerator targetPackage="com.zheng.mapper" targetProject="src/main/java" />
<sqlMapGenerator targetPackage="com.zheng.cms.mapper" targetProject="src/main/java" />
<!-- Mapper接口生成 -->
<javaClientGenerator targetPackage="com.zheng.mapper" targetProject="src/main/java" type="XMLMAPPER" />
<javaClientGenerator targetPackage="com.zheng.cms.mapper" targetProject="src/main/java" type="XMLMAPPER" />
<!-- 需要映射的表 -->
<table tableName="user" domainObjectName="User"></table>
<table tableName="book" domainObjectName="Book"></table>
<table tableName="cms_article" domainObjectName="CmsArticle"></table>
<table tableName="cms_category" domainObjectName="CmsCategory"></table>
<table tableName="cms_tag" domainObjectName="CmsTag"></table>
<table tableName="cms_article_category" domainObjectName="CmsArticleCategory"></table>
<table tableName="cms_article_tag" domainObjectName="CmsArticleTag"></table>
<table tableName="cms_category_tag" domainObjectName="CmsCategoryTag"></table>
</context>
</generatorConfiguration>

View File

@ -6,12 +6,12 @@
<!-- 该包下的model不用写包名会使用 model的首字母小写的非限定类名来作为它的别名若有注解@Alias("xxx"),则别名为注解值 -->
<typeAliases>
<package name="com.zheng.model" />
<package name="com.zheng.cms.model" />
</typeAliases>
<plugins>
<!-- 手写分页拦截器 -->
<plugin interceptor="com.zheng.interceptor.PageInterceptor">
<plugin interceptor="com.zheng.cms.interceptor.PageInterceptor">
<property name="pageSqlId" value=".*All$" />
</plugin>
<!-- 分页插件 -->

View File

@ -10,7 +10,7 @@ Target Server Type : MYSQL
Target Server Version : 50621
File Encoding : 65001
Date: 2016-10-05 00:30:08
Date: 2016-10-05 19:31:44
*/
SET FOREIGN_KEY_CHECKS=0;
@ -28,6 +28,78 @@ CREATE TABLE `book` (
CONSTRAINT `book_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COMMENT='用户书籍表';
-- ----------------------------
-- Table structure for cms_article
-- ----------------------------
DROP TABLE IF EXISTS `cms_article`;
CREATE TABLE `cms_article` (
`article_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`article_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文章表';
-- ----------------------------
-- Table structure for cms_article_category
-- ----------------------------
DROP TABLE IF EXISTS `cms_article_category`;
CREATE TABLE `cms_article_category` (
`article_category_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`article_id` int(10) unsigned NOT NULL,
`category_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`article_category_id`),
KEY `cms_article_category_article_id` (`article_id`),
KEY `cms_article_category_category_id` (`category_id`),
CONSTRAINT `cms_article_category_article_id` FOREIGN KEY (`article_id`) REFERENCES `cms_article` (`article_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `cms_article_category_category_id` FOREIGN KEY (`category_id`) REFERENCES `cms_category` (`category_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文章类目表';
-- ----------------------------
-- Table structure for cms_article_tag
-- ----------------------------
DROP TABLE IF EXISTS `cms_article_tag`;
CREATE TABLE `cms_article_tag` (
`article_tag_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`article_id` int(10) unsigned NOT NULL,
`tag_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`article_tag_id`),
KEY `cms_article_tag_article_id` (`article_id`),
KEY `cms_article_tag_tag_id` (`tag_id`),
CONSTRAINT `cms_article_tag_article_id` FOREIGN KEY (`article_id`) REFERENCES `cms_article` (`article_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `cms_article_tag_tag_id` FOREIGN KEY (`tag_id`) REFERENCES `cms_tag` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文章标签表';
-- ----------------------------
-- Table structure for cms_category
-- ----------------------------
DROP TABLE IF EXISTS `cms_category`;
CREATE TABLE `cms_category` (
`category_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '类目编号',
PRIMARY KEY (`category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='类目表';
-- ----------------------------
-- Table structure for cms_category_tag
-- ----------------------------
DROP TABLE IF EXISTS `cms_category_tag`;
CREATE TABLE `cms_category_tag` (
`category_tag_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`category_id` int(10) unsigned NOT NULL,
`tag_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`category_tag_id`),
KEY `cms_category_tag_category_id` (`category_id`),
KEY `cms_category_tag_tag_id` (`tag_id`),
CONSTRAINT `cms_category_tag_category_id` FOREIGN KEY (`category_id`) REFERENCES `cms_category` (`category_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `cms_category_tag_tag_id` FOREIGN KEY (`tag_id`) REFERENCES `cms_tag` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=' 分类标签表';
-- ----------------------------
-- Table structure for cms_tag
-- ----------------------------
DROP TABLE IF EXISTS `cms_tag`;
CREATE TABLE `cms_tag` (
`tag_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '标签编号',
PRIMARY KEY (`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='标签表';
-- ----------------------------
-- Table structure for user
-- ----------------------------
@ -41,4 +113,4 @@ CREATE TABLE `user` (
`ctime` bigint(20) DEFAULT NULL,
`content` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COMMENT='用户表';
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COMMENT='用户表';