Просмотр исходного кода

mybatis generator 使用main()方法自动更新配置文件并运行

shuzheng 9 лет назад
Родитель
Сommit
d0d7ce757c
25 измененных файлов с 753 добавлено и 719 удалено
  1. 40 7
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/Generator.java
  2. 1 1
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleCategoryMapper.java
  3. 68 68
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleCategoryMapper.xml
  4. 1 1
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleMapper.java
  5. 137 137
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleMapper.xml
  6. 1 1
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleTagMapper.java
  7. 68 68
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleTagMapper.xml
  8. 1 1
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCategoryMapper.java
  9. 103 103
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCategoryMapper.xml
  10. 1 1
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCategoryTagMapper.java
  11. 68 68
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCategoryTagMapper.xml
  12. 1 1
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCommentMapper.java
  13. 107 107
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCommentMapper.xml
  14. 1 1
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsTagMapper.java
  15. 93 93
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsTagMapper.xml
  16. 15 15
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsArticle.java
  17. 3 3
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsArticleCategory.java
  18. 3 3
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsArticleTag.java
  19. 10 10
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsCategory.java
  20. 3 3
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsCategoryTag.java
  21. 9 9
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsComment.java
  22. 8 8
      zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsTag.java
  23. 4 4
      zheng-cms/zheng-cms-dao/src/main/resources/generatorConfig.xml
  24. 3 2
      zheng-common/src/main/java/com/zheng/common/util/MybatisGeneratorConfigUtil.java
  25. 4 4
      zheng-common/src/main/resources/generatorConfig.vm

+ 40 - 7
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/Generator.java

@@ -1,13 +1,19 @@
 package com.zheng.cms.dao;
 
-import com.zheng.common.util.*;
-import org.apache.commons.lang.ObjectUtils;
-import org.apache.velocity.VelocityContext;
+import com.zheng.common.util.MybatisGeneratorConfigUtil;
+import com.zheng.common.util.PropertiesFileUtil;
+import org.mybatis.generator.api.MyBatisGenerator;
+import org.mybatis.generator.config.Configuration;
+import org.mybatis.generator.config.xml.ConfigurationParser;
+import org.mybatis.generator.exception.InvalidConfigurationException;
+import org.mybatis.generator.exception.XMLParserException;
+import org.mybatis.generator.internal.DefaultShellCallback;
 
+import java.io.File;
+import java.io.IOException;
+import java.sql.SQLException;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 /**
  * 代码生成类
@@ -19,15 +25,42 @@ public class Generator {
 	private static String MODULE_PREFIX_NAME = "cms";
 	private static String JDBC_DRIVER = PropertiesFileUtil.getInstance("jdbc").get("jdbc.driver");
 	private static String JDBC_URL = PropertiesFileUtil.getInstance("jdbc").get("jdbc.url");
-	private static String JDBC_USERNAME= PropertiesFileUtil.getInstance("jdbc").get("jdbc.username");
+	private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("jdbc").get("jdbc.username");
 	private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("jdbc").get("jdbc.password");
 
 	/**
-	 * 根据模板生成generatorConfig.xml文件
+	 * 自动代码生成
+	 *
 	 * @param args
 	 */
 	public static void main(String[] args) {
+		// 更新generatorConfig.xml文件
 		MybatisGeneratorConfigUtil.generator(JDBC_DRIVER, JDBC_URL, JDBC_USERNAME, JDBC_PASSWORD, MODULE_PREFIX_NAME);
+		// 生成代码
+		try {
+			System.out.println("start generator ...");
+			List<String> warnings = new ArrayList<>();
+			File configFile = new File(Generator.class.getResource("/generatorConfig.xml").getFile());
+			ConfigurationParser cp = new ConfigurationParser(warnings);
+			Configuration config = cp.parseConfiguration(configFile);
+			DefaultShellCallback callback = new DefaultShellCallback(true);
+			MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
+			myBatisGenerator.generate(null);
+			for (String warning : warnings) {
+				System.out.println(warning);
+			}
+			System.out.println("end generator!");
+		} catch (IOException e) {
+			e.printStackTrace();
+		} catch (XMLParserException e) {
+			e.printStackTrace();
+		} catch (InterruptedException e) {
+			e.printStackTrace();
+		} catch (SQLException e) {
+			e.printStackTrace();
+		} catch (InvalidConfigurationException e) {
+			e.printStackTrace();
+		}
 	}
 
 }

+ 1 - 1
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleCategoryMapper.java

@@ -6,7 +6,7 @@ import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
 public interface CmsArticleCategoryMapper {
-    int countByExample(CmsArticleCategoryExample example);
+    long countByExample(CmsArticleCategoryExample example);
 
     int deleteByExample(CmsArticleCategoryExample example);
 

+ 68 - 68
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleCategoryMapper.xml

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

+ 1 - 1
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleMapper.java

@@ -6,7 +6,7 @@ import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
 public interface CmsArticleMapper {
-    int countByExample(CmsArticleExample example);
+    long countByExample(CmsArticleExample example);
 
     int deleteByExample(CmsArticleExample example);
 

+ 137 - 137
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleMapper.xml

@@ -1,44 +1,44 @@
-<?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.CmsArticleMapper" >
-  <resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsArticle" >
-    <id column="article_id" property="articleId" jdbcType="INTEGER" />
-    <result column="title" property="title" jdbcType="VARCHAR" />
-    <result column="author" property="author" jdbcType="VARCHAR" />
-    <result column="fromurl" property="fromurl" jdbcType="VARCHAR" />
-    <result column="image" property="image" jdbcType="VARCHAR" />
-    <result column="keywords" property="keywords" jdbcType="VARCHAR" />
-    <result column="description" property="description" jdbcType="VARCHAR" />
-    <result column="type" property="type" jdbcType="TINYINT" />
-    <result column="allowcomments" property="allowcomments" jdbcType="TINYINT" />
-    <result column="status" property="status" jdbcType="TINYINT" />
-    <result column="user_id" property="userId" jdbcType="INTEGER" />
-    <result column="readnumber" property="readnumber" jdbcType="INTEGER" />
-    <result column="ctime" property="ctime" jdbcType="BIGINT" />
-    <result column="orders" property="orders" jdbcType="BIGINT" />
+<?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.CmsArticleMapper">
+  <resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsArticle">
+    <id column="article_id" jdbcType="INTEGER" property="articleId" />
+    <result column="title" jdbcType="VARCHAR" property="title" />
+    <result column="author" jdbcType="VARCHAR" property="author" />
+    <result column="fromurl" jdbcType="VARCHAR" property="fromurl" />
+    <result column="image" jdbcType="VARCHAR" property="image" />
+    <result column="keywords" jdbcType="VARCHAR" property="keywords" />
+    <result column="description" jdbcType="VARCHAR" property="description" />
+    <result column="type" jdbcType="TINYINT" property="type" />
+    <result column="allowcomments" jdbcType="TINYINT" property="allowcomments" />
+    <result column="status" jdbcType="TINYINT" property="status" />
+    <result column="user_id" jdbcType="INTEGER" property="userId" />
+    <result column="readnumber" jdbcType="INTEGER" property="readnumber" />
+    <result column="ctime" jdbcType="BIGINT" property="ctime" />
+    <result column="orders" jdbcType="BIGINT" property="orders" />
   </resultMap>
-  <resultMap id="ResultMapWithBLOBs" type="com.zheng.cms.dao.model.CmsArticle" extends="BaseResultMap" >
-    <result column="content" property="content" jdbcType="LONGVARCHAR" />
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.zheng.cms.dao.model.CmsArticle">
+    <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="(" suffix=")" prefixOverrides="and" >
-            <foreach collection="criteria.criteria" item="criterion" >
-              <choose >
-                <when test="criterion.noValue" >
+  <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" >
+                <when test="criterion.singleValue">
                   and ${criterion.condition} #{criterion.value}
                 </when>
-                <when test="criterion.betweenValue" >
+                <when test="criterion.betweenValue">
                   and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                 </when>
-                <when test="criterion.listValue" >
+                <when test="criterion.listValue">
                   and ${criterion.condition}
-                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                     #{listItem}
                   </foreach>
                 </when>
@@ -49,25 +49,25 @@
       </foreach>
     </where>
   </sql>
-  <sql id="Update_By_Example_Where_Clause" >
-    <where >
-      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
-        <if test="criteria.valid" >
-          <trim prefix="(" suffix=")" prefixOverrides="and" >
-            <foreach collection="criteria.criteria" item="criterion" >
-              <choose >
-                <when test="criterion.noValue" >
+  <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" >
+                <when test="criterion.singleValue">
                   and ${criterion.condition} #{criterion.value}
                 </when>
-                <when test="criterion.betweenValue" >
+                <when test="criterion.betweenValue">
                   and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                 </when>
-                <when test="criterion.listValue" >
+                <when test="criterion.listValue">
                   and ${criterion.condition}
-                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                     #{listItem}
                   </foreach>
                 </when>
@@ -78,52 +78,52 @@
       </foreach>
     </where>
   </sql>
-  <sql id="Base_Column_List" >
+  <sql id="Base_Column_List">
     article_id, title, author, fromurl, image, keywords, description, type, allowcomments, 
     status, user_id, readnumber, ctime, orders
   </sql>
-  <sql id="Blob_Column_List" >
+  <sql id="Blob_Column_List">
     content
   </sql>
-  <select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsArticleExample" >
+  <select id="selectByExampleWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsArticleExample" resultMap="ResultMapWithBLOBs">
     select
-    <if test="distinct" >
+    <if test="distinct">
       distinct
     </if>
     <include refid="Base_Column_List" />
     ,
     <include refid="Blob_Column_List" />
     from cms_article
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
-    <if test="orderByClause != null" >
+    <if test="orderByClause != null">
       order by ${orderByClause}
     </if>
   </select>
-  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.cms.dao.model.CmsArticleExample" >
+  <select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsArticleExample" resultMap="BaseResultMap">
     select
-    <if test="distinct" >
+    <if test="distinct">
       distinct
     </if>
     <include refid="Base_Column_List" />
     from cms_article
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
-    <if test="orderByClause != null" >
+    <if test="orderByClause != null">
       order by ${orderByClause}
     </if>
-    <if test="limit != null" >
-      <if test="offset != null" >
+    <if test="limit != null">
+      <if test="offset != null">
         limit ${offset}, ${limit}
       </if>
-      <if test="offset == null" >
+      <if test="offset == null">
         limit ${limit}
       </if>
     </if>
   </select>
-  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
     select 
     <include refid="Base_Column_List" />
     ,
@@ -131,17 +131,17 @@
     from cms_article
     where article_id = #{articleId,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from cms_article
     where article_id = #{articleId,jdbcType=INTEGER}
   </delete>
-  <delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsArticleExample" >
+  <delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsArticleExample">
     delete from cms_article
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
-  <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsArticle" >
+  <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsArticle">
     insert into cms_article (article_id, title, author, 
       fromurl, image, keywords, 
       description, type, allowcomments, 
@@ -155,163 +155,163 @@
       #{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR}
       )
   </insert>
-  <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsArticle" >
+  <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsArticle">
     insert into cms_article
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="articleId != null" >
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="articleId != null">
         article_id,
       </if>
-      <if test="title != null" >
+      <if test="title != null">
         title,
       </if>
-      <if test="author != null" >
+      <if test="author != null">
         author,
       </if>
-      <if test="fromurl != null" >
+      <if test="fromurl != null">
         fromurl,
       </if>
-      <if test="image != null" >
+      <if test="image != null">
         image,
       </if>
-      <if test="keywords != null" >
+      <if test="keywords != null">
         keywords,
       </if>
-      <if test="description != null" >
+      <if test="description != null">
         description,
       </if>
-      <if test="type != null" >
+      <if test="type != null">
         type,
       </if>
-      <if test="allowcomments != null" >
+      <if test="allowcomments != null">
         allowcomments,
       </if>
-      <if test="status != null" >
+      <if test="status != null">
         status,
       </if>
-      <if test="userId != null" >
+      <if test="userId != null">
         user_id,
       </if>
-      <if test="readnumber != null" >
+      <if test="readnumber != null">
         readnumber,
       </if>
-      <if test="ctime != null" >
+      <if test="ctime != null">
         ctime,
       </if>
-      <if test="orders != null" >
+      <if test="orders != null">
         orders,
       </if>
-      <if test="content != null" >
+      <if test="content != null">
         content,
       </if>
     </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="articleId != null" >
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="articleId != null">
         #{articleId,jdbcType=INTEGER},
       </if>
-      <if test="title != null" >
+      <if test="title != null">
         #{title,jdbcType=VARCHAR},
       </if>
-      <if test="author != null" >
+      <if test="author != null">
         #{author,jdbcType=VARCHAR},
       </if>
-      <if test="fromurl != null" >
+      <if test="fromurl != null">
         #{fromurl,jdbcType=VARCHAR},
       </if>
-      <if test="image != null" >
+      <if test="image != null">
         #{image,jdbcType=VARCHAR},
       </if>
-      <if test="keywords != null" >
+      <if test="keywords != null">
         #{keywords,jdbcType=VARCHAR},
       </if>
-      <if test="description != null" >
+      <if test="description != null">
         #{description,jdbcType=VARCHAR},
       </if>
-      <if test="type != null" >
+      <if test="type != null">
         #{type,jdbcType=TINYINT},
       </if>
-      <if test="allowcomments != null" >
+      <if test="allowcomments != null">
         #{allowcomments,jdbcType=TINYINT},
       </if>
-      <if test="status != null" >
+      <if test="status != null">
         #{status,jdbcType=TINYINT},
       </if>
-      <if test="userId != null" >
+      <if test="userId != null">
         #{userId,jdbcType=INTEGER},
       </if>
-      <if test="readnumber != null" >
+      <if test="readnumber != null">
         #{readnumber,jdbcType=INTEGER},
       </if>
-      <if test="ctime != null" >
+      <if test="ctime != null">
         #{ctime,jdbcType=BIGINT},
       </if>
-      <if test="orders != null" >
+      <if test="orders != null">
         #{orders,jdbcType=BIGINT},
       </if>
-      <if test="content != null" >
+      <if test="content != null">
         #{content,jdbcType=LONGVARCHAR},
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsArticleExample" resultType="java.lang.Integer" >
+  <select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsArticleExample" resultType="java.lang.Long">
     select count(*) from cms_article
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </select>
-  <update id="updateByExampleSelective" parameterType="map" >
+  <update id="updateByExampleSelective" parameterType="map">
     update cms_article
-    <set >
-      <if test="record.articleId != null" >
+    <set>
+      <if test="record.articleId != null">
         article_id = #{record.articleId,jdbcType=INTEGER},
       </if>
-      <if test="record.title != null" >
+      <if test="record.title != null">
         title = #{record.title,jdbcType=VARCHAR},
       </if>
-      <if test="record.author != null" >
+      <if test="record.author != null">
         author = #{record.author,jdbcType=VARCHAR},
       </if>
-      <if test="record.fromurl != null" >
+      <if test="record.fromurl != null">
         fromurl = #{record.fromurl,jdbcType=VARCHAR},
       </if>
-      <if test="record.image != null" >
+      <if test="record.image != null">
         image = #{record.image,jdbcType=VARCHAR},
       </if>
-      <if test="record.keywords != null" >
+      <if test="record.keywords != null">
         keywords = #{record.keywords,jdbcType=VARCHAR},
       </if>
-      <if test="record.description != null" >
+      <if test="record.description != null">
         description = #{record.description,jdbcType=VARCHAR},
       </if>
-      <if test="record.type != null" >
+      <if test="record.type != null">
         type = #{record.type,jdbcType=TINYINT},
       </if>
-      <if test="record.allowcomments != null" >
+      <if test="record.allowcomments != null">
         allowcomments = #{record.allowcomments,jdbcType=TINYINT},
       </if>
-      <if test="record.status != null" >
+      <if test="record.status != null">
         status = #{record.status,jdbcType=TINYINT},
       </if>
-      <if test="record.userId != null" >
+      <if test="record.userId != null">
         user_id = #{record.userId,jdbcType=INTEGER},
       </if>
-      <if test="record.readnumber != null" >
+      <if test="record.readnumber != null">
         readnumber = #{record.readnumber,jdbcType=INTEGER},
       </if>
-      <if test="record.ctime != null" >
+      <if test="record.ctime != null">
         ctime = #{record.ctime,jdbcType=BIGINT},
       </if>
-      <if test="record.orders != null" >
+      <if test="record.orders != null">
         orders = #{record.orders,jdbcType=BIGINT},
       </if>
-      <if test="record.content != null" >
+      <if test="record.content != null">
         content = #{record.content,jdbcType=LONGVARCHAR},
       </if>
     </set>
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByExampleWithBLOBs" parameterType="map" >
+  <update id="updateByExampleWithBLOBs" parameterType="map">
     update cms_article
     set article_id = #{record.articleId,jdbcType=INTEGER},
       title = #{record.title,jdbcType=VARCHAR},
@@ -328,11 +328,11 @@
       ctime = #{record.ctime,jdbcType=BIGINT},
       orders = #{record.orders,jdbcType=BIGINT},
       content = #{record.content,jdbcType=LONGVARCHAR}
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByExample" parameterType="map" >
+  <update id="updateByExample" parameterType="map">
     update cms_article
     set article_id = #{record.articleId,jdbcType=INTEGER},
       title = #{record.title,jdbcType=VARCHAR},
@@ -348,59 +348,59 @@
       readnumber = #{record.readnumber,jdbcType=INTEGER},
       ctime = #{record.ctime,jdbcType=BIGINT},
       orders = #{record.orders,jdbcType=BIGINT}
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsArticle" >
+  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsArticle">
     update cms_article
-    <set >
-      <if test="title != null" >
+    <set>
+      <if test="title != null">
         title = #{title,jdbcType=VARCHAR},
       </if>
-      <if test="author != null" >
+      <if test="author != null">
         author = #{author,jdbcType=VARCHAR},
       </if>
-      <if test="fromurl != null" >
+      <if test="fromurl != null">
         fromurl = #{fromurl,jdbcType=VARCHAR},
       </if>
-      <if test="image != null" >
+      <if test="image != null">
         image = #{image,jdbcType=VARCHAR},
       </if>
-      <if test="keywords != null" >
+      <if test="keywords != null">
         keywords = #{keywords,jdbcType=VARCHAR},
       </if>
-      <if test="description != null" >
+      <if test="description != null">
         description = #{description,jdbcType=VARCHAR},
       </if>
-      <if test="type != null" >
+      <if test="type != null">
         type = #{type,jdbcType=TINYINT},
       </if>
-      <if test="allowcomments != null" >
+      <if test="allowcomments != null">
         allowcomments = #{allowcomments,jdbcType=TINYINT},
       </if>
-      <if test="status != null" >
+      <if test="status != null">
         status = #{status,jdbcType=TINYINT},
       </if>
-      <if test="userId != null" >
+      <if test="userId != null">
         user_id = #{userId,jdbcType=INTEGER},
       </if>
-      <if test="readnumber != null" >
+      <if test="readnumber != null">
         readnumber = #{readnumber,jdbcType=INTEGER},
       </if>
-      <if test="ctime != null" >
+      <if test="ctime != null">
         ctime = #{ctime,jdbcType=BIGINT},
       </if>
-      <if test="orders != null" >
+      <if test="orders != null">
         orders = #{orders,jdbcType=BIGINT},
       </if>
-      <if test="content != null" >
+      <if test="content != null">
         content = #{content,jdbcType=LONGVARCHAR},
       </if>
     </set>
     where article_id = #{articleId,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsArticle" >
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsArticle">
     update cms_article
     set title = #{title,jdbcType=VARCHAR},
       author = #{author,jdbcType=VARCHAR},
@@ -418,7 +418,7 @@
       content = #{content,jdbcType=LONGVARCHAR}
     where article_id = #{articleId,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsArticle" >
+  <update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsArticle">
     update cms_article
     set title = #{title,jdbcType=VARCHAR},
       author = #{author,jdbcType=VARCHAR},

+ 1 - 1
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleTagMapper.java

@@ -6,7 +6,7 @@ import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
 public interface CmsArticleTagMapper {
-    int countByExample(CmsArticleTagExample example);
+    long countByExample(CmsArticleTagExample example);
 
     int deleteByExample(CmsArticleTagExample example);
 

+ 68 - 68
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsArticleTagMapper.xml

@@ -1,30 +1,30 @@
-<?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.CmsArticleTagMapper" >
-  <resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsArticleTag" >
-    <id column="article_tag_id" property="articleTagId" jdbcType="INTEGER" />
-    <result column="article_id" property="articleId" jdbcType="INTEGER" />
-    <result column="tag_id" property="tagId" jdbcType="INTEGER" />
+<?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.CmsArticleTagMapper">
+  <resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsArticleTag">
+    <id column="article_tag_id" jdbcType="INTEGER" property="articleTagId" />
+    <result column="article_id" jdbcType="INTEGER" property="articleId" />
+    <result column="tag_id" jdbcType="INTEGER" property="tagId" />
   </resultMap>
-  <sql id="Example_Where_Clause" >
-    <where >
-      <foreach collection="oredCriteria" item="criteria" separator="or" >
-        <if test="criteria.valid" >
-          <trim prefix="(" suffix=")" prefixOverrides="and" >
-            <foreach collection="criteria.criteria" item="criterion" >
-              <choose >
-                <when test="criterion.noValue" >
+  <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" >
+                <when test="criterion.singleValue">
                   and ${criterion.condition} #{criterion.value}
                 </when>
-                <when test="criterion.betweenValue" >
+                <when test="criterion.betweenValue">
                   and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                 </when>
-                <when test="criterion.listValue" >
+                <when test="criterion.listValue">
                   and ${criterion.condition}
-                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                     #{listItem}
                   </foreach>
                 </when>
@@ -35,25 +35,25 @@
       </foreach>
     </where>
   </sql>
-  <sql id="Update_By_Example_Where_Clause" >
-    <where >
-      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
-        <if test="criteria.valid" >
-          <trim prefix="(" suffix=")" prefixOverrides="and" >
-            <foreach collection="criteria.criteria" item="criterion" >
-              <choose >
-                <when test="criterion.noValue" >
+  <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" >
+                <when test="criterion.singleValue">
                   and ${criterion.condition} #{criterion.value}
                 </when>
-                <when test="criterion.betweenValue" >
+                <when test="criterion.betweenValue">
                   and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                 </when>
-                <when test="criterion.listValue" >
+                <when test="criterion.listValue">
                   and ${criterion.condition}
-                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                     #{listItem}
                   </foreach>
                 </when>
@@ -64,123 +64,123 @@
       </foreach>
     </where>
   </sql>
-  <sql id="Base_Column_List" >
+  <sql id="Base_Column_List">
     article_tag_id, article_id, tag_id
   </sql>
-  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.cms.dao.model.CmsArticleTagExample" >
+  <select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsArticleTagExample" resultMap="BaseResultMap">
     select
-    <if test="distinct" >
+    <if test="distinct">
       distinct
     </if>
     <include refid="Base_Column_List" />
     from cms_article_tag
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
-    <if test="orderByClause != null" >
+    <if test="orderByClause != null">
       order by ${orderByClause}
     </if>
-    <if test="limit != null" >
-      <if test="offset != null" >
+    <if test="limit != null">
+      <if test="offset != null">
         limit ${offset}, ${limit}
       </if>
-      <if test="offset == null" >
+      <if test="offset == null">
         limit ${limit}
       </if>
     </if>
   </select>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select 
     <include refid="Base_Column_List" />
     from cms_article_tag
     where article_tag_id = #{articleTagId,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from cms_article_tag
     where article_tag_id = #{articleTagId,jdbcType=INTEGER}
   </delete>
-  <delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsArticleTagExample" >
+  <delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsArticleTagExample">
     delete from cms_article_tag
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
-  <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsArticleTag" >
+  <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsArticleTag">
     insert into cms_article_tag (article_tag_id, article_id, tag_id
       )
     values (#{articleTagId,jdbcType=INTEGER}, #{articleId,jdbcType=INTEGER}, #{tagId,jdbcType=INTEGER}
       )
   </insert>
-  <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsArticleTag" >
+  <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsArticleTag">
     insert into cms_article_tag
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="articleTagId != null" >
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="articleTagId != null">
         article_tag_id,
       </if>
-      <if test="articleId != null" >
+      <if test="articleId != null">
         article_id,
       </if>
-      <if test="tagId != null" >
+      <if test="tagId != null">
         tag_id,
       </if>
     </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="articleTagId != null" >
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="articleTagId != null">
         #{articleTagId,jdbcType=INTEGER},
       </if>
-      <if test="articleId != null" >
+      <if test="articleId != null">
         #{articleId,jdbcType=INTEGER},
       </if>
-      <if test="tagId != null" >
+      <if test="tagId != null">
         #{tagId,jdbcType=INTEGER},
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsArticleTagExample" resultType="java.lang.Integer" >
+  <select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsArticleTagExample" resultType="java.lang.Long">
     select count(*) from cms_article_tag
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </select>
-  <update id="updateByExampleSelective" parameterType="map" >
+  <update id="updateByExampleSelective" parameterType="map">
     update cms_article_tag
-    <set >
-      <if test="record.articleTagId != null" >
+    <set>
+      <if test="record.articleTagId != null">
         article_tag_id = #{record.articleTagId,jdbcType=INTEGER},
       </if>
-      <if test="record.articleId != null" >
+      <if test="record.articleId != null">
         article_id = #{record.articleId,jdbcType=INTEGER},
       </if>
-      <if test="record.tagId != null" >
+      <if test="record.tagId != null">
         tag_id = #{record.tagId,jdbcType=INTEGER},
       </if>
     </set>
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByExample" parameterType="map" >
+  <update id="updateByExample" parameterType="map">
     update cms_article_tag
     set article_tag_id = #{record.articleTagId,jdbcType=INTEGER},
       article_id = #{record.articleId,jdbcType=INTEGER},
       tag_id = #{record.tagId,jdbcType=INTEGER}
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsArticleTag" >
+  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsArticleTag">
     update cms_article_tag
-    <set >
-      <if test="articleId != null" >
+    <set>
+      <if test="articleId != null">
         article_id = #{articleId,jdbcType=INTEGER},
       </if>
-      <if test="tagId != null" >
+      <if test="tagId != null">
         tag_id = #{tagId,jdbcType=INTEGER},
       </if>
     </set>
     where article_tag_id = #{articleTagId,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsArticleTag" >
+  <update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsArticleTag">
     update cms_article_tag
     set article_id = #{articleId,jdbcType=INTEGER},
       tag_id = #{tagId,jdbcType=INTEGER}

+ 1 - 1
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCategoryMapper.java

@@ -6,7 +6,7 @@ import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
 public interface CmsCategoryMapper {
-    int countByExample(CmsCategoryExample example);
+    long countByExample(CmsCategoryExample example);
 
     int deleteByExample(CmsCategoryExample example);
 

+ 103 - 103
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCategoryMapper.xml

@@ -1,37 +1,37 @@
-<?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.CmsCategoryMapper" >
-  <resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsCategory" >
-    <id column="category_id" property="categoryId" jdbcType="INTEGER" />
-    <result column="pid" property="pid" jdbcType="INTEGER" />
-    <result column="level" property="level" jdbcType="TINYINT" />
-    <result column="name" property="name" jdbcType="VARCHAR" />
-    <result column="description" property="description" jdbcType="VARCHAR" />
-    <result column="icon" property="icon" jdbcType="VARCHAR" />
-    <result column="type" property="type" jdbcType="TINYINT" />
-    <result column="alias" property="alias" jdbcType="VARCHAR" />
-    <result column="ctime" property="ctime" jdbcType="BIGINT" />
-    <result column="orders" property="orders" jdbcType="BIGINT" />
+<?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.CmsCategoryMapper">
+  <resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsCategory">
+    <id column="category_id" jdbcType="INTEGER" property="categoryId" />
+    <result column="pid" jdbcType="INTEGER" property="pid" />
+    <result column="level" jdbcType="TINYINT" property="level" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="description" jdbcType="VARCHAR" property="description" />
+    <result column="icon" jdbcType="VARCHAR" property="icon" />
+    <result column="type" jdbcType="TINYINT" property="type" />
+    <result column="alias" jdbcType="VARCHAR" property="alias" />
+    <result column="ctime" jdbcType="BIGINT" property="ctime" />
+    <result column="orders" jdbcType="BIGINT" property="orders" />
   </resultMap>
-  <sql id="Example_Where_Clause" >
-    <where >
-      <foreach collection="oredCriteria" item="criteria" separator="or" >
-        <if test="criteria.valid" >
-          <trim prefix="(" suffix=")" prefixOverrides="and" >
-            <foreach collection="criteria.criteria" item="criterion" >
-              <choose >
-                <when test="criterion.noValue" >
+  <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" >
+                <when test="criterion.singleValue">
                   and ${criterion.condition} #{criterion.value}
                 </when>
-                <when test="criterion.betweenValue" >
+                <when test="criterion.betweenValue">
                   and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                 </when>
-                <when test="criterion.listValue" >
+                <when test="criterion.listValue">
                   and ${criterion.condition}
-                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                     #{listItem}
                   </foreach>
                 </when>
@@ -42,25 +42,25 @@
       </foreach>
     </where>
   </sql>
-  <sql id="Update_By_Example_Where_Clause" >
-    <where >
-      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
-        <if test="criteria.valid" >
-          <trim prefix="(" suffix=")" prefixOverrides="and" >
-            <foreach collection="criteria.criteria" item="criterion" >
-              <choose >
-                <when test="criterion.noValue" >
+  <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" >
+                <when test="criterion.singleValue">
                   and ${criterion.condition} #{criterion.value}
                 </when>
-                <when test="criterion.betweenValue" >
+                <when test="criterion.betweenValue">
                   and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                 </when>
-                <when test="criterion.listValue" >
+                <when test="criterion.listValue">
                   and ${criterion.condition}
-                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                     #{listItem}
                   </foreach>
                 </when>
@@ -71,48 +71,48 @@
       </foreach>
     </where>
   </sql>
-  <sql id="Base_Column_List" >
+  <sql id="Base_Column_List">
     category_id, pid, level, name, description, icon, type, alias, ctime, orders
   </sql>
-  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.cms.dao.model.CmsCategoryExample" >
+  <select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsCategoryExample" resultMap="BaseResultMap">
     select
-    <if test="distinct" >
+    <if test="distinct">
       distinct
     </if>
     <include refid="Base_Column_List" />
     from cms_category
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
-    <if test="orderByClause != null" >
+    <if test="orderByClause != null">
       order by ${orderByClause}
     </if>
-    <if test="limit != null" >
-      <if test="offset != null" >
+    <if test="limit != null">
+      <if test="offset != null">
         limit ${offset}, ${limit}
       </if>
-      <if test="offset == null" >
+      <if test="offset == null">
         limit ${limit}
       </if>
     </if>
   </select>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select 
     <include refid="Base_Column_List" />
     from cms_category
     where category_id = #{categoryId,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from cms_category
     where category_id = #{categoryId,jdbcType=INTEGER}
   </delete>
-  <delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsCategoryExample" >
+  <delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsCategoryExample">
     delete from cms_category
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
-  <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsCategory" >
+  <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsCategory">
     insert into cms_category (category_id, pid, level, 
       name, description, icon, 
       type, alias, ctime, 
@@ -122,118 +122,118 @@
       #{type,jdbcType=TINYINT}, #{alias,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT}, 
       #{orders,jdbcType=BIGINT})
   </insert>
-  <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsCategory" >
+  <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsCategory">
     insert into cms_category
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="categoryId != null" >
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="categoryId != null">
         category_id,
       </if>
-      <if test="pid != null" >
+      <if test="pid != null">
         pid,
       </if>
-      <if test="level != null" >
+      <if test="level != null">
         level,
       </if>
-      <if test="name != null" >
+      <if test="name != null">
         name,
       </if>
-      <if test="description != null" >
+      <if test="description != null">
         description,
       </if>
-      <if test="icon != null" >
+      <if test="icon != null">
         icon,
       </if>
-      <if test="type != null" >
+      <if test="type != null">
         type,
       </if>
-      <if test="alias != null" >
+      <if test="alias != null">
         alias,
       </if>
-      <if test="ctime != null" >
+      <if test="ctime != null">
         ctime,
       </if>
-      <if test="orders != null" >
+      <if test="orders != null">
         orders,
       </if>
     </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="categoryId != null" >
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="categoryId != null">
         #{categoryId,jdbcType=INTEGER},
       </if>
-      <if test="pid != null" >
+      <if test="pid != null">
         #{pid,jdbcType=INTEGER},
       </if>
-      <if test="level != null" >
+      <if test="level != null">
         #{level,jdbcType=TINYINT},
       </if>
-      <if test="name != null" >
+      <if test="name != null">
         #{name,jdbcType=VARCHAR},
       </if>
-      <if test="description != null" >
+      <if test="description != null">
         #{description,jdbcType=VARCHAR},
       </if>
-      <if test="icon != null" >
+      <if test="icon != null">
         #{icon,jdbcType=VARCHAR},
       </if>
-      <if test="type != null" >
+      <if test="type != null">
         #{type,jdbcType=TINYINT},
       </if>
-      <if test="alias != null" >
+      <if test="alias != null">
         #{alias,jdbcType=VARCHAR},
       </if>
-      <if test="ctime != null" >
+      <if test="ctime != null">
         #{ctime,jdbcType=BIGINT},
       </if>
-      <if test="orders != null" >
+      <if test="orders != null">
         #{orders,jdbcType=BIGINT},
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsCategoryExample" resultType="java.lang.Integer" >
+  <select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsCategoryExample" resultType="java.lang.Long">
     select count(*) from cms_category
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </select>
-  <update id="updateByExampleSelective" parameterType="map" >
+  <update id="updateByExampleSelective" parameterType="map">
     update cms_category
-    <set >
-      <if test="record.categoryId != null" >
+    <set>
+      <if test="record.categoryId != null">
         category_id = #{record.categoryId,jdbcType=INTEGER},
       </if>
-      <if test="record.pid != null" >
+      <if test="record.pid != null">
         pid = #{record.pid,jdbcType=INTEGER},
       </if>
-      <if test="record.level != null" >
+      <if test="record.level != null">
         level = #{record.level,jdbcType=TINYINT},
       </if>
-      <if test="record.name != null" >
+      <if test="record.name != null">
         name = #{record.name,jdbcType=VARCHAR},
       </if>
-      <if test="record.description != null" >
+      <if test="record.description != null">
         description = #{record.description,jdbcType=VARCHAR},
       </if>
-      <if test="record.icon != null" >
+      <if test="record.icon != null">
         icon = #{record.icon,jdbcType=VARCHAR},
       </if>
-      <if test="record.type != null" >
+      <if test="record.type != null">
         type = #{record.type,jdbcType=TINYINT},
       </if>
-      <if test="record.alias != null" >
+      <if test="record.alias != null">
         alias = #{record.alias,jdbcType=VARCHAR},
       </if>
-      <if test="record.ctime != null" >
+      <if test="record.ctime != null">
         ctime = #{record.ctime,jdbcType=BIGINT},
       </if>
-      <if test="record.orders != null" >
+      <if test="record.orders != null">
         orders = #{record.orders,jdbcType=BIGINT},
       </if>
     </set>
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByExample" parameterType="map" >
+  <update id="updateByExample" parameterType="map">
     update cms_category
     set category_id = #{record.categoryId,jdbcType=INTEGER},
       pid = #{record.pid,jdbcType=INTEGER},
@@ -245,44 +245,44 @@
       alias = #{record.alias,jdbcType=VARCHAR},
       ctime = #{record.ctime,jdbcType=BIGINT},
       orders = #{record.orders,jdbcType=BIGINT}
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsCategory" >
+  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsCategory">
     update cms_category
-    <set >
-      <if test="pid != null" >
+    <set>
+      <if test="pid != null">
         pid = #{pid,jdbcType=INTEGER},
       </if>
-      <if test="level != null" >
+      <if test="level != null">
         level = #{level,jdbcType=TINYINT},
       </if>
-      <if test="name != null" >
+      <if test="name != null">
         name = #{name,jdbcType=VARCHAR},
       </if>
-      <if test="description != null" >
+      <if test="description != null">
         description = #{description,jdbcType=VARCHAR},
       </if>
-      <if test="icon != null" >
+      <if test="icon != null">
         icon = #{icon,jdbcType=VARCHAR},
       </if>
-      <if test="type != null" >
+      <if test="type != null">
         type = #{type,jdbcType=TINYINT},
       </if>
-      <if test="alias != null" >
+      <if test="alias != null">
         alias = #{alias,jdbcType=VARCHAR},
       </if>
-      <if test="ctime != null" >
+      <if test="ctime != null">
         ctime = #{ctime,jdbcType=BIGINT},
       </if>
-      <if test="orders != null" >
+      <if test="orders != null">
         orders = #{orders,jdbcType=BIGINT},
       </if>
     </set>
     where category_id = #{categoryId,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsCategory" >
+  <update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsCategory">
     update cms_category
     set pid = #{pid,jdbcType=INTEGER},
       level = #{level,jdbcType=TINYINT},

+ 1 - 1
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCategoryTagMapper.java

@@ -6,7 +6,7 @@ import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
 public interface CmsCategoryTagMapper {
-    int countByExample(CmsCategoryTagExample example);
+    long countByExample(CmsCategoryTagExample example);
 
     int deleteByExample(CmsCategoryTagExample example);
 

+ 68 - 68
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCategoryTagMapper.xml

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

+ 1 - 1
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCommentMapper.java

@@ -6,7 +6,7 @@ import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
 public interface CmsCommentMapper {
-    int countByExample(CmsCommentExample example);
+    long countByExample(CmsCommentExample example);
 
     int deleteByExample(CmsCommentExample example);
 

+ 107 - 107
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsCommentMapper.xml

@@ -1,38 +1,38 @@
-<?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.CmsCommentMapper" >
-  <resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsComment" >
-    <id column="comment_id" property="commentId" jdbcType="INTEGER" />
-    <result column="pid" property="pid" jdbcType="INTEGER" />
-    <result column="article_id" property="articleId" jdbcType="INTEGER" />
-    <result column="user_id" property="userId" jdbcType="INTEGER" />
-    <result column="status" property="status" jdbcType="TINYINT" />
-    <result column="ip" property="ip" jdbcType="VARCHAR" />
-    <result column="agent" property="agent" jdbcType="VARCHAR" />
-    <result column="ctime" property="ctime" jdbcType="BIGINT" />
+<?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.CmsCommentMapper">
+  <resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsComment">
+    <id column="comment_id" jdbcType="INTEGER" property="commentId" />
+    <result column="pid" jdbcType="INTEGER" property="pid" />
+    <result column="article_id" jdbcType="INTEGER" property="articleId" />
+    <result column="user_id" jdbcType="INTEGER" property="userId" />
+    <result column="status" jdbcType="TINYINT" property="status" />
+    <result column="ip" jdbcType="VARCHAR" property="ip" />
+    <result column="agent" jdbcType="VARCHAR" property="agent" />
+    <result column="ctime" jdbcType="BIGINT" property="ctime" />
   </resultMap>
-  <resultMap id="ResultMapWithBLOBs" type="com.zheng.cms.dao.model.CmsComment" extends="BaseResultMap" >
-    <result column="content" property="content" jdbcType="LONGVARCHAR" />
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.zheng.cms.dao.model.CmsComment">
+    <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="(" suffix=")" prefixOverrides="and" >
-            <foreach collection="criteria.criteria" item="criterion" >
-              <choose >
-                <when test="criterion.noValue" >
+  <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" >
+                <when test="criterion.singleValue">
                   and ${criterion.condition} #{criterion.value}
                 </when>
-                <when test="criterion.betweenValue" >
+                <when test="criterion.betweenValue">
                   and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                 </when>
-                <when test="criterion.listValue" >
+                <when test="criterion.listValue">
                   and ${criterion.condition}
-                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                     #{listItem}
                   </foreach>
                 </when>
@@ -43,25 +43,25 @@
       </foreach>
     </where>
   </sql>
-  <sql id="Update_By_Example_Where_Clause" >
-    <where >
-      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
-        <if test="criteria.valid" >
-          <trim prefix="(" suffix=")" prefixOverrides="and" >
-            <foreach collection="criteria.criteria" item="criterion" >
-              <choose >
-                <when test="criterion.noValue" >
+  <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" >
+                <when test="criterion.singleValue">
                   and ${criterion.condition} #{criterion.value}
                 </when>
-                <when test="criterion.betweenValue" >
+                <when test="criterion.betweenValue">
                   and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                 </when>
-                <when test="criterion.listValue" >
+                <when test="criterion.listValue">
                   and ${criterion.condition}
-                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                     #{listItem}
                   </foreach>
                 </when>
@@ -72,51 +72,51 @@
       </foreach>
     </where>
   </sql>
-  <sql id="Base_Column_List" >
+  <sql id="Base_Column_List">
     comment_id, pid, article_id, user_id, status, ip, agent, ctime
   </sql>
-  <sql id="Blob_Column_List" >
+  <sql id="Blob_Column_List">
     content
   </sql>
-  <select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsCommentExample" >
+  <select id="selectByExampleWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsCommentExample" resultMap="ResultMapWithBLOBs">
     select
-    <if test="distinct" >
+    <if test="distinct">
       distinct
     </if>
     <include refid="Base_Column_List" />
     ,
     <include refid="Blob_Column_List" />
     from cms_comment
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
-    <if test="orderByClause != null" >
+    <if test="orderByClause != null">
       order by ${orderByClause}
     </if>
   </select>
-  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.cms.dao.model.CmsCommentExample" >
+  <select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsCommentExample" resultMap="BaseResultMap">
     select
-    <if test="distinct" >
+    <if test="distinct">
       distinct
     </if>
     <include refid="Base_Column_List" />
     from cms_comment
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
-    <if test="orderByClause != null" >
+    <if test="orderByClause != null">
       order by ${orderByClause}
     </if>
-    <if test="limit != null" >
-      <if test="offset != null" >
+    <if test="limit != null">
+      <if test="offset != null">
         limit ${offset}, ${limit}
       </if>
-      <if test="offset == null" >
+      <if test="offset == null">
         limit ${limit}
       </if>
     </if>
   </select>
-  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
     select 
     <include refid="Base_Column_List" />
     ,
@@ -124,17 +124,17 @@
     from cms_comment
     where comment_id = #{commentId,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from cms_comment
     where comment_id = #{commentId,jdbcType=INTEGER}
   </delete>
-  <delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsCommentExample" >
+  <delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsCommentExample">
     delete from cms_comment
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
-  <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsComment" >
+  <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsComment">
     insert into cms_comment (comment_id, pid, article_id, 
       user_id, status, ip, 
       agent, ctime, content
@@ -144,109 +144,109 @@
       #{agent,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR}
       )
   </insert>
-  <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsComment" >
+  <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsComment">
     insert into cms_comment
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="commentId != null" >
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="commentId != null">
         comment_id,
       </if>
-      <if test="pid != null" >
+      <if test="pid != null">
         pid,
       </if>
-      <if test="articleId != null" >
+      <if test="articleId != null">
         article_id,
       </if>
-      <if test="userId != null" >
+      <if test="userId != null">
         user_id,
       </if>
-      <if test="status != null" >
+      <if test="status != null">
         status,
       </if>
-      <if test="ip != null" >
+      <if test="ip != null">
         ip,
       </if>
-      <if test="agent != null" >
+      <if test="agent != null">
         agent,
       </if>
-      <if test="ctime != null" >
+      <if test="ctime != null">
         ctime,
       </if>
-      <if test="content != null" >
+      <if test="content != null">
         content,
       </if>
     </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="commentId != null" >
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="commentId != null">
         #{commentId,jdbcType=INTEGER},
       </if>
-      <if test="pid != null" >
+      <if test="pid != null">
         #{pid,jdbcType=INTEGER},
       </if>
-      <if test="articleId != null" >
+      <if test="articleId != null">
         #{articleId,jdbcType=INTEGER},
       </if>
-      <if test="userId != null" >
+      <if test="userId != null">
         #{userId,jdbcType=INTEGER},
       </if>
-      <if test="status != null" >
+      <if test="status != null">
         #{status,jdbcType=TINYINT},
       </if>
-      <if test="ip != null" >
+      <if test="ip != null">
         #{ip,jdbcType=VARCHAR},
       </if>
-      <if test="agent != null" >
+      <if test="agent != null">
         #{agent,jdbcType=VARCHAR},
       </if>
-      <if test="ctime != null" >
+      <if test="ctime != null">
         #{ctime,jdbcType=BIGINT},
       </if>
-      <if test="content != null" >
+      <if test="content != null">
         #{content,jdbcType=LONGVARCHAR},
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsCommentExample" resultType="java.lang.Integer" >
+  <select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsCommentExample" resultType="java.lang.Long">
     select count(*) from cms_comment
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </select>
-  <update id="updateByExampleSelective" parameterType="map" >
+  <update id="updateByExampleSelective" parameterType="map">
     update cms_comment
-    <set >
-      <if test="record.commentId != null" >
+    <set>
+      <if test="record.commentId != null">
         comment_id = #{record.commentId,jdbcType=INTEGER},
       </if>
-      <if test="record.pid != null" >
+      <if test="record.pid != null">
         pid = #{record.pid,jdbcType=INTEGER},
       </if>
-      <if test="record.articleId != null" >
+      <if test="record.articleId != null">
         article_id = #{record.articleId,jdbcType=INTEGER},
       </if>
-      <if test="record.userId != null" >
+      <if test="record.userId != null">
         user_id = #{record.userId,jdbcType=INTEGER},
       </if>
-      <if test="record.status != null" >
+      <if test="record.status != null">
         status = #{record.status,jdbcType=TINYINT},
       </if>
-      <if test="record.ip != null" >
+      <if test="record.ip != null">
         ip = #{record.ip,jdbcType=VARCHAR},
       </if>
-      <if test="record.agent != null" >
+      <if test="record.agent != null">
         agent = #{record.agent,jdbcType=VARCHAR},
       </if>
-      <if test="record.ctime != null" >
+      <if test="record.ctime != null">
         ctime = #{record.ctime,jdbcType=BIGINT},
       </if>
-      <if test="record.content != null" >
+      <if test="record.content != null">
         content = #{record.content,jdbcType=LONGVARCHAR},
       </if>
     </set>
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByExampleWithBLOBs" parameterType="map" >
+  <update id="updateByExampleWithBLOBs" parameterType="map">
     update cms_comment
     set comment_id = #{record.commentId,jdbcType=INTEGER},
       pid = #{record.pid,jdbcType=INTEGER},
@@ -257,11 +257,11 @@
       agent = #{record.agent,jdbcType=VARCHAR},
       ctime = #{record.ctime,jdbcType=BIGINT},
       content = #{record.content,jdbcType=LONGVARCHAR}
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByExample" parameterType="map" >
+  <update id="updateByExample" parameterType="map">
     update cms_comment
     set comment_id = #{record.commentId,jdbcType=INTEGER},
       pid = #{record.pid,jdbcType=INTEGER},
@@ -271,41 +271,41 @@
       ip = #{record.ip,jdbcType=VARCHAR},
       agent = #{record.agent,jdbcType=VARCHAR},
       ctime = #{record.ctime,jdbcType=BIGINT}
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsComment" >
+  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsComment">
     update cms_comment
-    <set >
-      <if test="pid != null" >
+    <set>
+      <if test="pid != null">
         pid = #{pid,jdbcType=INTEGER},
       </if>
-      <if test="articleId != null" >
+      <if test="articleId != null">
         article_id = #{articleId,jdbcType=INTEGER},
       </if>
-      <if test="userId != null" >
+      <if test="userId != null">
         user_id = #{userId,jdbcType=INTEGER},
       </if>
-      <if test="status != null" >
+      <if test="status != null">
         status = #{status,jdbcType=TINYINT},
       </if>
-      <if test="ip != null" >
+      <if test="ip != null">
         ip = #{ip,jdbcType=VARCHAR},
       </if>
-      <if test="agent != null" >
+      <if test="agent != null">
         agent = #{agent,jdbcType=VARCHAR},
       </if>
-      <if test="ctime != null" >
+      <if test="ctime != null">
         ctime = #{ctime,jdbcType=BIGINT},
       </if>
-      <if test="content != null" >
+      <if test="content != null">
         content = #{content,jdbcType=LONGVARCHAR},
       </if>
     </set>
     where comment_id = #{commentId,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsComment" >
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsComment">
     update cms_comment
     set pid = #{pid,jdbcType=INTEGER},
       article_id = #{articleId,jdbcType=INTEGER},
@@ -317,7 +317,7 @@
       content = #{content,jdbcType=LONGVARCHAR}
     where comment_id = #{commentId,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsComment" >
+  <update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsComment">
     update cms_comment
     set pid = #{pid,jdbcType=INTEGER},
       article_id = #{articleId,jdbcType=INTEGER},

+ 1 - 1
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsTagMapper.java

@@ -6,7 +6,7 @@ import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
 public interface CmsTagMapper {
-    int countByExample(CmsTagExample example);
+    long countByExample(CmsTagExample example);
 
     int deleteByExample(CmsTagExample example);
 

+ 93 - 93
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/mapper/CmsTagMapper.xml

@@ -1,35 +1,35 @@
-<?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.CmsTagMapper" >
-  <resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsTag" >
-    <id column="tag_id" property="tagId" jdbcType="INTEGER" />
-    <result column="name" property="name" jdbcType="VARCHAR" />
-    <result column="description" property="description" jdbcType="VARCHAR" />
-    <result column="icon" property="icon" jdbcType="VARCHAR" />
-    <result column="type" property="type" jdbcType="TINYINT" />
-    <result column="alias" property="alias" jdbcType="VARCHAR" />
-    <result column="ctime" property="ctime" jdbcType="BIGINT" />
-    <result column="orders" property="orders" jdbcType="BIGINT" />
+<?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.CmsTagMapper">
+  <resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsTag">
+    <id column="tag_id" jdbcType="INTEGER" property="tagId" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="description" jdbcType="VARCHAR" property="description" />
+    <result column="icon" jdbcType="VARCHAR" property="icon" />
+    <result column="type" jdbcType="TINYINT" property="type" />
+    <result column="alias" jdbcType="VARCHAR" property="alias" />
+    <result column="ctime" jdbcType="BIGINT" property="ctime" />
+    <result column="orders" jdbcType="BIGINT" property="orders" />
   </resultMap>
-  <sql id="Example_Where_Clause" >
-    <where >
-      <foreach collection="oredCriteria" item="criteria" separator="or" >
-        <if test="criteria.valid" >
-          <trim prefix="(" suffix=")" prefixOverrides="and" >
-            <foreach collection="criteria.criteria" item="criterion" >
-              <choose >
-                <when test="criterion.noValue" >
+  <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" >
+                <when test="criterion.singleValue">
                   and ${criterion.condition} #{criterion.value}
                 </when>
-                <when test="criterion.betweenValue" >
+                <when test="criterion.betweenValue">
                   and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                 </when>
-                <when test="criterion.listValue" >
+                <when test="criterion.listValue">
                   and ${criterion.condition}
-                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                     #{listItem}
                   </foreach>
                 </when>
@@ -40,25 +40,25 @@
       </foreach>
     </where>
   </sql>
-  <sql id="Update_By_Example_Where_Clause" >
-    <where >
-      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
-        <if test="criteria.valid" >
-          <trim prefix="(" suffix=")" prefixOverrides="and" >
-            <foreach collection="criteria.criteria" item="criterion" >
-              <choose >
-                <when test="criterion.noValue" >
+  <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" >
+                <when test="criterion.singleValue">
                   and ${criterion.condition} #{criterion.value}
                 </when>
-                <when test="criterion.betweenValue" >
+                <when test="criterion.betweenValue">
                   and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                 </when>
-                <when test="criterion.listValue" >
+                <when test="criterion.listValue">
                   and ${criterion.condition}
-                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                     #{listItem}
                   </foreach>
                 </when>
@@ -69,48 +69,48 @@
       </foreach>
     </where>
   </sql>
-  <sql id="Base_Column_List" >
+  <sql id="Base_Column_List">
     tag_id, name, description, icon, type, alias, ctime, orders
   </sql>
-  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.cms.dao.model.CmsTagExample" >
+  <select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsTagExample" resultMap="BaseResultMap">
     select
-    <if test="distinct" >
+    <if test="distinct">
       distinct
     </if>
     <include refid="Base_Column_List" />
     from cms_tag
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
-    <if test="orderByClause != null" >
+    <if test="orderByClause != null">
       order by ${orderByClause}
     </if>
-    <if test="limit != null" >
-      <if test="offset != null" >
+    <if test="limit != null">
+      <if test="offset != null">
         limit ${offset}, ${limit}
       </if>
-      <if test="offset == null" >
+      <if test="offset == null">
         limit ${limit}
       </if>
     </if>
   </select>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select 
     <include refid="Base_Column_List" />
     from cms_tag
     where tag_id = #{tagId,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from cms_tag
     where tag_id = #{tagId,jdbcType=INTEGER}
   </delete>
-  <delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsTagExample" >
+  <delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsTagExample">
     delete from cms_tag
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
-  <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsTag" >
+  <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsTag">
     insert into cms_tag (tag_id, name, description, 
       icon, type, alias, 
       ctime, orders)
@@ -118,100 +118,100 @@
       #{icon,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{alias,jdbcType=VARCHAR}, 
       #{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT})
   </insert>
-  <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsTag" >
+  <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsTag">
     insert into cms_tag
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="tagId != null" >
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="tagId != null">
         tag_id,
       </if>
-      <if test="name != null" >
+      <if test="name != null">
         name,
       </if>
-      <if test="description != null" >
+      <if test="description != null">
         description,
       </if>
-      <if test="icon != null" >
+      <if test="icon != null">
         icon,
       </if>
-      <if test="type != null" >
+      <if test="type != null">
         type,
       </if>
-      <if test="alias != null" >
+      <if test="alias != null">
         alias,
       </if>
-      <if test="ctime != null" >
+      <if test="ctime != null">
         ctime,
       </if>
-      <if test="orders != null" >
+      <if test="orders != null">
         orders,
       </if>
     </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="tagId != null" >
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="tagId != null">
         #{tagId,jdbcType=INTEGER},
       </if>
-      <if test="name != null" >
+      <if test="name != null">
         #{name,jdbcType=VARCHAR},
       </if>
-      <if test="description != null" >
+      <if test="description != null">
         #{description,jdbcType=VARCHAR},
       </if>
-      <if test="icon != null" >
+      <if test="icon != null">
         #{icon,jdbcType=VARCHAR},
       </if>
-      <if test="type != null" >
+      <if test="type != null">
         #{type,jdbcType=TINYINT},
       </if>
-      <if test="alias != null" >
+      <if test="alias != null">
         #{alias,jdbcType=VARCHAR},
       </if>
-      <if test="ctime != null" >
+      <if test="ctime != null">
         #{ctime,jdbcType=BIGINT},
       </if>
-      <if test="orders != null" >
+      <if test="orders != null">
         #{orders,jdbcType=BIGINT},
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsTagExample" resultType="java.lang.Integer" >
+  <select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsTagExample" resultType="java.lang.Long">
     select count(*) from cms_tag
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </select>
-  <update id="updateByExampleSelective" parameterType="map" >
+  <update id="updateByExampleSelective" parameterType="map">
     update cms_tag
-    <set >
-      <if test="record.tagId != null" >
+    <set>
+      <if test="record.tagId != null">
         tag_id = #{record.tagId,jdbcType=INTEGER},
       </if>
-      <if test="record.name != null" >
+      <if test="record.name != null">
         name = #{record.name,jdbcType=VARCHAR},
       </if>
-      <if test="record.description != null" >
+      <if test="record.description != null">
         description = #{record.description,jdbcType=VARCHAR},
       </if>
-      <if test="record.icon != null" >
+      <if test="record.icon != null">
         icon = #{record.icon,jdbcType=VARCHAR},
       </if>
-      <if test="record.type != null" >
+      <if test="record.type != null">
         type = #{record.type,jdbcType=TINYINT},
       </if>
-      <if test="record.alias != null" >
+      <if test="record.alias != null">
         alias = #{record.alias,jdbcType=VARCHAR},
       </if>
-      <if test="record.ctime != null" >
+      <if test="record.ctime != null">
         ctime = #{record.ctime,jdbcType=BIGINT},
       </if>
-      <if test="record.orders != null" >
+      <if test="record.orders != null">
         orders = #{record.orders,jdbcType=BIGINT},
       </if>
     </set>
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByExample" parameterType="map" >
+  <update id="updateByExample" parameterType="map">
     update cms_tag
     set tag_id = #{record.tagId,jdbcType=INTEGER},
       name = #{record.name,jdbcType=VARCHAR},
@@ -221,38 +221,38 @@
       alias = #{record.alias,jdbcType=VARCHAR},
       ctime = #{record.ctime,jdbcType=BIGINT},
       orders = #{record.orders,jdbcType=BIGINT}
-    <if test="_parameter != null" >
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsTag" >
+  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsTag">
     update cms_tag
-    <set >
-      <if test="name != null" >
+    <set>
+      <if test="name != null">
         name = #{name,jdbcType=VARCHAR},
       </if>
-      <if test="description != null" >
+      <if test="description != null">
         description = #{description,jdbcType=VARCHAR},
       </if>
-      <if test="icon != null" >
+      <if test="icon != null">
         icon = #{icon,jdbcType=VARCHAR},
       </if>
-      <if test="type != null" >
+      <if test="type != null">
         type = #{type,jdbcType=TINYINT},
       </if>
-      <if test="alias != null" >
+      <if test="alias != null">
         alias = #{alias,jdbcType=VARCHAR},
       </if>
-      <if test="ctime != null" >
+      <if test="ctime != null">
         ctime = #{ctime,jdbcType=BIGINT},
       </if>
-      <if test="orders != null" >
+      <if test="orders != null">
         orders = #{orders,jdbcType=BIGINT},
       </if>
     </set>
     where tag_id = #{tagId,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsTag" >
+  <update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsTag">
     update cms_tag
     set name = #{name,jdbcType=VARCHAR},
       description = #{description,jdbcType=VARCHAR},

+ 15 - 15
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsArticle.java

@@ -6,105 +6,105 @@ public class CmsArticle implements Serializable {
     /**
      * 文章编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer articleId;
 
     /**
      * 文章标题
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String title;
 
     /**
      * 文章原作者
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String author;
 
     /**
      * 转载来源网址
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String fromurl;
 
     /**
      * 封面图
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String image;
 
     /**
      * 关键字
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String keywords;
 
     /**
      * 简介
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String description;
 
     /**
      * 类型(1:普通,2:热门...)
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Byte type;
 
     /**
      * 是否允许评论(0:不允许,1:允许)
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Byte allowcomments;
 
     /**
      * 状态(-1:不通过,0未审核,1:通过)
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Byte status;
 
     /**
      * 发布人id
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer userId;
 
     /**
      * 阅读数量
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer readnumber;
 
     /**
      * 创建时间
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Long ctime;
 
     /**
      * 排序
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Long orders;
 
     /**
      * 内容
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String content;
 

+ 3 - 3
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsArticleCategory.java

@@ -6,21 +6,21 @@ public class CmsArticleCategory implements Serializable {
     /**
      * 编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer articleCategoryId;
 
     /**
      * 文章编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer articleId;
 
     /**
      * 类目编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer categoryId;
 

+ 3 - 3
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsArticleTag.java

@@ -6,21 +6,21 @@ public class CmsArticleTag implements Serializable {
     /**
      * 编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer articleTagId;
 
     /**
      * 文章编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer articleId;
 
     /**
      * 标签编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer tagId;
 

+ 10 - 10
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsCategory.java

@@ -6,70 +6,70 @@ public class CmsCategory implements Serializable {
     /**
      * 类目编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer categoryId;
 
     /**
      * 上级编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer pid;
 
     /**
      * 层级
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Byte level;
 
     /**
      * 名称
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String name;
 
     /**
      * 描述
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String description;
 
     /**
      * 图标
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String icon;
 
     /**
      * 类型(1:普通,2:热门...)
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Byte type;
 
     /**
      * 别名
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String alias;
 
     /**
      * 创建时间
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Long ctime;
 
     /**
      * 排序
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Long orders;
 

+ 3 - 3
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsCategoryTag.java

@@ -6,21 +6,21 @@ public class CmsCategoryTag implements Serializable {
     /**
      * 编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer categoryTagId;
 
     /**
      * 类目编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer categoryId;
 
     /**
      * 标签编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer tagId;
 

+ 9 - 9
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsComment.java

@@ -6,63 +6,63 @@ public class CmsComment implements Serializable {
     /**
      * 编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer commentId;
 
     /**
      * 回复楼中楼编号回复楼中楼编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer pid;
 
     /**
      * 文章编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer articleId;
 
     /**
      * 用户编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer userId;
 
     /**
      * 状态(-1:不通过,0:未审核,1:通过)
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Byte status;
 
     /**
      * 评论人ip地址
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String ip;
 
     /**
      * 评论人终端信息
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String agent;
 
     /**
      * 创建时间
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Long ctime;
 
     /**
      * 评论内容
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String content;
 

+ 8 - 8
zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsTag.java

@@ -6,56 +6,56 @@ public class CmsTag implements Serializable {
     /**
      * 标签编号
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Integer tagId;
 
     /**
      * 名称
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String name;
 
     /**
      * 描述
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String description;
 
     /**
      * 图标
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String icon;
 
     /**
      * 类型(1:普通,2:热门...)
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Byte type;
 
     /**
      * 别名
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private String alias;
 
     /**
      * 创建时间
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Long ctime;
 
     /**
      * 排序
      *
-     * @mbggenerated
+     * @mbg.generated
      */
     private Long orders;
 

+ 4 - 4
zheng-cms/zheng-cms-dao/src/main/resources/generatorConfig.xml

@@ -8,7 +8,7 @@
     <!-- mysql驱动包 -->
     <classPathEntry location="${classPathEntry}" />
 
-    <context id="MysqlContext" defaultModelType="flat">
+    <context id="MysqlContext" targetRuntime="MyBatis3" defaultModelType="flat">
 
         <property name="javaFileEncoding" value="UTF-8"/>
         <!-- 由于beginningDelimiter和endingDelimiter的默认值为双引号("),在Mysql中不能这么写,所以还要将这两个默认值改为`  -->
@@ -55,13 +55,13 @@
                         password="${jdbc.password}" />
 
         <!-- model生成 -->
-        <javaModelGenerator targetPackage="com.zheng.cms.dao.model" targetProject="src/main/java" />
+        <javaModelGenerator targetPackage="com.zheng.cms.dao.model" targetProject="zheng-cms/zheng-cms-dao/src/main/java" />
 
         <!-- MapperXML生成 -->
-        <sqlMapGenerator targetPackage="com.zheng.cms.dao.mapper" targetProject="src/main/java" />
+        <sqlMapGenerator targetPackage="com.zheng.cms.dao.mapper" targetProject="zheng-cms/zheng-cms-dao/src/main/java" />
 
         <!-- Mapper接口生成 -->
-        <javaClientGenerator targetPackage="com.zheng.cms.dao.mapper" targetProject="src/main/java" type="XMLMAPPER" />
+        <javaClientGenerator targetPackage="com.zheng.cms.dao.mapper" targetProject="zheng-cms/zheng-cms-dao/src/main/java" type="XMLMAPPER" />
 
         <!-- 需要映射的表 -->
                 <table tableName="cms_article" domainObjectName="CmsArticle"></table>

+ 3 - 2
zheng-common/src/main/java/com/zheng/common/util/MybatisGeneratorConfigUtil.java

@@ -33,7 +33,7 @@ public class MybatisGeneratorConfigUtil {
 			String module_prefix_name) {
 		String module_path = PROJECT_NAME + "-" + module_prefix_name.replaceAll("\\.", "-") + "/" + PROJECT_NAME + "-" + module_prefix_name.replaceAll("\\.", "-") + "-dao/src/main/resources/generatorConfig.xml";
 		String sql = "SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = '" + DATABASE_NAME + "' AND table_name LIKE '" + module_prefix_name + "_%';";
-		System.out.println("========== 开始生成代码 ==========");
+		System.out.println("========== 开始生成generatorConfig.xml文件 ==========");
 		try {
 			VelocityContext context= new VelocityContext();
 			List<Map<String, Object>> tables = new ArrayList<>();
@@ -55,11 +55,12 @@ public class MybatisGeneratorConfigUtil {
 			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");
 			VelocityUtil.generate(VM_PATH, module_path, context);
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
-		System.out.println("========== 结束生成代码 ==========");
+		System.out.println("========== 结束生成generatorConfig.xml文件 ==========");
 	}
 
 }

+ 4 - 4
zheng-common/src/main/resources/generatorConfig.vm

@@ -8,7 +8,7 @@
     <!-- mysql驱动包 -->
     <classPathEntry location="${classPathEntry}" />
 
-    <context id="MysqlContext" defaultModelType="flat">
+    <context id="MysqlContext" targetRuntime="MyBatis3" defaultModelType="flat">
 
         <property name="javaFileEncoding" value="UTF-8"/>
         <!-- 由于beginningDelimiter和endingDelimiter的默认值为双引号("),在Mysql中不能这么写,所以还要将这两个默认值改为`  -->
@@ -55,13 +55,13 @@
                         password="${jdbc.password}" />
 
         <!-- model生成 -->
-        <javaModelGenerator targetPackage="${generator_javaModelGenerator_targetPackage}" targetProject="src/main/java" />
+        <javaModelGenerator targetPackage="${generator_javaModelGenerator_targetPackage}" targetProject="${targetProject}/src/main/java" />
 
         <!-- MapperXML生成 -->
-        <sqlMapGenerator targetPackage="${generator_sqlMapGenerator_targetPackage}" targetProject="src/main/java" />
+        <sqlMapGenerator targetPackage="${generator_sqlMapGenerator_targetPackage}" targetProject="${targetProject}/src/main/java" />
 
         <!-- Mapper接口生成 -->
-        <javaClientGenerator targetPackage="${generator_javaClientGenerator_targetPackage}" targetProject="src/main/java" type="XMLMAPPER" />
+        <javaClientGenerator targetPackage="${generator_javaClientGenerator_targetPackage}" targetProject="${targetProject}/src/main/java" type="XMLMAPPER" />
 
         <!-- 需要映射的表 -->
         #foreach($table in $tables)