生成新代码前,自动删除旧代码

This commit is contained in:
shuzheng 2017-01-11 14:59:20 +08:00
parent f1466e30f1
commit a4c253cba3
33 changed files with 3785 additions and 67 deletions

View File

@ -1,26 +1,9 @@
package com.zheng.cms.admin.controller;
import com.zheng.cms.dao.model.User;
import com.zheng.cms.dao.model.UserExample;
import com.zheng.cms.service.UserService;
import com.zheng.common.util.Paginator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* 用户管理

View File

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

View File

@ -0,0 +1,190 @@
<?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.dao.mapper.CmsBookMapper">
<resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsBook">
<id column="book_id" jdbcType="INTEGER" property="bookId" />
<result column="user_id" 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">
book_id, user_id, name
</sql>
<select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsBookExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_book
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cms_book
where book_id = #{bookId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from cms_book
where book_id = #{bookId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsBookExample">
delete from cms_book
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.dao.model.CmsBook">
insert into cms_book (book_id, user_id, name
)
values (#{bookId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsBook">
insert into cms_book
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="bookId != null">
book_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="name != null">
name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="bookId != null">
#{bookId,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.dao.model.CmsBookExample" resultType="java.lang.Long">
select count(*) from cms_book
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_book
<set>
<if test="record.bookId != null">
book_id = #{record.bookId,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{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 cms_book
set book_id = #{record.bookId,jdbcType=INTEGER},
user_id = #{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.dao.model.CmsBook">
update cms_book
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
</set>
where book_id = #{bookId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsBook">
update cms_book
set user_id = #{userId,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR}
where book_id = #{bookId,jdbcType=INTEGER}
</update>
<cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
</mapper>

View File

@ -0,0 +1,36 @@
package com.zheng.cms.dao.mapper;
import com.zheng.cms.dao.model.CmsPage;
import com.zheng.cms.dao.model.CmsPageExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CmsPageMapper {
long countByExample(CmsPageExample example);
int deleteByExample(CmsPageExample example);
int deleteByPrimaryKey(Integer pageId);
int insert(CmsPage record);
int insertSelective(CmsPage record);
List<CmsPage> selectByExampleWithBLOBs(CmsPageExample example);
List<CmsPage> selectByExample(CmsPageExample example);
CmsPage selectByPrimaryKey(Integer pageId);
int updateByExampleSelective(@Param("record") CmsPage record, @Param("example") CmsPageExample example);
int updateByExampleWithBLOBs(@Param("record") CmsPage record, @Param("example") CmsPageExample example);
int updateByExample(@Param("record") CmsPage record, @Param("example") CmsPageExample example);
int updateByPrimaryKeySelective(CmsPage record);
int updateByPrimaryKeyWithBLOBs(CmsPage record);
int updateByPrimaryKey(CmsPage record);
}

View File

@ -0,0 +1,313 @@
<?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.dao.mapper.CmsPageMapper">
<resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsPage">
<id column="page_id" jdbcType="INTEGER" property="pageId" />
<result column="pid" jdbcType="INTEGER" property="pid" />
<result column="alias" jdbcType="VARCHAR" property="alias" />
<result column="keywords" jdbcType="VARCHAR" property="keywords" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="ctime" jdbcType="BIGINT" property="ctime" />
<result column="orders" jdbcType="BIGINT" property="orders" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.zheng.cms.dao.model.CmsPage">
<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">
page_id, pid, alias, keywords, description, ctime, orders
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsPageExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from cms_page
<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.dao.model.CmsPageExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_page
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from cms_page
where page_id = #{pageId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from cms_page
where page_id = #{pageId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsPageExample">
delete from cms_page
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.dao.model.CmsPage">
insert into cms_page (page_id, pid, alias,
keywords, description, ctime,
orders, content)
values (#{pageId,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, #{alias,jdbcType=VARCHAR},
#{keywords,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT},
#{orders,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsPage">
insert into cms_page
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="pageId != null">
page_id,
</if>
<if test="pid != null">
pid,
</if>
<if test="alias != null">
alias,
</if>
<if test="keywords != null">
keywords,
</if>
<if test="description != null">
description,
</if>
<if test="ctime != null">
ctime,
</if>
<if test="orders != null">
orders,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pageId != null">
#{pageId,jdbcType=INTEGER},
</if>
<if test="pid != null">
#{pid,jdbcType=INTEGER},
</if>
<if test="alias != null">
#{alias,jdbcType=VARCHAR},
</if>
<if test="keywords != null">
#{keywords,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="ctime != null">
#{ctime,jdbcType=BIGINT},
</if>
<if test="orders != null">
#{orders,jdbcType=BIGINT},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsPageExample" resultType="java.lang.Long">
select count(*) from cms_page
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_page
<set>
<if test="record.pageId != null">
page_id = #{record.pageId,jdbcType=INTEGER},
</if>
<if test="record.pid != null">
pid = #{record.pid,jdbcType=INTEGER},
</if>
<if test="record.alias != null">
alias = #{record.alias,jdbcType=VARCHAR},
</if>
<if test="record.keywords != null">
keywords = #{record.keywords,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.ctime != null">
ctime = #{record.ctime,jdbcType=BIGINT},
</if>
<if test="record.orders != null">
orders = #{record.orders,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 cms_page
set page_id = #{record.pageId,jdbcType=INTEGER},
pid = #{record.pid,jdbcType=INTEGER},
alias = #{record.alias,jdbcType=VARCHAR},
keywords = #{record.keywords,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
ctime = #{record.ctime,jdbcType=BIGINT},
orders = #{record.orders,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 cms_page
set page_id = #{record.pageId,jdbcType=INTEGER},
pid = #{record.pid,jdbcType=INTEGER},
alias = #{record.alias,jdbcType=VARCHAR},
keywords = #{record.keywords,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
ctime = #{record.ctime,jdbcType=BIGINT},
orders = #{record.orders,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsPage">
update cms_page
<set>
<if test="pid != null">
pid = #{pid,jdbcType=INTEGER},
</if>
<if test="alias != null">
alias = #{alias,jdbcType=VARCHAR},
</if>
<if test="keywords != null">
keywords = #{keywords,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="ctime != null">
ctime = #{ctime,jdbcType=BIGINT},
</if>
<if test="orders != null">
orders = #{orders,jdbcType=BIGINT},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where page_id = #{pageId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsPage">
update cms_page
set pid = #{pid,jdbcType=INTEGER},
alias = #{alias,jdbcType=VARCHAR},
keywords = #{keywords,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
ctime = #{ctime,jdbcType=BIGINT},
orders = #{orders,jdbcType=BIGINT},
content = #{content,jdbcType=LONGVARCHAR}
where page_id = #{pageId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsPage">
update cms_page
set pid = #{pid,jdbcType=INTEGER},
alias = #{alias,jdbcType=VARCHAR},
keywords = #{keywords,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
ctime = #{ctime,jdbcType=BIGINT},
orders = #{orders,jdbcType=BIGINT}
where page_id = #{pageId,jdbcType=INTEGER}
</update>
<cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
</mapper>

View File

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

View File

@ -0,0 +1,190 @@
<?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.dao.mapper.CmsSettingMapper">
<resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsSetting">
<id column="setting_id" jdbcType="INTEGER" property="settingId" />
<result column="setting_key" jdbcType="VARCHAR" property="settingKey" />
<result column="setting_value" jdbcType="VARCHAR" property="settingValue" />
</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">
setting_id, setting_key, setting_value
</sql>
<select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsSettingExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_setting
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cms_setting
where setting_id = #{settingId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from cms_setting
where setting_id = #{settingId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsSettingExample">
delete from cms_setting
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.dao.model.CmsSetting">
insert into cms_setting (setting_id, setting_key, setting_value
)
values (#{settingId,jdbcType=INTEGER}, #{settingKey,jdbcType=VARCHAR}, #{settingValue,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsSetting">
insert into cms_setting
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="settingId != null">
setting_id,
</if>
<if test="settingKey != null">
setting_key,
</if>
<if test="settingValue != null">
setting_value,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="settingId != null">
#{settingId,jdbcType=INTEGER},
</if>
<if test="settingKey != null">
#{settingKey,jdbcType=VARCHAR},
</if>
<if test="settingValue != null">
#{settingValue,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsSettingExample" resultType="java.lang.Long">
select count(*) from cms_setting
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_setting
<set>
<if test="record.settingId != null">
setting_id = #{record.settingId,jdbcType=INTEGER},
</if>
<if test="record.settingKey != null">
setting_key = #{record.settingKey,jdbcType=VARCHAR},
</if>
<if test="record.settingValue != null">
setting_value = #{record.settingValue,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_setting
set setting_id = #{record.settingId,jdbcType=INTEGER},
setting_key = #{record.settingKey,jdbcType=VARCHAR},
setting_value = #{record.settingValue,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsSetting">
update cms_setting
<set>
<if test="settingKey != null">
setting_key = #{settingKey,jdbcType=VARCHAR},
</if>
<if test="settingValue != null">
setting_value = #{settingValue,jdbcType=VARCHAR},
</if>
</set>
where setting_id = #{settingId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsSetting">
update cms_setting
set setting_key = #{settingKey,jdbcType=VARCHAR},
setting_value = #{settingValue,jdbcType=VARCHAR}
where setting_id = #{settingId,jdbcType=INTEGER}
</update>
<cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
</mapper>

View File

@ -0,0 +1,36 @@
package com.zheng.cms.dao.mapper;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.CmsUserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CmsUserMapper {
long countByExample(CmsUserExample example);
int deleteByExample(CmsUserExample example);
int deleteByPrimaryKey(Integer userId);
int insert(CmsUser record);
int insertSelective(CmsUser record);
List<CmsUser> selectByExampleWithBLOBs(CmsUserExample example);
List<CmsUser> selectByExample(CmsUserExample example);
CmsUser selectByPrimaryKey(Integer userId);
int updateByExampleSelective(@Param("record") CmsUser record, @Param("example") CmsUserExample example);
int updateByExampleWithBLOBs(@Param("record") CmsUser record, @Param("example") CmsUserExample example);
int updateByExample(@Param("record") CmsUser record, @Param("example") CmsUserExample example);
int updateByPrimaryKeySelective(CmsUser record);
int updateByPrimaryKeyWithBLOBs(CmsUser record);
int updateByPrimaryKey(CmsUser record);
}

View File

@ -0,0 +1,296 @@
<?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.dao.mapper.CmsUserMapper">
<resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsUser">
<id column="user_id" jdbcType="INTEGER" property="userId" />
<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.dao.model.CmsUser">
<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">
user_id, username, password, nickname, sex, ctime
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsUserExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from cms_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.dao.model.CmsUserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from cms_user
where user_id = #{userId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from cms_user
where user_id = #{userId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsUserExample">
delete from cms_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.dao.model.CmsUser">
insert into cms_user (user_id, username, password,
nickname, sex, ctime,
content)
values (#{userId,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.dao.model.CmsUser">
insert into cms_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_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="userId != null">
#{userId,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.dao.model.CmsUserExample" resultType="java.lang.Long">
select count(*) from cms_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_user
<set>
<if test="record.userId != null">
user_id = #{record.userId,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 cms_user
set user_id = #{record.userId,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 cms_user
set user_id = #{record.userId,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.dao.model.CmsUser">
update cms_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 user_id = #{userId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsUser">
update cms_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 user_id = #{userId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsUser">
update cms_user
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
sex = #{sex,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT}
where user_id = #{userId,jdbcType=INTEGER}
</update>
<cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
</mapper>

View File

@ -0,0 +1,92 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
public class CmsBook implements Serializable {
/**
* 编号
*
* @mbg.generated
*/
private Integer bookId;
/**
* 用户编号
*
* @mbg.generated
*/
private Integer userId;
/**
* 书名
*
* @mbg.generated
*/
private String name;
private static final long serialVersionUID = 1L;
public Integer getBookId() {
return bookId;
}
public void setBookId(Integer bookId) {
this.bookId = bookId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", bookId=").append(bookId);
sb.append(", userId=").append(userId);
sb.append(", name=").append(name);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
CmsBook other = (CmsBook) that;
return (this.getBookId() == null ? other.getBookId() == null : this.getBookId().equals(other.getBookId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getBookId() == null) ? 0 : getBookId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
return result;
}
}

View File

@ -0,0 +1,413 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class CmsBookExample implements Serializable {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private static final long serialVersionUID = 1L;
private Integer limit;
private Integer offset;
public CmsBookExample() {
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;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getLimit() {
return limit;
}
public void setOffset(Integer offset) {
this.offset = offset;
}
public Integer getOffset() {
return offset;
}
protected abstract static class GeneratedCriteria implements Serializable {
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 andBookIdIsNull() {
addCriterion("book_id is null");
return (Criteria) this;
}
public Criteria andBookIdIsNotNull() {
addCriterion("book_id is not null");
return (Criteria) this;
}
public Criteria andBookIdEqualTo(Integer value) {
addCriterion("book_id =", value, "bookId");
return (Criteria) this;
}
public Criteria andBookIdNotEqualTo(Integer value) {
addCriterion("book_id <>", value, "bookId");
return (Criteria) this;
}
public Criteria andBookIdGreaterThan(Integer value) {
addCriterion("book_id >", value, "bookId");
return (Criteria) this;
}
public Criteria andBookIdGreaterThanOrEqualTo(Integer value) {
addCriterion("book_id >=", value, "bookId");
return (Criteria) this;
}
public Criteria andBookIdLessThan(Integer value) {
addCriterion("book_id <", value, "bookId");
return (Criteria) this;
}
public Criteria andBookIdLessThanOrEqualTo(Integer value) {
addCriterion("book_id <=", value, "bookId");
return (Criteria) this;
}
public Criteria andBookIdIn(List<Integer> values) {
addCriterion("book_id in", values, "bookId");
return (Criteria) this;
}
public Criteria andBookIdNotIn(List<Integer> values) {
addCriterion("book_id not in", values, "bookId");
return (Criteria) this;
}
public Criteria andBookIdBetween(Integer value1, Integer value2) {
addCriterion("book_id between", value1, value2, "bookId");
return (Criteria) this;
}
public Criteria andBookIdNotBetween(Integer value1, Integer value2) {
addCriterion("book_id not between", value1, value2, "bookId");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Integer value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Integer value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Integer value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Integer value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Integer value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Integer value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Integer> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Integer> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Integer value1, Integer value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Integer value1, Integer value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria implements Serializable {
protected Criteria() {
super();
}
}
public static class Criterion implements Serializable {
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,142 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
public class CmsPage implements Serializable {
private Integer pageId;
private Integer pid;
private String alias;
private String keywords;
private String description;
private Long ctime;
private Long orders;
private String content;
private static final long serialVersionUID = 1L;
public Integer getPageId() {
return pageId;
}
public void setPageId(Integer pageId) {
this.pageId = pageId;
}
public Integer getPid() {
return pid;
}
public void setPid(Integer pid) {
this.pid = pid;
}
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
public String getKeywords() {
return keywords;
}
public void setKeywords(String keywords) {
this.keywords = keywords;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Long getCtime() {
return ctime;
}
public void setCtime(Long ctime) {
this.ctime = ctime;
}
public Long getOrders() {
return orders;
}
public void setOrders(Long orders) {
this.orders = orders;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", pageId=").append(pageId);
sb.append(", pid=").append(pid);
sb.append(", alias=").append(alias);
sb.append(", keywords=").append(keywords);
sb.append(", description=").append(description);
sb.append(", ctime=").append(ctime);
sb.append(", orders=").append(orders);
sb.append(", content=").append(content);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
CmsPage other = (CmsPage) that;
return (this.getPageId() == null ? other.getPageId() == null : this.getPageId().equals(other.getPageId()))
&& (this.getPid() == null ? other.getPid() == null : this.getPid().equals(other.getPid()))
&& (this.getAlias() == null ? other.getAlias() == null : this.getAlias().equals(other.getAlias()))
&& (this.getKeywords() == null ? other.getKeywords() == null : this.getKeywords().equals(other.getKeywords()))
&& (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
&& (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()))
&& (this.getOrders() == null ? other.getOrders() == null : this.getOrders().equals(other.getOrders()))
&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getPageId() == null) ? 0 : getPageId().hashCode());
result = prime * result + ((getPid() == null) ? 0 : getPid().hashCode());
result = prime * result + ((getAlias() == null) ? 0 : getAlias().hashCode());
result = prime * result + ((getKeywords() == null) ? 0 : getKeywords().hashCode());
result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
result = prime * result + ((getOrders() == null) ? 0 : getOrders().hashCode());
result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
return result;
}
}

View File

@ -0,0 +1,673 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class CmsPageExample implements Serializable {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private static final long serialVersionUID = 1L;
private Integer limit;
private Integer offset;
public CmsPageExample() {
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;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getLimit() {
return limit;
}
public void setOffset(Integer offset) {
this.offset = offset;
}
public Integer getOffset() {
return offset;
}
protected abstract static class GeneratedCriteria implements Serializable {
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 andPageIdIsNull() {
addCriterion("page_id is null");
return (Criteria) this;
}
public Criteria andPageIdIsNotNull() {
addCriterion("page_id is not null");
return (Criteria) this;
}
public Criteria andPageIdEqualTo(Integer value) {
addCriterion("page_id =", value, "pageId");
return (Criteria) this;
}
public Criteria andPageIdNotEqualTo(Integer value) {
addCriterion("page_id <>", value, "pageId");
return (Criteria) this;
}
public Criteria andPageIdGreaterThan(Integer value) {
addCriterion("page_id >", value, "pageId");
return (Criteria) this;
}
public Criteria andPageIdGreaterThanOrEqualTo(Integer value) {
addCriterion("page_id >=", value, "pageId");
return (Criteria) this;
}
public Criteria andPageIdLessThan(Integer value) {
addCriterion("page_id <", value, "pageId");
return (Criteria) this;
}
public Criteria andPageIdLessThanOrEqualTo(Integer value) {
addCriterion("page_id <=", value, "pageId");
return (Criteria) this;
}
public Criteria andPageIdIn(List<Integer> values) {
addCriterion("page_id in", values, "pageId");
return (Criteria) this;
}
public Criteria andPageIdNotIn(List<Integer> values) {
addCriterion("page_id not in", values, "pageId");
return (Criteria) this;
}
public Criteria andPageIdBetween(Integer value1, Integer value2) {
addCriterion("page_id between", value1, value2, "pageId");
return (Criteria) this;
}
public Criteria andPageIdNotBetween(Integer value1, Integer value2) {
addCriterion("page_id not between", value1, value2, "pageId");
return (Criteria) this;
}
public Criteria andPidIsNull() {
addCriterion("pid is null");
return (Criteria) this;
}
public Criteria andPidIsNotNull() {
addCriterion("pid is not null");
return (Criteria) this;
}
public Criteria andPidEqualTo(Integer value) {
addCriterion("pid =", value, "pid");
return (Criteria) this;
}
public Criteria andPidNotEqualTo(Integer value) {
addCriterion("pid <>", value, "pid");
return (Criteria) this;
}
public Criteria andPidGreaterThan(Integer value) {
addCriterion("pid >", value, "pid");
return (Criteria) this;
}
public Criteria andPidGreaterThanOrEqualTo(Integer value) {
addCriterion("pid >=", value, "pid");
return (Criteria) this;
}
public Criteria andPidLessThan(Integer value) {
addCriterion("pid <", value, "pid");
return (Criteria) this;
}
public Criteria andPidLessThanOrEqualTo(Integer value) {
addCriterion("pid <=", value, "pid");
return (Criteria) this;
}
public Criteria andPidIn(List<Integer> values) {
addCriterion("pid in", values, "pid");
return (Criteria) this;
}
public Criteria andPidNotIn(List<Integer> values) {
addCriterion("pid not in", values, "pid");
return (Criteria) this;
}
public Criteria andPidBetween(Integer value1, Integer value2) {
addCriterion("pid between", value1, value2, "pid");
return (Criteria) this;
}
public Criteria andPidNotBetween(Integer value1, Integer value2) {
addCriterion("pid not between", value1, value2, "pid");
return (Criteria) this;
}
public Criteria andAliasIsNull() {
addCriterion("alias is null");
return (Criteria) this;
}
public Criteria andAliasIsNotNull() {
addCriterion("alias is not null");
return (Criteria) this;
}
public Criteria andAliasEqualTo(String value) {
addCriterion("alias =", value, "alias");
return (Criteria) this;
}
public Criteria andAliasNotEqualTo(String value) {
addCriterion("alias <>", value, "alias");
return (Criteria) this;
}
public Criteria andAliasGreaterThan(String value) {
addCriterion("alias >", value, "alias");
return (Criteria) this;
}
public Criteria andAliasGreaterThanOrEqualTo(String value) {
addCriterion("alias >=", value, "alias");
return (Criteria) this;
}
public Criteria andAliasLessThan(String value) {
addCriterion("alias <", value, "alias");
return (Criteria) this;
}
public Criteria andAliasLessThanOrEqualTo(String value) {
addCriterion("alias <=", value, "alias");
return (Criteria) this;
}
public Criteria andAliasLike(String value) {
addCriterion("alias like", value, "alias");
return (Criteria) this;
}
public Criteria andAliasNotLike(String value) {
addCriterion("alias not like", value, "alias");
return (Criteria) this;
}
public Criteria andAliasIn(List<String> values) {
addCriterion("alias in", values, "alias");
return (Criteria) this;
}
public Criteria andAliasNotIn(List<String> values) {
addCriterion("alias not in", values, "alias");
return (Criteria) this;
}
public Criteria andAliasBetween(String value1, String value2) {
addCriterion("alias between", value1, value2, "alias");
return (Criteria) this;
}
public Criteria andAliasNotBetween(String value1, String value2) {
addCriterion("alias not between", value1, value2, "alias");
return (Criteria) this;
}
public Criteria andKeywordsIsNull() {
addCriterion("keywords is null");
return (Criteria) this;
}
public Criteria andKeywordsIsNotNull() {
addCriterion("keywords is not null");
return (Criteria) this;
}
public Criteria andKeywordsEqualTo(String value) {
addCriterion("keywords =", value, "keywords");
return (Criteria) this;
}
public Criteria andKeywordsNotEqualTo(String value) {
addCriterion("keywords <>", value, "keywords");
return (Criteria) this;
}
public Criteria andKeywordsGreaterThan(String value) {
addCriterion("keywords >", value, "keywords");
return (Criteria) this;
}
public Criteria andKeywordsGreaterThanOrEqualTo(String value) {
addCriterion("keywords >=", value, "keywords");
return (Criteria) this;
}
public Criteria andKeywordsLessThan(String value) {
addCriterion("keywords <", value, "keywords");
return (Criteria) this;
}
public Criteria andKeywordsLessThanOrEqualTo(String value) {
addCriterion("keywords <=", value, "keywords");
return (Criteria) this;
}
public Criteria andKeywordsLike(String value) {
addCriterion("keywords like", value, "keywords");
return (Criteria) this;
}
public Criteria andKeywordsNotLike(String value) {
addCriterion("keywords not like", value, "keywords");
return (Criteria) this;
}
public Criteria andKeywordsIn(List<String> values) {
addCriterion("keywords in", values, "keywords");
return (Criteria) this;
}
public Criteria andKeywordsNotIn(List<String> values) {
addCriterion("keywords not in", values, "keywords");
return (Criteria) this;
}
public Criteria andKeywordsBetween(String value1, String value2) {
addCriterion("keywords between", value1, value2, "keywords");
return (Criteria) this;
}
public Criteria andKeywordsNotBetween(String value1, String value2) {
addCriterion("keywords not between", value1, value2, "keywords");
return (Criteria) this;
}
public Criteria andDescriptionIsNull() {
addCriterion("description is null");
return (Criteria) this;
}
public Criteria andDescriptionIsNotNull() {
addCriterion("description is not null");
return (Criteria) this;
}
public Criteria andDescriptionEqualTo(String value) {
addCriterion("description =", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotEqualTo(String value) {
addCriterion("description <>", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionGreaterThan(String value) {
addCriterion("description >", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
addCriterion("description >=", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLessThan(String value) {
addCriterion("description <", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLessThanOrEqualTo(String value) {
addCriterion("description <=", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLike(String value) {
addCriterion("description like", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotLike(String value) {
addCriterion("description not like", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionIn(List<String> values) {
addCriterion("description in", values, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotIn(List<String> values) {
addCriterion("description not in", values, "description");
return (Criteria) this;
}
public Criteria andDescriptionBetween(String value1, String value2) {
addCriterion("description between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotBetween(String value1, String value2) {
addCriterion("description not between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andCtimeIsNull() {
addCriterion("ctime is null");
return (Criteria) this;
}
public Criteria andCtimeIsNotNull() {
addCriterion("ctime is not null");
return (Criteria) this;
}
public Criteria andCtimeEqualTo(Long value) {
addCriterion("ctime =", value, "ctime");
return (Criteria) this;
}
public Criteria andCtimeNotEqualTo(Long value) {
addCriterion("ctime <>", value, "ctime");
return (Criteria) this;
}
public Criteria andCtimeGreaterThan(Long value) {
addCriterion("ctime >", value, "ctime");
return (Criteria) this;
}
public Criteria andCtimeGreaterThanOrEqualTo(Long value) {
addCriterion("ctime >=", value, "ctime");
return (Criteria) this;
}
public Criteria andCtimeLessThan(Long value) {
addCriterion("ctime <", value, "ctime");
return (Criteria) this;
}
public Criteria andCtimeLessThanOrEqualTo(Long value) {
addCriterion("ctime <=", value, "ctime");
return (Criteria) this;
}
public Criteria andCtimeIn(List<Long> values) {
addCriterion("ctime in", values, "ctime");
return (Criteria) this;
}
public Criteria andCtimeNotIn(List<Long> values) {
addCriterion("ctime not in", values, "ctime");
return (Criteria) this;
}
public Criteria andCtimeBetween(Long value1, Long value2) {
addCriterion("ctime between", value1, value2, "ctime");
return (Criteria) this;
}
public Criteria andCtimeNotBetween(Long value1, Long value2) {
addCriterion("ctime not between", value1, value2, "ctime");
return (Criteria) this;
}
public Criteria andOrdersIsNull() {
addCriterion("orders is null");
return (Criteria) this;
}
public Criteria andOrdersIsNotNull() {
addCriterion("orders is not null");
return (Criteria) this;
}
public Criteria andOrdersEqualTo(Long value) {
addCriterion("orders =", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersNotEqualTo(Long value) {
addCriterion("orders <>", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersGreaterThan(Long value) {
addCriterion("orders >", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersGreaterThanOrEqualTo(Long value) {
addCriterion("orders >=", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersLessThan(Long value) {
addCriterion("orders <", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersLessThanOrEqualTo(Long value) {
addCriterion("orders <=", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersIn(List<Long> values) {
addCriterion("orders in", values, "orders");
return (Criteria) this;
}
public Criteria andOrdersNotIn(List<Long> values) {
addCriterion("orders not in", values, "orders");
return (Criteria) this;
}
public Criteria andOrdersBetween(Long value1, Long value2) {
addCriterion("orders between", value1, value2, "orders");
return (Criteria) this;
}
public Criteria andOrdersNotBetween(Long value1, Long value2) {
addCriterion("orders not between", value1, value2, "orders");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria implements Serializable {
protected Criteria() {
super();
}
}
public static class Criterion implements Serializable {
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,77 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
public class CmsSetting implements Serializable {
private Integer settingId;
private String settingKey;
private String settingValue;
private static final long serialVersionUID = 1L;
public Integer getSettingId() {
return settingId;
}
public void setSettingId(Integer settingId) {
this.settingId = settingId;
}
public String getSettingKey() {
return settingKey;
}
public void setSettingKey(String settingKey) {
this.settingKey = settingKey;
}
public String getSettingValue() {
return settingValue;
}
public void setSettingValue(String settingValue) {
this.settingValue = settingValue;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", settingId=").append(settingId);
sb.append(", settingKey=").append(settingKey);
sb.append(", settingValue=").append(settingValue);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
CmsSetting other = (CmsSetting) that;
return (this.getSettingId() == null ? other.getSettingId() == null : this.getSettingId().equals(other.getSettingId()))
&& (this.getSettingKey() == null ? other.getSettingKey() == null : this.getSettingKey().equals(other.getSettingKey()))
&& (this.getSettingValue() == null ? other.getSettingValue() == null : this.getSettingValue().equals(other.getSettingValue()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getSettingId() == null) ? 0 : getSettingId().hashCode());
result = prime * result + ((getSettingKey() == null) ? 0 : getSettingKey().hashCode());
result = prime * result + ((getSettingValue() == null) ? 0 : getSettingValue().hashCode());
return result;
}
}

View File

@ -0,0 +1,423 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class CmsSettingExample implements Serializable {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private static final long serialVersionUID = 1L;
private Integer limit;
private Integer offset;
public CmsSettingExample() {
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;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getLimit() {
return limit;
}
public void setOffset(Integer offset) {
this.offset = offset;
}
public Integer getOffset() {
return offset;
}
protected abstract static class GeneratedCriteria implements Serializable {
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 andSettingIdIsNull() {
addCriterion("setting_id is null");
return (Criteria) this;
}
public Criteria andSettingIdIsNotNull() {
addCriterion("setting_id is not null");
return (Criteria) this;
}
public Criteria andSettingIdEqualTo(Integer value) {
addCriterion("setting_id =", value, "settingId");
return (Criteria) this;
}
public Criteria andSettingIdNotEqualTo(Integer value) {
addCriterion("setting_id <>", value, "settingId");
return (Criteria) this;
}
public Criteria andSettingIdGreaterThan(Integer value) {
addCriterion("setting_id >", value, "settingId");
return (Criteria) this;
}
public Criteria andSettingIdGreaterThanOrEqualTo(Integer value) {
addCriterion("setting_id >=", value, "settingId");
return (Criteria) this;
}
public Criteria andSettingIdLessThan(Integer value) {
addCriterion("setting_id <", value, "settingId");
return (Criteria) this;
}
public Criteria andSettingIdLessThanOrEqualTo(Integer value) {
addCriterion("setting_id <=", value, "settingId");
return (Criteria) this;
}
public Criteria andSettingIdIn(List<Integer> values) {
addCriterion("setting_id in", values, "settingId");
return (Criteria) this;
}
public Criteria andSettingIdNotIn(List<Integer> values) {
addCriterion("setting_id not in", values, "settingId");
return (Criteria) this;
}
public Criteria andSettingIdBetween(Integer value1, Integer value2) {
addCriterion("setting_id between", value1, value2, "settingId");
return (Criteria) this;
}
public Criteria andSettingIdNotBetween(Integer value1, Integer value2) {
addCriterion("setting_id not between", value1, value2, "settingId");
return (Criteria) this;
}
public Criteria andSettingKeyIsNull() {
addCriterion("setting_key is null");
return (Criteria) this;
}
public Criteria andSettingKeyIsNotNull() {
addCriterion("setting_key is not null");
return (Criteria) this;
}
public Criteria andSettingKeyEqualTo(String value) {
addCriterion("setting_key =", value, "settingKey");
return (Criteria) this;
}
public Criteria andSettingKeyNotEqualTo(String value) {
addCriterion("setting_key <>", value, "settingKey");
return (Criteria) this;
}
public Criteria andSettingKeyGreaterThan(String value) {
addCriterion("setting_key >", value, "settingKey");
return (Criteria) this;
}
public Criteria andSettingKeyGreaterThanOrEqualTo(String value) {
addCriterion("setting_key >=", value, "settingKey");
return (Criteria) this;
}
public Criteria andSettingKeyLessThan(String value) {
addCriterion("setting_key <", value, "settingKey");
return (Criteria) this;
}
public Criteria andSettingKeyLessThanOrEqualTo(String value) {
addCriterion("setting_key <=", value, "settingKey");
return (Criteria) this;
}
public Criteria andSettingKeyLike(String value) {
addCriterion("setting_key like", value, "settingKey");
return (Criteria) this;
}
public Criteria andSettingKeyNotLike(String value) {
addCriterion("setting_key not like", value, "settingKey");
return (Criteria) this;
}
public Criteria andSettingKeyIn(List<String> values) {
addCriterion("setting_key in", values, "settingKey");
return (Criteria) this;
}
public Criteria andSettingKeyNotIn(List<String> values) {
addCriterion("setting_key not in", values, "settingKey");
return (Criteria) this;
}
public Criteria andSettingKeyBetween(String value1, String value2) {
addCriterion("setting_key between", value1, value2, "settingKey");
return (Criteria) this;
}
public Criteria andSettingKeyNotBetween(String value1, String value2) {
addCriterion("setting_key not between", value1, value2, "settingKey");
return (Criteria) this;
}
public Criteria andSettingValueIsNull() {
addCriterion("setting_value is null");
return (Criteria) this;
}
public Criteria andSettingValueIsNotNull() {
addCriterion("setting_value is not null");
return (Criteria) this;
}
public Criteria andSettingValueEqualTo(String value) {
addCriterion("setting_value =", value, "settingValue");
return (Criteria) this;
}
public Criteria andSettingValueNotEqualTo(String value) {
addCriterion("setting_value <>", value, "settingValue");
return (Criteria) this;
}
public Criteria andSettingValueGreaterThan(String value) {
addCriterion("setting_value >", value, "settingValue");
return (Criteria) this;
}
public Criteria andSettingValueGreaterThanOrEqualTo(String value) {
addCriterion("setting_value >=", value, "settingValue");
return (Criteria) this;
}
public Criteria andSettingValueLessThan(String value) {
addCriterion("setting_value <", value, "settingValue");
return (Criteria) this;
}
public Criteria andSettingValueLessThanOrEqualTo(String value) {
addCriterion("setting_value <=", value, "settingValue");
return (Criteria) this;
}
public Criteria andSettingValueLike(String value) {
addCriterion("setting_value like", value, "settingValue");
return (Criteria) this;
}
public Criteria andSettingValueNotLike(String value) {
addCriterion("setting_value not like", value, "settingValue");
return (Criteria) this;
}
public Criteria andSettingValueIn(List<String> values) {
addCriterion("setting_value in", values, "settingValue");
return (Criteria) this;
}
public Criteria andSettingValueNotIn(List<String> values) {
addCriterion("setting_value not in", values, "settingValue");
return (Criteria) this;
}
public Criteria andSettingValueBetween(String value1, String value2) {
addCriterion("setting_value between", value1, value2, "settingValue");
return (Criteria) this;
}
public Criteria andSettingValueNotBetween(String value1, String value2) {
addCriterion("setting_value not between", value1, value2, "settingValue");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria implements Serializable {
protected Criteria() {
super();
}
}
public static class Criterion implements Serializable {
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,164 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
public class CmsUser implements Serializable {
/**
* 编号
*
* @mbg.generated
*/
private Integer userId;
/**
* 账号
*
* @mbg.generated
*/
private String username;
/**
* 密码
*
* @mbg.generated
*/
private String password;
/**
* 昵称
*
* @mbg.generated
*/
private String nickname;
/**
* 0未知,1男,2女
*
* @mbg.generated
*/
private Integer sex;
/**
* 创建时间
*
* @mbg.generated
*/
private Long ctime;
/**
* 备注
*
* @mbg.generated
*/
private String content;
private static final long serialVersionUID = 1L;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public Long getCtime() {
return ctime;
}
public void setCtime(Long ctime) {
this.ctime = ctime;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", userId=").append(userId);
sb.append(", username=").append(username);
sb.append(", password=").append(password);
sb.append(", nickname=").append(nickname);
sb.append(", sex=").append(sex);
sb.append(", ctime=").append(ctime);
sb.append(", content=").append(content);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
CmsUser other = (CmsUser) that;
return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
&& (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
&& (this.getNickname() == null ? other.getNickname() == null : this.getNickname().equals(other.getNickname()))
&& (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex()))
&& (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()))
&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
result = prime * result + ((getNickname() == null) ? 0 : getNickname().hashCode());
result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode());
result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
return result;
}
}

View File

@ -0,0 +1,613 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class CmsUserExample implements Serializable {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private static final long serialVersionUID = 1L;
private Integer limit;
private Integer offset;
public CmsUserExample() {
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;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getLimit() {
return limit;
}
public void setOffset(Integer offset) {
this.offset = offset;
}
public Integer getOffset() {
return offset;
}
protected abstract static class GeneratedCriteria implements Serializable {
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 andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Integer value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Integer value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Integer value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Integer value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Integer value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Integer value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Integer> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Integer> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Integer value1, Integer value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Integer value1, Integer value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUsernameIsNull() {
addCriterion("username is null");
return (Criteria) this;
}
public Criteria andUsernameIsNotNull() {
addCriterion("username is not null");
return (Criteria) this;
}
public Criteria andUsernameEqualTo(String value) {
addCriterion("username =", value, "username");
return (Criteria) this;
}
public Criteria andUsernameNotEqualTo(String value) {
addCriterion("username <>", value, "username");
return (Criteria) this;
}
public Criteria andUsernameGreaterThan(String value) {
addCriterion("username >", value, "username");
return (Criteria) this;
}
public Criteria andUsernameGreaterThanOrEqualTo(String value) {
addCriterion("username >=", value, "username");
return (Criteria) this;
}
public Criteria andUsernameLessThan(String value) {
addCriterion("username <", value, "username");
return (Criteria) this;
}
public Criteria andUsernameLessThanOrEqualTo(String value) {
addCriterion("username <=", value, "username");
return (Criteria) this;
}
public Criteria andUsernameLike(String value) {
addCriterion("username like", value, "username");
return (Criteria) this;
}
public Criteria andUsernameNotLike(String value) {
addCriterion("username not like", value, "username");
return (Criteria) this;
}
public Criteria andUsernameIn(List<String> values) {
addCriterion("username in", values, "username");
return (Criteria) this;
}
public Criteria andUsernameNotIn(List<String> values) {
addCriterion("username not in", values, "username");
return (Criteria) this;
}
public Criteria andUsernameBetween(String value1, String value2) {
addCriterion("username between", value1, value2, "username");
return (Criteria) this;
}
public Criteria andUsernameNotBetween(String value1, String value2) {
addCriterion("username not between", value1, value2, "username");
return (Criteria) this;
}
public Criteria andPasswordIsNull() {
addCriterion("password is null");
return (Criteria) this;
}
public Criteria andPasswordIsNotNull() {
addCriterion("password is not null");
return (Criteria) this;
}
public Criteria andPasswordEqualTo(String value) {
addCriterion("password =", value, "password");
return (Criteria) this;
}
public Criteria andPasswordNotEqualTo(String value) {
addCriterion("password <>", value, "password");
return (Criteria) this;
}
public Criteria andPasswordGreaterThan(String value) {
addCriterion("password >", value, "password");
return (Criteria) this;
}
public Criteria andPasswordGreaterThanOrEqualTo(String value) {
addCriterion("password >=", value, "password");
return (Criteria) this;
}
public Criteria andPasswordLessThan(String value) {
addCriterion("password <", value, "password");
return (Criteria) this;
}
public Criteria andPasswordLessThanOrEqualTo(String value) {
addCriterion("password <=", value, "password");
return (Criteria) this;
}
public Criteria andPasswordLike(String value) {
addCriterion("password like", value, "password");
return (Criteria) this;
}
public Criteria andPasswordNotLike(String value) {
addCriterion("password not like", value, "password");
return (Criteria) this;
}
public Criteria andPasswordIn(List<String> values) {
addCriterion("password in", values, "password");
return (Criteria) this;
}
public Criteria andPasswordNotIn(List<String> values) {
addCriterion("password not in", values, "password");
return (Criteria) this;
}
public Criteria andPasswordBetween(String value1, String value2) {
addCriterion("password between", value1, value2, "password");
return (Criteria) this;
}
public Criteria andPasswordNotBetween(String value1, String value2) {
addCriterion("password not between", value1, value2, "password");
return (Criteria) this;
}
public Criteria andNicknameIsNull() {
addCriterion("nickname is null");
return (Criteria) this;
}
public Criteria andNicknameIsNotNull() {
addCriterion("nickname is not null");
return (Criteria) this;
}
public Criteria andNicknameEqualTo(String value) {
addCriterion("nickname =", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameNotEqualTo(String value) {
addCriterion("nickname <>", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameGreaterThan(String value) {
addCriterion("nickname >", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameGreaterThanOrEqualTo(String value) {
addCriterion("nickname >=", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameLessThan(String value) {
addCriterion("nickname <", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameLessThanOrEqualTo(String value) {
addCriterion("nickname <=", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameLike(String value) {
addCriterion("nickname like", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameNotLike(String value) {
addCriterion("nickname not like", value, "nickname");
return (Criteria) this;
}
public Criteria andNicknameIn(List<String> values) {
addCriterion("nickname in", values, "nickname");
return (Criteria) this;
}
public Criteria andNicknameNotIn(List<String> values) {
addCriterion("nickname not in", values, "nickname");
return (Criteria) this;
}
public Criteria andNicknameBetween(String value1, String value2) {
addCriterion("nickname between", value1, value2, "nickname");
return (Criteria) this;
}
public Criteria andNicknameNotBetween(String value1, String value2) {
addCriterion("nickname not between", value1, value2, "nickname");
return (Criteria) this;
}
public Criteria andSexIsNull() {
addCriterion("sex is null");
return (Criteria) this;
}
public Criteria andSexIsNotNull() {
addCriterion("sex is not null");
return (Criteria) this;
}
public Criteria andSexEqualTo(Integer value) {
addCriterion("sex =", value, "sex");
return (Criteria) this;
}
public Criteria andSexNotEqualTo(Integer value) {
addCriterion("sex <>", value, "sex");
return (Criteria) this;
}
public Criteria andSexGreaterThan(Integer value) {
addCriterion("sex >", value, "sex");
return (Criteria) this;
}
public Criteria andSexGreaterThanOrEqualTo(Integer value) {
addCriterion("sex >=", value, "sex");
return (Criteria) this;
}
public Criteria andSexLessThan(Integer value) {
addCriterion("sex <", value, "sex");
return (Criteria) this;
}
public Criteria andSexLessThanOrEqualTo(Integer value) {
addCriterion("sex <=", value, "sex");
return (Criteria) this;
}
public Criteria andSexIn(List<Integer> values) {
addCriterion("sex in", values, "sex");
return (Criteria) this;
}
public Criteria andSexNotIn(List<Integer> values) {
addCriterion("sex not in", values, "sex");
return (Criteria) this;
}
public Criteria andSexBetween(Integer value1, Integer value2) {
addCriterion("sex between", value1, value2, "sex");
return (Criteria) this;
}
public Criteria andSexNotBetween(Integer value1, Integer value2) {
addCriterion("sex not between", value1, value2, "sex");
return (Criteria) this;
}
public Criteria andCtimeIsNull() {
addCriterion("ctime is null");
return (Criteria) this;
}
public Criteria andCtimeIsNotNull() {
addCriterion("ctime is not null");
return (Criteria) this;
}
public Criteria andCtimeEqualTo(Long value) {
addCriterion("ctime =", value, "ctime");
return (Criteria) this;
}
public Criteria andCtimeNotEqualTo(Long value) {
addCriterion("ctime <>", value, "ctime");
return (Criteria) this;
}
public Criteria andCtimeGreaterThan(Long value) {
addCriterion("ctime >", value, "ctime");
return (Criteria) this;
}
public Criteria andCtimeGreaterThanOrEqualTo(Long value) {
addCriterion("ctime >=", value, "ctime");
return (Criteria) this;
}
public Criteria andCtimeLessThan(Long value) {
addCriterion("ctime <", value, "ctime");
return (Criteria) this;
}
public Criteria andCtimeLessThanOrEqualTo(Long value) {
addCriterion("ctime <=", value, "ctime");
return (Criteria) this;
}
public Criteria andCtimeIn(List<Long> values) {
addCriterion("ctime in", values, "ctime");
return (Criteria) this;
}
public Criteria andCtimeNotIn(List<Long> values) {
addCriterion("ctime not in", values, "ctime");
return (Criteria) this;
}
public Criteria andCtimeBetween(Long value1, Long value2) {
addCriterion("ctime between", value1, value2, "ctime");
return (Criteria) this;
}
public Criteria andCtimeNotBetween(Long value1, Long value2) {
addCriterion("ctime not between", value1, value2, "ctime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria implements Serializable {
protected Criteria() {
super();
}
}
public static class Criterion implements Serializable {
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

@ -67,9 +67,13 @@
<table tableName="cms_article" domainObjectName="CmsArticle"></table>
<table tableName="cms_article_category" domainObjectName="CmsArticleCategory"></table>
<table tableName="cms_article_tag" domainObjectName="CmsArticleTag"></table>
<table tableName="cms_book" domainObjectName="CmsBook"></table>
<table tableName="cms_category" domainObjectName="CmsCategory"></table>
<table tableName="cms_category_tag" domainObjectName="CmsCategoryTag"></table>
<table tableName="cms_comment" domainObjectName="CmsComment"></table>
<table tableName="cms_page" domainObjectName="CmsPage"></table>
<table tableName="cms_setting" domainObjectName="CmsSetting"></table>
<table tableName="cms_tag" domainObjectName="CmsTag"></table>
<table tableName="cms_user" domainObjectName="CmsUser"></table>
</context>
</generatorConfiguration>

View File

@ -1,6 +1,6 @@
package com.zheng.cms.job.jms;
import com.zheng.cms.dao.model.User;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.service.UserService;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
@ -36,7 +36,7 @@ public class defaultQueueMessageListener implements MessageListener {
try {
String text = textMessage.getText();
JSONObject json = JSONObject.fromObject(text);
User user = (User) JSONObject.toBean(json, User.class);
CmsUser user = (CmsUser) JSONObject.toBean(json, CmsUser.class);
if (user.getUsername().equals("1")) {
_log.info("消费开始时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis())));
}

View File

@ -7,17 +7,17 @@ import java.util.List;
* 用户VO
* Created by shuzheng on 2016/11/14.
*/
public class UserVO extends User implements Serializable {
public class UserVO extends CmsUser implements Serializable {
private static final long serialVersionUID = 1L;
private List<Book> books;
private List<CmsBook> books;
public List<Book> getBooks() {
public List<CmsBook> getBooks() {
return books;
}
public void setBooks(List<Book> books) {
public void setBooks(List<CmsBook> books) {
this.books = books;
}
}

View File

@ -1,7 +1,7 @@
package com.zheng.cms.rpc.api;
import com.zheng.cms.dao.model.User;
import com.zheng.cms.dao.model.UserExample;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.CmsUserExample;
import com.zheng.cms.dao.model.UserVO;
import com.zheng.common.base.BaseService;
@ -9,7 +9,7 @@ import com.zheng.common.base.BaseService;
* 用户service接口
* Created by shuzheng on 2016/11/14.
*/
public interface UserService extends BaseService<User, UserExample> {
public interface UserService extends BaseService<CmsUser, CmsUserExample> {
/**
* 获取带book数据的用户

View File

@ -1,9 +1,9 @@
package com.zheng.cms.rpc.service.impl;
import com.zheng.cms.dao.mapper.UserMapper;
import com.zheng.cms.dao.mapper.CmsUserMapper;
import com.zheng.cms.dao.mapper.UserVOMapper;
import com.zheng.cms.dao.model.User;
import com.zheng.cms.dao.model.UserExample;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.CmsUserExample;
import com.zheng.cms.dao.model.UserVO;
import com.zheng.cms.rpc.api.UserService;
import com.zheng.common.base.BaseServiceImpl;
@ -21,7 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
*/
@Service
@Transactional
public class UserServiceImpl extends BaseServiceImpl<UserMapper, User, UserExample> implements UserService {
public class UserServiceImpl extends BaseServiceImpl<CmsUserMapper, CmsUser, CmsUserExample> implements UserService {
private static Logger _log = LoggerFactory.getLogger(UserServiceImpl.class);

View File

@ -10,7 +10,7 @@ import com.zheng.cms.dao.model.UserVO;
* @date 2016年7月6日 下午6:05:54
*/
@Repository
public interface UserVOMapper extends UserMapper {
public interface UserVOMapper extends CmsUserMapper {
UserVO selectUserWithBook(int id);

View File

@ -7,15 +7,15 @@ import java.util.List;
* @author shuzheng
* @date 2016年7月6日 下午6:06:36
*/
public class UserVO extends User {
public class UserVO extends CmsUser {
private List<Book> books;
private List<CmsBook> books;
public List<Book> getBooks() {
public List<CmsBook> getBooks() {
return books;
}
public void setBooks(List<Book> books) {
public void setBooks(List<CmsBook> books) {
this.books = books;
}
}

View File

@ -1,8 +1,6 @@
package com.zheng.cms.service;
import com.zheng.cms.dao.mapper.CmsTagMapper;
import com.zheng.cms.dao.mapper.UserMapper;
import com.zheng.cms.dao.model.UserVO;
/**
* 标签service接口

View File

@ -1,6 +1,6 @@
package com.zheng.cms.service;
import com.zheng.cms.dao.mapper.UserMapper;
import com.zheng.cms.dao.mapper.CmsUserMapper;
import com.zheng.cms.dao.model.UserVO;
/**
@ -8,7 +8,7 @@ import com.zheng.cms.dao.model.UserVO;
* @author shuzheng
* @date 2016年7月6日 下午6:03:45
*/
public interface UserService extends BaseService<UserMapper> {
public interface UserService extends BaseService<CmsUserMapper> {
/**
* 获取带book数据的用户

View File

@ -1,6 +1,6 @@
package com.zheng.cms.service.impl;
import com.zheng.cms.dao.mapper.UserMapper;
import com.zheng.cms.dao.mapper.CmsUserMapper;
import com.zheng.cms.dao.mapper.UserVOMapper;
import com.zheng.cms.dao.model.UserVO;
import com.zheng.cms.service.UserService;
@ -23,7 +23,7 @@ public class UserServiceImpl implements UserService {
private static Logger _log = LoggerFactory.getLogger(UserServiceImpl.class);
@Autowired
private UserMapper userMapper;
private CmsUserMapper userMapper;
@Autowired
private UserVOMapper userVOMapper;
@ -33,7 +33,7 @@ public class UserServiceImpl implements UserService {
* @return
*/
@Override
public UserMapper getMapper() {
public CmsUserMapper getMapper() {
return userMapper;
}

View File

@ -1,6 +1,6 @@
package com.zheng.cms.service;
import com.zheng.cms.dao.model.User;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.UserVO;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -31,7 +31,7 @@ public class UserServiceTest {
UserVO userVO = userService.selectUserWithBook(1);
System.out.println(null == userVO ? "null" : userVO.getBooks().size());
// 自动生成接口调用
User user = userService.getMapper().selectByPrimaryKey(1);
CmsUser user = userService.getMapper().selectByPrimaryKey(1);
System.out.println(null == user ? "null" :user.getNickname());
}

View File

@ -1,6 +1,6 @@
package com.zheng.cms.web.controller;
import com.zheng.cms.dao.model.User;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.common.util.JmsUtil;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
@ -34,9 +34,9 @@ public class ActiveMQController extends BaseController {
@ResponseBody
public Object send() {
long start = System.currentTimeMillis();
User user = null;
CmsUser user = null;
for (int i = 1; i <= 1000; i ++) {
user = new User();
user = new CmsUser();
user.setUsername(i + "");
user.setPassword("123456");
user.setNickname("昵称");
@ -51,7 +51,7 @@ public class ActiveMQController extends BaseController {
}
public static void main(String[] args) {
User user = new User();
CmsUser user = new CmsUser();
user.setUsername("用户");
user.setPassword("123456");
user.setNickname("昵称");

View File

@ -1,6 +1,6 @@
package com.zheng.cms.web.controller;
import com.zheng.cms.dao.model.User;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.rpc.api.UserService;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
@ -52,7 +52,7 @@ public class HelloController extends BaseController {
@RequestMapping(value = "/view", method = RequestMethod.GET)
public String viewCourse(@RequestParam("courseId") Integer courseId, ModelMap modelMap) {
User user = userService.selectByPrimaryKey(courseId);
CmsUser user = userService.selectByPrimaryKey(courseId);
modelMap.put("user", user);
return "course_overview";
}
@ -61,7 +61,7 @@ public class HelloController extends BaseController {
@RequestMapping("/view2/{courseId}")
public String viewCourse2(@PathVariable("courseId") Integer courseId, Map<String, Object> map) {
User user = userService.selectByPrimaryKey(courseId);
CmsUser user = userService.selectByPrimaryKey(courseId);
map.put("user", user);
return "course_overview";
}
@ -71,7 +71,7 @@ public class HelloController extends BaseController {
public String viewCourse3(HttpServletRequest request) {
Integer courseId = Integer.valueOf(request.getParameter("courseId"));
User user = userService.selectByPrimaryKey(courseId);
CmsUser user = userService.selectByPrimaryKey(courseId);
request.setAttribute("user", user);
return "course_overview";
@ -83,7 +83,7 @@ public class HelloController extends BaseController {
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
public String doSave(@ModelAttribute User user) {
public String doSave(@ModelAttribute CmsUser user) {
_log.debug("Info of Course:");
_log.debug(ReflectionToStringBuilder.toString(user));
@ -129,13 +129,13 @@ public class HelloController extends BaseController {
@RequestMapping(value = "/{courseId}", method = RequestMethod.GET)
public @ResponseBody
User getCourseInJson(@PathVariable Integer courseId) {
CmsUser getCourseInJson(@PathVariable Integer courseId) {
return userService.selectByPrimaryKey(courseId);
}
@RequestMapping(value = "/jsontype/{courseId}", method = RequestMethod.GET)
public ResponseEntity<User> getCourseInJson2(@PathVariable Integer courseId) {
User user = userService.selectByPrimaryKey(courseId);
return new ResponseEntity<User>(user, HttpStatus.OK);
public ResponseEntity<CmsUser> getCourseInJson2(@PathVariable Integer courseId) {
CmsUser user = userService.selectByPrimaryKey(courseId);
return new ResponseEntity<CmsUser>(user, HttpStatus.OK);
}
}

View File

@ -1,7 +1,7 @@
package com.zheng.cms.web.controller;
import com.zheng.cms.dao.model.User;
import com.zheng.cms.dao.model.UserExample;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.CmsUserExample;
import com.zheng.cms.rpc.api.UserService;
import com.zheng.common.util.Paginator;
import org.slf4j.Logger;
@ -63,14 +63,14 @@ public class UserController extends BaseController {
@RequestParam(required = false, defaultValue = "20", value = "rows") int rows,
HttpServletRequest request, ModelMap modelMap) {
UserExample userExample = new UserExample();
CmsUserExample userExample = new CmsUserExample();
userExample.createCriteria()
.andUserIdGreaterThan(0);
userExample.setOffset((page -1) * rows);
userExample.setLimit(rows);
userExample.setDistinct(false);
userExample.setOrderByClause(" user_id asc ");
List<User> users = userService.selectByExample(userExample);
List<CmsUser> users = userService.selectByExample(userExample);
modelMap.put("users", users);
// 创建分页对象
@ -103,7 +103,7 @@ public class UserController extends BaseController {
* @return
*/
@RequestMapping(value = "/add", method = RequestMethod.POST)
public String add(@Valid User user, BindingResult binding) {
public String add(@Valid CmsUser user, BindingResult binding) {
if (binding.hasErrors()) {
for (ObjectError error : binding.getAllErrors()) {
_log.error(error.getDefaultMessage());
@ -151,7 +151,7 @@ public class UserController extends BaseController {
* @return
*/
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
public String update(@PathVariable("id") int id, @Valid User user, BindingResult binding, ModelMap modelMap) {
public String update(@PathVariable("id") int id, @Valid CmsUser user, BindingResult binding, ModelMap modelMap) {
if (binding.hasErrors()) {
modelMap.put("errors", binding.getAllErrors());
return "user/update/" + id;

View File

@ -1,6 +1,6 @@
package com.zheng.cms.web.jms;
import com.zheng.cms.dao.model.User;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.rpc.api.UserService;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
@ -36,7 +36,7 @@ public class defaultQueueMessageListener implements MessageListener {
try {
String text = textMessage.getText();
JSONObject json = JSONObject.fromObject(text);
User user = (User) JSONObject.toBean(json, User.class);
CmsUser user = (CmsUser) JSONObject.toBean(json, CmsUser.class);
if (user.getUsername().equals("1")) {
_log.info("消费开始时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis())));
}

View File

@ -60,12 +60,16 @@ public class MybatisGeneratorConfigUtil {
}
jdbcUtil.release();
String targetProject = PROJECT_NAME + "-" + module_prefix_name.replaceAll("\\.", "-") + "/" + PROJECT_NAME + "-" + module_prefix_name.replaceAll("\\.", "-") + "-dao";
context.put("tables", tables);
context.put("generator_javaModelGenerator_targetPackage", "com." + PROJECT_NAME + "." + module_prefix_name + ".dao.model");
context.put("generator_sqlMapGenerator_targetPackage", "com." + PROJECT_NAME + "." + module_prefix_name + ".dao.mapper");
context.put("generator_javaClientGenerator_targetPackage", "com." + PROJECT_NAME + "." + module_prefix_name + ".dao.mapper");
context.put("targetProject", PROJECT_NAME + "-" + module_prefix_name.replaceAll("\\.", "-") + "/" + PROJECT_NAME + "-" + module_prefix_name.replaceAll("\\.", "-") + "-dao");
context.put("targetProject", targetProject);
VelocityUtil.generate(VM_PATH, module_path, context);
// 删除旧代码
deleteDir(new File(targetProject + "/src/main/java/com/" + PROJECT_NAME + "/" + module_prefix_name.replaceAll("\\.", "/") + "/dao/model"));
deleteDir(new File(targetProject + "/src/main/java/com/" + PROJECT_NAME + "/" + module_prefix_name.replaceAll("\\.", "/") + "/dao/mapper"));
} catch (Exception e) {
e.printStackTrace();
}
@ -97,4 +101,15 @@ public class MybatisGeneratorConfigUtil {
System.out.println("========== 结束运行MybatisGenerator ==========");
}
// 递归删除非空文件夹
public static void deleteDir(File dir){
if(dir.isDirectory()){
File[] files = dir.listFiles();
for(int i=0; i<files.length; i++) {
deleteDir(files[i]);
}
}
dir.delete();
}
}