anderx лет назад: 7
Родитель
Сommit
aadc21ce7f
19 измененных файлов с 3218 добавлено и 8 удалено
  1. 2 1
      GeneratorConfig.xml
  2. 25 0
      src/main/java/com/goafanti/common/controller/PublicController.java
  3. 76 0
      src/main/java/com/goafanti/common/dao/JtVoucherDetailMapper.java
  4. 77 0
      src/main/java/com/goafanti/common/dao/JtVoucherMapper.java
  5. 57 0
      src/main/java/com/goafanti/common/enums/VoucherSourceType.java
  6. 303 0
      src/main/java/com/goafanti/common/mapper/JtVoucherDetailMapper.xml
  7. 399 0
      src/main/java/com/goafanti/common/mapper/JtVoucherMapper.xml
  8. 214 0
      src/main/java/com/goafanti/common/model/JtVoucher.java
  9. 145 0
      src/main/java/com/goafanti/common/model/JtVoucherDetail.java
  10. 652 0
      src/main/java/com/goafanti/common/model/JtVoucherDetailExample.java
  11. 842 0
      src/main/java/com/goafanti/common/model/JtVoucherExample.java
  12. 29 7
      src/main/java/com/goafanti/user/controller/UserRegisterController.java
  13. 68 0
      src/main/java/com/goafanti/voucher/bo/JtVoucherDetailListBo.java
  14. 68 0
      src/main/java/com/goafanti/voucher/bo/JtVoucherListBo.java
  15. 96 0
      src/main/java/com/goafanti/voucher/controller/AdminVoucherController.java
  16. 20 0
      src/main/java/com/goafanti/voucher/service/VoucherDetailService.java
  17. 22 0
      src/main/java/com/goafanti/voucher/service/VoucherService.java
  18. 57 0
      src/main/java/com/goafanti/voucher/service/impl/VoucherDetailServiceImpl.java
  19. 66 0
      src/main/java/com/goafanti/voucher/service/impl/VoucherServiceImpl.java

+ 2 - 1
GeneratorConfig.xml

@@ -10,6 +10,7 @@
    <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="jitao-server" />
    <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="jitao-server" />
    <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="jitao-server" type="XMLMAPPER" />
-   <table schema="aft" tableName="jt_collect_search"/>
+   <table schema="aft" tableName="jt_voucher"/>
+   <table schema="aft" tableName="jt_voucher_detail"/>
   </context>
 </generatorConfiguration>

+ 25 - 0
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -32,6 +32,7 @@ import com.goafanti.comment.service.CommentService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.enums.UserType;
+import com.goafanti.common.model.JtVoucherDetail;
 import com.goafanti.common.model.User;
 import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.common.service.FieldGlossoryService;
@@ -43,6 +44,7 @@ import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.PictureUtils;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.demand.bo.DemandListBo;
@@ -50,6 +52,8 @@ import com.goafanti.demand.service.DemandService;
 import com.goafanti.portal.bo.AchievementObject;
 import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserService;
+import com.goafanti.voucher.service.VoucherDetailService;
+import com.goafanti.voucher.service.VoucherService;
 
 @Controller
 @Scope(value = "prototype")
@@ -105,6 +109,13 @@ public class PublicController extends BaseController {
 
 	@Resource(name = "passwordUtil")
 	private PasswordUtil			passwordUtil;
+	
+	@Resource
+	private	VoucherDetailService	voucherDetailService;
+	@Resource
+	private VoucherService		voucherService;
+	@Resource
+	private JDBCIdGenerator	jDBCIdGenerator;
 
 	/**
 	 * 获取验证码
@@ -778,4 +789,18 @@ public class PublicController extends BaseController {
 		res.data(InvitationCodeUtils.toSerialCode(new Date().getTime()));
 		return res;
 	}
+	@RequestMapping(value = "/getVoucher", method = RequestMethod.POST)
+	@ResponseBody
+	public void getVoucher(String uid){
+		List<String> ids=voucherService.getSourceVoucher(0);
+		for (String s : ids) {
+			JtVoucherDetail j=new JtVoucherDetail();
+			j.setId(jDBCIdGenerator.generateId().toString());
+			j.setReceiveTime(new Date());
+			j.setVoucherId(s);
+			j.setUseUid(uid);
+			j.setStatus(0);
+			voucherDetailService.saveVoucherDetail(j);
+		}
+	}
 }

+ 76 - 0
src/main/java/com/goafanti/common/dao/JtVoucherDetailMapper.java

@@ -0,0 +1,76 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.JtVoucherDetail;
+import com.goafanti.common.model.JtVoucherDetailExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface JtVoucherDetailMapper {
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	long countByExample(JtVoucherDetailExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int deleteByExample(JtVoucherDetailExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int deleteByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int insert(JtVoucherDetail record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int insertSelective(JtVoucherDetail record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	List<JtVoucherDetail> selectByExample(JtVoucherDetailExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	JtVoucherDetail selectByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByExampleSelective(@Param("record") JtVoucherDetail record,
+			@Param("example") JtVoucherDetailExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByExample(@Param("record") JtVoucherDetail record, @Param("example") JtVoucherDetailExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByPrimaryKeySelective(JtVoucherDetail record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByPrimaryKey(JtVoucherDetail record);
+}

+ 77 - 0
src/main/java/com/goafanti/common/dao/JtVoucherMapper.java

@@ -0,0 +1,77 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.JtVoucher;
+import com.goafanti.common.model.JtVoucherExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface JtVoucherMapper {
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	long countByExample(JtVoucherExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int deleteByExample(JtVoucherExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int deleteByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int insert(JtVoucher record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int insertSelective(JtVoucher record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	List<JtVoucher> selectByExample(JtVoucherExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	JtVoucher selectByPrimaryKey(String id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByExampleSelective(@Param("record") JtVoucher record, @Param("example") JtVoucherExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByExample(@Param("record") JtVoucher record, @Param("example") JtVoucherExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByPrimaryKeySelective(JtVoucher record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	int updateByPrimaryKey(JtVoucher record);
+
+	List<String> getSourceVoucher(Integer source);
+}

+ 57 - 0
src/main/java/com/goafanti/common/enums/VoucherSourceType.java

@@ -0,0 +1,57 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum VoucherSourceType {
+	
+	ZC(0, "注册"),
+	FQ(1, "返券"),
+	HD(2, "活动"),
+	OTHER(3, "其他");
+
+	private VoucherSourceType(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, VoucherSourceType> status = new HashMap<Integer, VoucherSourceType>();
+
+	static {
+		for (VoucherSourceType value : VoucherSourceType.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static VoucherSourceType getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static VoucherSourceType getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

+ 303 - 0
src/main/java/com/goafanti/common/mapper/JtVoucherDetailMapper.xml

@@ -0,0 +1,303 @@
+<?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.goafanti.common.dao.JtVoucherDetailMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.JtVoucherDetail">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="voucher_id" jdbcType="VARCHAR" property="voucherId" />
+    <result column="use_uid" jdbcType="VARCHAR" property="useUid" />
+    <result column="use_time" jdbcType="TIMESTAMP" property="useTime" />
+    <result column="receive_time" jdbcType="TIMESTAMP" property="receiveTime" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    id, voucher_id, use_uid, use_time, receive_time, status
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.JtVoucherDetailExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from jt_voucher_detail
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from jt_voucher_detail
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    delete from jt_voucher_detail
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.JtVoucherDetailExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    delete from jt_voucher_detail
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.JtVoucherDetail">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    insert into jt_voucher_detail (id, voucher_id, use_uid, 
+      use_time, receive_time, status
+      )
+    values (#{id,jdbcType=VARCHAR}, #{voucherId,jdbcType=VARCHAR}, #{useUid,jdbcType=VARCHAR}, 
+      #{useTime,jdbcType=TIMESTAMP}, #{receiveTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.JtVoucherDetail">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    insert into jt_voucher_detail
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="voucherId != null">
+        voucher_id,
+      </if>
+      <if test="useUid != null">
+        use_uid,
+      </if>
+      <if test="useTime != null">
+        use_time,
+      </if>
+      <if test="receiveTime != null">
+        receive_time,
+      </if>
+      <if test="status != null">
+        status,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="voucherId != null">
+        #{voucherId,jdbcType=VARCHAR},
+      </if>
+      <if test="useUid != null">
+        #{useUid,jdbcType=VARCHAR},
+      </if>
+      <if test="useTime != null">
+        #{useTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="receiveTime != null">
+        #{receiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.JtVoucherDetailExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    select count(*) from jt_voucher_detail
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher_detail
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.voucherId != null">
+        voucher_id = #{record.voucherId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.useUid != null">
+        use_uid = #{record.useUid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.useTime != null">
+        use_time = #{record.useTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.receiveTime != null">
+        receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.status != null">
+        status = #{record.status,jdbcType=INTEGER},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher_detail
+    set id = #{record.id,jdbcType=VARCHAR},
+      voucher_id = #{record.voucherId,jdbcType=VARCHAR},
+      use_uid = #{record.useUid,jdbcType=VARCHAR},
+      use_time = #{record.useTime,jdbcType=TIMESTAMP},
+      receive_time = #{record.receiveTime,jdbcType=TIMESTAMP},
+      status = #{record.status,jdbcType=INTEGER}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.JtVoucherDetail">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher_detail
+    <set>
+      <if test="voucherId != null">
+        voucher_id = #{voucherId,jdbcType=VARCHAR},
+      </if>
+      <if test="useUid != null">
+        use_uid = #{useUid,jdbcType=VARCHAR},
+      </if>
+      <if test="useTime != null">
+        use_time = #{useTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="receiveTime != null">
+        receive_time = #{receiveTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="status != null">
+        status = #{status,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.JtVoucherDetail">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher_detail
+    set voucher_id = #{voucherId,jdbcType=VARCHAR},
+      use_uid = #{useUid,jdbcType=VARCHAR},
+      use_time = #{useTime,jdbcType=TIMESTAMP},
+      receive_time = #{receiveTime,jdbcType=TIMESTAMP},
+      status = #{status,jdbcType=INTEGER}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+</mapper>

+ 399 - 0
src/main/java/com/goafanti/common/mapper/JtVoucherMapper.xml

@@ -0,0 +1,399 @@
+<?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.goafanti.common.dao.JtVoucherMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.JtVoucher">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="source" jdbcType="INTEGER" property="source" />
+    <result column="money" jdbcType="DECIMAL" property="money" />
+    <result column="duration_day" jdbcType="INTEGER" property="durationDay" />
+    <result column="active_state" jdbcType="INTEGER" property="activeState" />
+    <result column="granting_uid" jdbcType="VARCHAR" property="grantingUid" />
+    <result column="limit_use" jdbcType="INTEGER" property="limitUse" />
+    <result column="limit_project_id" jdbcType="VARCHAR" property="limitProjectId" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    id, name, source, money, duration_day, active_state, granting_uid, limit_use, limit_project_id
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.JtVoucherExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from jt_voucher
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from jt_voucher
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    delete from jt_voucher
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.JtVoucherExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    delete from jt_voucher
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.JtVoucher">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    insert into jt_voucher (id, name, source, 
+      money, duration_day, active_state, 
+      granting_uid, limit_use, limit_project_id
+      )
+    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}, 
+      #{money,jdbcType=DECIMAL}, #{durationDay,jdbcType=INTEGER}, #{activeState,jdbcType=INTEGER}, 
+      #{grantingUid,jdbcType=VARCHAR}, #{limitUse,jdbcType=INTEGER}, #{limitProjectId,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.JtVoucher">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    insert into jt_voucher
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="name != null">
+        name,
+      </if>
+      <if test="source != null">
+        source,
+      </if>
+      <if test="money != null">
+        money,
+      </if>
+      <if test="durationDay != null">
+        duration_day,
+      </if>
+      <if test="activeState != null">
+        active_state,
+      </if>
+      <if test="grantingUid != null">
+        granting_uid,
+      </if>
+      <if test="limitUse != null">
+        limit_use,
+      </if>
+      <if test="limitProjectId != null">
+        limit_project_id,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="name != null">
+        #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="source != null">
+        #{source,jdbcType=INTEGER},
+      </if>
+      <if test="money != null">
+        #{money,jdbcType=DECIMAL},
+      </if>
+      <if test="durationDay != null">
+        #{durationDay,jdbcType=INTEGER},
+      </if>
+      <if test="activeState != null">
+        #{activeState,jdbcType=INTEGER},
+      </if>
+      <if test="grantingUid != null">
+        #{grantingUid,jdbcType=VARCHAR},
+      </if>
+      <if test="limitUse != null">
+        #{limitUse,jdbcType=INTEGER},
+      </if>
+      <if test="limitProjectId != null">
+        #{limitProjectId,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.JtVoucherExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    select count(*) from jt_voucher
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.name != null">
+        name = #{record.name,jdbcType=VARCHAR},
+      </if>
+      <if test="record.source != null">
+        source = #{record.source,jdbcType=INTEGER},
+      </if>
+      <if test="record.money != null">
+        money = #{record.money,jdbcType=DECIMAL},
+      </if>
+      <if test="record.durationDay != null">
+        duration_day = #{record.durationDay,jdbcType=INTEGER},
+      </if>
+      <if test="record.activeState != null">
+        active_state = #{record.activeState,jdbcType=INTEGER},
+      </if>
+      <if test="record.grantingUid != null">
+        granting_uid = #{record.grantingUid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.limitUse != null">
+        limit_use = #{record.limitUse,jdbcType=INTEGER},
+      </if>
+      <if test="record.limitProjectId != null">
+        limit_project_id = #{record.limitProjectId,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher
+    set id = #{record.id,jdbcType=VARCHAR},
+      name = #{record.name,jdbcType=VARCHAR},
+      source = #{record.source,jdbcType=INTEGER},
+      money = #{record.money,jdbcType=DECIMAL},
+      duration_day = #{record.durationDay,jdbcType=INTEGER},
+      active_state = #{record.activeState,jdbcType=INTEGER},
+      granting_uid = #{record.grantingUid,jdbcType=VARCHAR},
+      limit_use = #{record.limitUse,jdbcType=INTEGER},
+      limit_project_id = #{record.limitProjectId,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.JtVoucher">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher
+    <set>
+      <if test="name != null">
+        name = #{name,jdbcType=VARCHAR},
+      </if>
+      <if test="source != null">
+        source = #{source,jdbcType=INTEGER},
+      </if>
+      <if test="money != null">
+        money = #{money,jdbcType=DECIMAL},
+      </if>
+      <if test="durationDay != null">
+        duration_day = #{durationDay,jdbcType=INTEGER},
+      </if>
+      <if test="activeState != null">
+        active_state = #{activeState,jdbcType=INTEGER},
+      </if>
+      <if test="grantingUid != null">
+        granting_uid = #{grantingUid,jdbcType=VARCHAR},
+      </if>
+      <if test="limitUse != null">
+        limit_use = #{limitUse,jdbcType=INTEGER},
+      </if>
+      <if test="limitProjectId != null">
+        limit_project_id = #{limitProjectId,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.JtVoucher">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 16 15:59:34 CST 2018.
+    -->
+    update jt_voucher
+    set name = #{name,jdbcType=VARCHAR},
+      source = #{source,jdbcType=INTEGER},
+      money = #{money,jdbcType=DECIMAL},
+      duration_day = #{durationDay,jdbcType=INTEGER},
+      active_state = #{activeState,jdbcType=INTEGER},
+      granting_uid = #{grantingUid,jdbcType=VARCHAR},
+      limit_use = #{limitUse,jdbcType=INTEGER},
+      limit_project_id = #{limitProjectId,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  
+  
+  <select id="selectVoucherList" resultType="com.goafanti.voucher.bo.JtVoucherListBo">
+  select
+  	id, name, source, money, duration_day as durationDay, active_state as activeState, granting_uid as grantingUid,
+  	limit_use as limitUse, limit_project_id as limitProjectId
+   from jt_voucher
+   where 1=1
+   <if test="name != null">
+		and  name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>  
+	<if test="limitUse != null">
+		and  limitUse  = #{limitUse,jdbcType=INTEGER}
+	</if>
+	<if test="activeState != null">
+		and  activeState = #{activeState,jdbcType=INTEGER}
+	</if>
+	<if test="source != null">
+		and  source = #{name,jdbcType=INTEGER}
+	</if>
+	order by name
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+   
+  </select>
+  <select id="selectVoucherCount" resultType="java.lang.Integer">
+  	 select
+  	count(*)
+   from jt_voucher
+   where 1=1
+   <if test="name != null">
+		and  name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+	</if>  
+	<if test="limitUse != null">
+		and  limitUse  = #{limitUse,jdbcType=INTEGER}
+	</if>
+	<if test="activeState != null">
+		and  activeState = #{activeState,jdbcType=INTEGER}
+	</if>
+	<if test="source != null">
+		and  source = #{name,jdbcType=INTEGER}
+	</if>
+  </select>
+  
+  <select id="getSourceVoucher" resultType="java.lang.String">
+  	select id from jt_voucher where source= #{source,jdbcType=INTEGER}
+  </select>
+  
+</mapper>

+ 214 - 0
src/main/java/com/goafanti/common/model/JtVoucher.java

@@ -0,0 +1,214 @@
+package com.goafanti.common.model;
+
+import java.math.BigDecimal;
+
+public class JtVoucher {
+
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.name
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String name;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.source
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Integer source;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.money
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private BigDecimal money;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.duration_day
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Integer durationDay;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.active_state
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Integer activeState;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.granting_uid
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String grantingUid;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.limit_use
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Integer limitUse;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher.limit_project_id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String limitProjectId;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.id
+	 * @return  the value of jt_voucher.id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.id
+	 * @param id  the value for jt_voucher.id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.name
+	 * @return  the value of jt_voucher.name
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.name
+	 * @param name  the value for jt_voucher.name
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.source
+	 * @return  the value of jt_voucher.source
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Integer getSource() {
+		return source;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.source
+	 * @param source  the value for jt_voucher.source
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setSource(Integer source) {
+		this.source = source;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.money
+	 * @return  the value of jt_voucher.money
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public BigDecimal getMoney() {
+		return money;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.money
+	 * @param money  the value for jt_voucher.money
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setMoney(BigDecimal money) {
+		this.money = money;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.duration_day
+	 * @return  the value of jt_voucher.duration_day
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Integer getDurationDay() {
+		return durationDay;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.duration_day
+	 * @param durationDay  the value for jt_voucher.duration_day
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setDurationDay(Integer durationDay) {
+		this.durationDay = durationDay;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.active_state
+	 * @return  the value of jt_voucher.active_state
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Integer getActiveState() {
+		return activeState;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.active_state
+	 * @param activeState  the value for jt_voucher.active_state
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setActiveState(Integer activeState) {
+		this.activeState = activeState;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.granting_uid
+	 * @return  the value of jt_voucher.granting_uid
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getGrantingUid() {
+		return grantingUid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.granting_uid
+	 * @param grantingUid  the value for jt_voucher.granting_uid
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setGrantingUid(String grantingUid) {
+		this.grantingUid = grantingUid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.limit_use
+	 * @return  the value of jt_voucher.limit_use
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Integer getLimitUse() {
+		return limitUse;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.limit_use
+	 * @param limitUse  the value for jt_voucher.limit_use
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setLimitUse(Integer limitUse) {
+		this.limitUse = limitUse;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher.limit_project_id
+	 * @return  the value of jt_voucher.limit_project_id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getLimitProjectId() {
+		return limitProjectId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher.limit_project_id
+	 * @param limitProjectId  the value for jt_voucher.limit_project_id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setLimitProjectId(String limitProjectId) {
+		this.limitProjectId = limitProjectId;
+	}
+}

+ 145 - 0
src/main/java/com/goafanti/common/model/JtVoucherDetail.java

@@ -0,0 +1,145 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class JtVoucherDetail {
+
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher_detail.id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher_detail.voucher_id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String voucherId;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher_detail.use_uid
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private String useUid;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher_detail.use_time
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Date useTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher_detail.receive_time
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Date receiveTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column jt_voucher_detail.status
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	private Integer status;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher_detail.id
+	 * @return  the value of jt_voucher_detail.id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher_detail.id
+	 * @param id  the value for jt_voucher_detail.id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher_detail.voucher_id
+	 * @return  the value of jt_voucher_detail.voucher_id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getVoucherId() {
+		return voucherId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher_detail.voucher_id
+	 * @param voucherId  the value for jt_voucher_detail.voucher_id
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setVoucherId(String voucherId) {
+		this.voucherId = voucherId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher_detail.use_uid
+	 * @return  the value of jt_voucher_detail.use_uid
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getUseUid() {
+		return useUid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher_detail.use_uid
+	 * @param useUid  the value for jt_voucher_detail.use_uid
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setUseUid(String useUid) {
+		this.useUid = useUid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher_detail.use_time
+	 * @return  the value of jt_voucher_detail.use_time
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Date getUseTime() {
+		return useTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher_detail.use_time
+	 * @param useTime  the value for jt_voucher_detail.use_time
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setUseTime(Date useTime) {
+		this.useTime = useTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher_detail.receive_time
+	 * @return  the value of jt_voucher_detail.receive_time
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Date getReceiveTime() {
+		return receiveTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher_detail.receive_time
+	 * @param receiveTime  the value for jt_voucher_detail.receive_time
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setReceiveTime(Date receiveTime) {
+		this.receiveTime = receiveTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column jt_voucher_detail.status
+	 * @return  the value of jt_voucher_detail.status
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Integer getStatus() {
+		return status;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column jt_voucher_detail.status
+	 * @param status  the value for jt_voucher_detail.status
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+}

+ 652 - 0
src/main/java/com/goafanti/common/model/JtVoucherDetailExample.java

@@ -0,0 +1,652 @@
+package com.goafanti.common.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class JtVoucherDetailExample {
+    /**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected String orderByClause;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected boolean distinct;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected List<Criteria> oredCriteria;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public JtVoucherDetailExample() {
+		oredCriteria = new ArrayList<Criteria>();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setOrderByClause(String orderByClause) {
+		this.orderByClause = orderByClause;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getOrderByClause() {
+		return orderByClause;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setDistinct(boolean distinct) {
+		this.distinct = distinct;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public boolean isDistinct() {
+		return distinct;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public List<Criteria> getOredCriteria() {
+		return oredCriteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void or(Criteria criteria) {
+		oredCriteria.add(criteria);
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Criteria or() {
+		Criteria criteria = createCriteriaInternal();
+		oredCriteria.add(criteria);
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Criteria createCriteria() {
+		Criteria criteria = createCriteriaInternal();
+		if (oredCriteria.size() == 0) {
+			oredCriteria.add(criteria);
+		}
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected Criteria createCriteriaInternal() {
+		Criteria criteria = new Criteria();
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void clear() {
+		oredCriteria.clear();
+		orderByClause = null;
+		distinct = false;
+	}
+
+	/**
+	 * This class was generated by MyBatis Generator. This class corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected abstract static class GeneratedCriteria {
+		protected List<Criterion> criteria;
+
+		protected GeneratedCriteria() {
+			super();
+			criteria = new ArrayList<Criterion>();
+		}
+
+		public boolean isValid() {
+			return criteria.size() > 0;
+		}
+
+		public List<Criterion> getAllCriteria() {
+			return criteria;
+		}
+
+		public List<Criterion> getCriteria() {
+			return criteria;
+		}
+
+		protected void addCriterion(String condition) {
+			if (condition == null) {
+				throw new RuntimeException("Value for condition cannot be null");
+			}
+			criteria.add(new Criterion(condition));
+		}
+
+		protected void addCriterion(String condition, Object value, String property) {
+			if (value == null) {
+				throw new RuntimeException("Value for " + property + " cannot be null");
+			}
+			criteria.add(new Criterion(condition, value));
+		}
+
+		protected void addCriterion(String condition, Object value1, Object value2, String property) {
+			if (value1 == null || value2 == null) {
+				throw new RuntimeException("Between values for " + property + " cannot be null");
+			}
+			criteria.add(new Criterion(condition, value1, value2));
+		}
+
+		public Criteria andIdIsNull() {
+			addCriterion("id is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdIsNotNull() {
+			addCriterion("id is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdEqualTo(String value) {
+			addCriterion("id =", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotEqualTo(String value) {
+			addCriterion("id <>", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdGreaterThan(String value) {
+			addCriterion("id >", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdGreaterThanOrEqualTo(String value) {
+			addCriterion("id >=", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLessThan(String value) {
+			addCriterion("id <", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLessThanOrEqualTo(String value) {
+			addCriterion("id <=", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLike(String value) {
+			addCriterion("id like", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotLike(String value) {
+			addCriterion("id not like", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdIn(List<String> values) {
+			addCriterion("id in", values, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotIn(List<String> values) {
+			addCriterion("id not in", values, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdBetween(String value1, String value2) {
+			addCriterion("id between", value1, value2, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotBetween(String value1, String value2) {
+			addCriterion("id not between", value1, value2, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdIsNull() {
+			addCriterion("voucher_id is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdIsNotNull() {
+			addCriterion("voucher_id is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdEqualTo(String value) {
+			addCriterion("voucher_id =", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdNotEqualTo(String value) {
+			addCriterion("voucher_id <>", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdGreaterThan(String value) {
+			addCriterion("voucher_id >", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdGreaterThanOrEqualTo(String value) {
+			addCriterion("voucher_id >=", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdLessThan(String value) {
+			addCriterion("voucher_id <", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdLessThanOrEqualTo(String value) {
+			addCriterion("voucher_id <=", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdLike(String value) {
+			addCriterion("voucher_id like", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdNotLike(String value) {
+			addCriterion("voucher_id not like", value, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdIn(List<String> values) {
+			addCriterion("voucher_id in", values, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdNotIn(List<String> values) {
+			addCriterion("voucher_id not in", values, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdBetween(String value1, String value2) {
+			addCriterion("voucher_id between", value1, value2, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andVoucherIdNotBetween(String value1, String value2) {
+			addCriterion("voucher_id not between", value1, value2, "voucherId");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidIsNull() {
+			addCriterion("use_uid is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidIsNotNull() {
+			addCriterion("use_uid is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidEqualTo(String value) {
+			addCriterion("use_uid =", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidNotEqualTo(String value) {
+			addCriterion("use_uid <>", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidGreaterThan(String value) {
+			addCriterion("use_uid >", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidGreaterThanOrEqualTo(String value) {
+			addCriterion("use_uid >=", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidLessThan(String value) {
+			addCriterion("use_uid <", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidLessThanOrEqualTo(String value) {
+			addCriterion("use_uid <=", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidLike(String value) {
+			addCriterion("use_uid like", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidNotLike(String value) {
+			addCriterion("use_uid not like", value, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidIn(List<String> values) {
+			addCriterion("use_uid in", values, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidNotIn(List<String> values) {
+			addCriterion("use_uid not in", values, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidBetween(String value1, String value2) {
+			addCriterion("use_uid between", value1, value2, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseUidNotBetween(String value1, String value2) {
+			addCriterion("use_uid not between", value1, value2, "useUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeIsNull() {
+			addCriterion("use_time is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeIsNotNull() {
+			addCriterion("use_time is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeEqualTo(Date value) {
+			addCriterion("use_time =", value, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeNotEqualTo(Date value) {
+			addCriterion("use_time <>", value, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeGreaterThan(Date value) {
+			addCriterion("use_time >", value, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeGreaterThanOrEqualTo(Date value) {
+			addCriterion("use_time >=", value, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeLessThan(Date value) {
+			addCriterion("use_time <", value, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeLessThanOrEqualTo(Date value) {
+			addCriterion("use_time <=", value, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeIn(List<Date> values) {
+			addCriterion("use_time in", values, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeNotIn(List<Date> values) {
+			addCriterion("use_time not in", values, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeBetween(Date value1, Date value2) {
+			addCriterion("use_time between", value1, value2, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andUseTimeNotBetween(Date value1, Date value2) {
+			addCriterion("use_time not between", value1, value2, "useTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeIsNull() {
+			addCriterion("receive_time is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeIsNotNull() {
+			addCriterion("receive_time is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeEqualTo(Date value) {
+			addCriterion("receive_time =", value, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeNotEqualTo(Date value) {
+			addCriterion("receive_time <>", value, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeGreaterThan(Date value) {
+			addCriterion("receive_time >", value, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeGreaterThanOrEqualTo(Date value) {
+			addCriterion("receive_time >=", value, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeLessThan(Date value) {
+			addCriterion("receive_time <", value, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeLessThanOrEqualTo(Date value) {
+			addCriterion("receive_time <=", value, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeIn(List<Date> values) {
+			addCriterion("receive_time in", values, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeNotIn(List<Date> values) {
+			addCriterion("receive_time not in", values, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeBetween(Date value1, Date value2) {
+			addCriterion("receive_time between", value1, value2, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andReceiveTimeNotBetween(Date value1, Date value2) {
+			addCriterion("receive_time not between", value1, value2, "receiveTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusIsNull() {
+			addCriterion("status is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusIsNotNull() {
+			addCriterion("status is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusEqualTo(Integer value) {
+			addCriterion("status =", value, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusNotEqualTo(Integer value) {
+			addCriterion("status <>", value, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusGreaterThan(Integer value) {
+			addCriterion("status >", value, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
+			addCriterion("status >=", value, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusLessThan(Integer value) {
+			addCriterion("status <", value, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusLessThanOrEqualTo(Integer value) {
+			addCriterion("status <=", value, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusIn(List<Integer> values) {
+			addCriterion("status in", values, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusNotIn(List<Integer> values) {
+			addCriterion("status not in", values, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusBetween(Integer value1, Integer value2) {
+			addCriterion("status between", value1, value2, "status");
+			return (Criteria) this;
+		}
+
+		public Criteria andStatusNotBetween(Integer value1, Integer value2) {
+			addCriterion("status not between", value1, value2, "status");
+			return (Criteria) this;
+		}
+	}
+
+	/**
+	 * This class was generated by MyBatis Generator. This class corresponds to the database table jt_voucher_detail
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public static class Criterion {
+		private String condition;
+		private Object value;
+		private Object secondValue;
+		private boolean noValue;
+		private boolean singleValue;
+		private boolean betweenValue;
+		private boolean listValue;
+		private String typeHandler;
+
+		public String getCondition() {
+			return condition;
+		}
+
+		public Object getValue() {
+			return value;
+		}
+
+		public Object getSecondValue() {
+			return secondValue;
+		}
+
+		public boolean isNoValue() {
+			return noValue;
+		}
+
+		public boolean isSingleValue() {
+			return singleValue;
+		}
+
+		public boolean isBetweenValue() {
+			return betweenValue;
+		}
+
+		public boolean isListValue() {
+			return listValue;
+		}
+
+		public String getTypeHandler() {
+			return typeHandler;
+		}
+
+		protected Criterion(String condition) {
+			super();
+			this.condition = condition;
+			this.typeHandler = null;
+			this.noValue = true;
+		}
+
+		protected Criterion(String condition, Object value, String typeHandler) {
+			super();
+			this.condition = condition;
+			this.value = value;
+			this.typeHandler = typeHandler;
+			if (value instanceof List<?>) {
+				this.listValue = true;
+			} else {
+				this.singleValue = true;
+			}
+		}
+
+		protected Criterion(String condition, Object value) {
+			this(condition, value, null);
+		}
+
+		protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+			super();
+			this.condition = condition;
+			this.value = value;
+			this.secondValue = secondValue;
+			this.typeHandler = typeHandler;
+			this.betweenValue = true;
+		}
+
+		protected Criterion(String condition, Object value, Object secondValue) {
+			this(condition, value, secondValue, null);
+		}
+	}
+
+	/**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table jt_voucher_detail
+     *
+     * @mbg.generated do_not_delete_during_merge Tue Oct 16 15:02:07 CST 2018
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+}

+ 842 - 0
src/main/java/com/goafanti/common/model/JtVoucherExample.java

@@ -0,0 +1,842 @@
+package com.goafanti.common.model;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+public class JtVoucherExample {
+    /**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected String orderByClause;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected boolean distinct;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected List<Criteria> oredCriteria;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public JtVoucherExample() {
+		oredCriteria = new ArrayList<Criteria>();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setOrderByClause(String orderByClause) {
+		this.orderByClause = orderByClause;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public String getOrderByClause() {
+		return orderByClause;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void setDistinct(boolean distinct) {
+		this.distinct = distinct;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public boolean isDistinct() {
+		return distinct;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public List<Criteria> getOredCriteria() {
+		return oredCriteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void or(Criteria criteria) {
+		oredCriteria.add(criteria);
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Criteria or() {
+		Criteria criteria = createCriteriaInternal();
+		oredCriteria.add(criteria);
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public Criteria createCriteria() {
+		Criteria criteria = createCriteriaInternal();
+		if (oredCriteria.size() == 0) {
+			oredCriteria.add(criteria);
+		}
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected Criteria createCriteriaInternal() {
+		Criteria criteria = new Criteria();
+		return criteria;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public void clear() {
+		oredCriteria.clear();
+		orderByClause = null;
+		distinct = false;
+	}
+
+	/**
+	 * This class was generated by MyBatis Generator. This class corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	protected abstract static class GeneratedCriteria {
+		protected List<Criterion> criteria;
+
+		protected GeneratedCriteria() {
+			super();
+			criteria = new ArrayList<Criterion>();
+		}
+
+		public boolean isValid() {
+			return criteria.size() > 0;
+		}
+
+		public List<Criterion> getAllCriteria() {
+			return criteria;
+		}
+
+		public List<Criterion> getCriteria() {
+			return criteria;
+		}
+
+		protected void addCriterion(String condition) {
+			if (condition == null) {
+				throw new RuntimeException("Value for condition cannot be null");
+			}
+			criteria.add(new Criterion(condition));
+		}
+
+		protected void addCriterion(String condition, Object value, String property) {
+			if (value == null) {
+				throw new RuntimeException("Value for " + property + " cannot be null");
+			}
+			criteria.add(new Criterion(condition, value));
+		}
+
+		protected void addCriterion(String condition, Object value1, Object value2, String property) {
+			if (value1 == null || value2 == null) {
+				throw new RuntimeException("Between values for " + property + " cannot be null");
+			}
+			criteria.add(new Criterion(condition, value1, value2));
+		}
+
+		public Criteria andIdIsNull() {
+			addCriterion("id is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdIsNotNull() {
+			addCriterion("id is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdEqualTo(String value) {
+			addCriterion("id =", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotEqualTo(String value) {
+			addCriterion("id <>", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdGreaterThan(String value) {
+			addCriterion("id >", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdGreaterThanOrEqualTo(String value) {
+			addCriterion("id >=", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLessThan(String value) {
+			addCriterion("id <", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLessThanOrEqualTo(String value) {
+			addCriterion("id <=", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdLike(String value) {
+			addCriterion("id like", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotLike(String value) {
+			addCriterion("id not like", value, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdIn(List<String> values) {
+			addCriterion("id in", values, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotIn(List<String> values) {
+			addCriterion("id not in", values, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdBetween(String value1, String value2) {
+			addCriterion("id between", value1, value2, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andIdNotBetween(String value1, String value2) {
+			addCriterion("id not between", value1, value2, "id");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameIsNull() {
+			addCriterion("name is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameIsNotNull() {
+			addCriterion("name is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameEqualTo(String value) {
+			addCriterion("name =", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameNotEqualTo(String value) {
+			addCriterion("name <>", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameGreaterThan(String value) {
+			addCriterion("name >", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameGreaterThanOrEqualTo(String value) {
+			addCriterion("name >=", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameLessThan(String value) {
+			addCriterion("name <", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameLessThanOrEqualTo(String value) {
+			addCriterion("name <=", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameLike(String value) {
+			addCriterion("name like", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameNotLike(String value) {
+			addCriterion("name not like", value, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameIn(List<String> values) {
+			addCriterion("name in", values, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameNotIn(List<String> values) {
+			addCriterion("name not in", values, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameBetween(String value1, String value2) {
+			addCriterion("name between", value1, value2, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andNameNotBetween(String value1, String value2) {
+			addCriterion("name not between", value1, value2, "name");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceIsNull() {
+			addCriterion("source is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceIsNotNull() {
+			addCriterion("source is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceEqualTo(Integer value) {
+			addCriterion("source =", value, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceNotEqualTo(Integer value) {
+			addCriterion("source <>", value, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceGreaterThan(Integer value) {
+			addCriterion("source >", value, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceGreaterThanOrEqualTo(Integer value) {
+			addCriterion("source >=", value, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceLessThan(Integer value) {
+			addCriterion("source <", value, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceLessThanOrEqualTo(Integer value) {
+			addCriterion("source <=", value, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceIn(List<Integer> values) {
+			addCriterion("source in", values, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceNotIn(List<Integer> values) {
+			addCriterion("source not in", values, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceBetween(Integer value1, Integer value2) {
+			addCriterion("source between", value1, value2, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andSourceNotBetween(Integer value1, Integer value2) {
+			addCriterion("source not between", value1, value2, "source");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyIsNull() {
+			addCriterion("money is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyIsNotNull() {
+			addCriterion("money is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyEqualTo(BigDecimal value) {
+			addCriterion("money =", value, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyNotEqualTo(BigDecimal value) {
+			addCriterion("money <>", value, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyGreaterThan(BigDecimal value) {
+			addCriterion("money >", value, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyGreaterThanOrEqualTo(BigDecimal value) {
+			addCriterion("money >=", value, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyLessThan(BigDecimal value) {
+			addCriterion("money <", value, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyLessThanOrEqualTo(BigDecimal value) {
+			addCriterion("money <=", value, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyIn(List<BigDecimal> values) {
+			addCriterion("money in", values, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyNotIn(List<BigDecimal> values) {
+			addCriterion("money not in", values, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyBetween(BigDecimal value1, BigDecimal value2) {
+			addCriterion("money between", value1, value2, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andMoneyNotBetween(BigDecimal value1, BigDecimal value2) {
+			addCriterion("money not between", value1, value2, "money");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayIsNull() {
+			addCriterion("duration_day is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayIsNotNull() {
+			addCriterion("duration_day is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayEqualTo(Integer value) {
+			addCriterion("duration_day =", value, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayNotEqualTo(Integer value) {
+			addCriterion("duration_day <>", value, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayGreaterThan(Integer value) {
+			addCriterion("duration_day >", value, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayGreaterThanOrEqualTo(Integer value) {
+			addCriterion("duration_day >=", value, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayLessThan(Integer value) {
+			addCriterion("duration_day <", value, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayLessThanOrEqualTo(Integer value) {
+			addCriterion("duration_day <=", value, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayIn(List<Integer> values) {
+			addCriterion("duration_day in", values, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayNotIn(List<Integer> values) {
+			addCriterion("duration_day not in", values, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayBetween(Integer value1, Integer value2) {
+			addCriterion("duration_day between", value1, value2, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andDurationDayNotBetween(Integer value1, Integer value2) {
+			addCriterion("duration_day not between", value1, value2, "durationDay");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateIsNull() {
+			addCriterion("active_state is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateIsNotNull() {
+			addCriterion("active_state is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateEqualTo(Integer value) {
+			addCriterion("active_state =", value, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateNotEqualTo(Integer value) {
+			addCriterion("active_state <>", value, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateGreaterThan(Integer value) {
+			addCriterion("active_state >", value, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateGreaterThanOrEqualTo(Integer value) {
+			addCriterion("active_state >=", value, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateLessThan(Integer value) {
+			addCriterion("active_state <", value, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateLessThanOrEqualTo(Integer value) {
+			addCriterion("active_state <=", value, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateIn(List<Integer> values) {
+			addCriterion("active_state in", values, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateNotIn(List<Integer> values) {
+			addCriterion("active_state not in", values, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateBetween(Integer value1, Integer value2) {
+			addCriterion("active_state between", value1, value2, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andActiveStateNotBetween(Integer value1, Integer value2) {
+			addCriterion("active_state not between", value1, value2, "activeState");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidIsNull() {
+			addCriterion("granting_uid is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidIsNotNull() {
+			addCriterion("granting_uid is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidEqualTo(String value) {
+			addCriterion("granting_uid =", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidNotEqualTo(String value) {
+			addCriterion("granting_uid <>", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidGreaterThan(String value) {
+			addCriterion("granting_uid >", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidGreaterThanOrEqualTo(String value) {
+			addCriterion("granting_uid >=", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidLessThan(String value) {
+			addCriterion("granting_uid <", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidLessThanOrEqualTo(String value) {
+			addCriterion("granting_uid <=", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidLike(String value) {
+			addCriterion("granting_uid like", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidNotLike(String value) {
+			addCriterion("granting_uid not like", value, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidIn(List<String> values) {
+			addCriterion("granting_uid in", values, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidNotIn(List<String> values) {
+			addCriterion("granting_uid not in", values, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidBetween(String value1, String value2) {
+			addCriterion("granting_uid between", value1, value2, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andGrantingUidNotBetween(String value1, String value2) {
+			addCriterion("granting_uid not between", value1, value2, "grantingUid");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseIsNull() {
+			addCriterion("limit_use is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseIsNotNull() {
+			addCriterion("limit_use is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseEqualTo(Integer value) {
+			addCriterion("limit_use =", value, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseNotEqualTo(Integer value) {
+			addCriterion("limit_use <>", value, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseGreaterThan(Integer value) {
+			addCriterion("limit_use >", value, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseGreaterThanOrEqualTo(Integer value) {
+			addCriterion("limit_use >=", value, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseLessThan(Integer value) {
+			addCriterion("limit_use <", value, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseLessThanOrEqualTo(Integer value) {
+			addCriterion("limit_use <=", value, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseIn(List<Integer> values) {
+			addCriterion("limit_use in", values, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseNotIn(List<Integer> values) {
+			addCriterion("limit_use not in", values, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseBetween(Integer value1, Integer value2) {
+			addCriterion("limit_use between", value1, value2, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitUseNotBetween(Integer value1, Integer value2) {
+			addCriterion("limit_use not between", value1, value2, "limitUse");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdIsNull() {
+			addCriterion("limit_project_id is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdIsNotNull() {
+			addCriterion("limit_project_id is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdEqualTo(String value) {
+			addCriterion("limit_project_id =", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdNotEqualTo(String value) {
+			addCriterion("limit_project_id <>", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdGreaterThan(String value) {
+			addCriterion("limit_project_id >", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdGreaterThanOrEqualTo(String value) {
+			addCriterion("limit_project_id >=", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdLessThan(String value) {
+			addCriterion("limit_project_id <", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdLessThanOrEqualTo(String value) {
+			addCriterion("limit_project_id <=", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdLike(String value) {
+			addCriterion("limit_project_id like", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdNotLike(String value) {
+			addCriterion("limit_project_id not like", value, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdIn(List<String> values) {
+			addCriterion("limit_project_id in", values, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdNotIn(List<String> values) {
+			addCriterion("limit_project_id not in", values, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdBetween(String value1, String value2) {
+			addCriterion("limit_project_id between", value1, value2, "limitProjectId");
+			return (Criteria) this;
+		}
+
+		public Criteria andLimitProjectIdNotBetween(String value1, String value2) {
+			addCriterion("limit_project_id not between", value1, value2, "limitProjectId");
+			return (Criteria) this;
+		}
+	}
+
+	/**
+	 * This class was generated by MyBatis Generator. This class corresponds to the database table jt_voucher
+	 * @mbg.generated  Tue Oct 16 15:59:34 CST 2018
+	 */
+	public static class Criterion {
+		private String condition;
+		private Object value;
+		private Object secondValue;
+		private boolean noValue;
+		private boolean singleValue;
+		private boolean betweenValue;
+		private boolean listValue;
+		private String typeHandler;
+
+		public String getCondition() {
+			return condition;
+		}
+
+		public Object getValue() {
+			return value;
+		}
+
+		public Object getSecondValue() {
+			return secondValue;
+		}
+
+		public boolean isNoValue() {
+			return noValue;
+		}
+
+		public boolean isSingleValue() {
+			return singleValue;
+		}
+
+		public boolean isBetweenValue() {
+			return betweenValue;
+		}
+
+		public boolean isListValue() {
+			return listValue;
+		}
+
+		public String getTypeHandler() {
+			return typeHandler;
+		}
+
+		protected Criterion(String condition) {
+			super();
+			this.condition = condition;
+			this.typeHandler = null;
+			this.noValue = true;
+		}
+
+		protected Criterion(String condition, Object value, String typeHandler) {
+			super();
+			this.condition = condition;
+			this.value = value;
+			this.typeHandler = typeHandler;
+			if (value instanceof List<?>) {
+				this.listValue = true;
+			} else {
+				this.singleValue = true;
+			}
+		}
+
+		protected Criterion(String condition, Object value) {
+			this(condition, value, null);
+		}
+
+		protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+			super();
+			this.condition = condition;
+			this.value = value;
+			this.secondValue = secondValue;
+			this.typeHandler = typeHandler;
+			this.betweenValue = true;
+		}
+
+		protected Criterion(String condition, Object value, Object secondValue) {
+			this(condition, value, secondValue, null);
+		}
+	}
+
+	/**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table jt_voucher
+     *
+     * @mbg.generated do_not_delete_during_merge Tue Oct 16 15:03:29 CST 2018
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+}

+ 29 - 7
src/main/java/com/goafanti/user/controller/UserRegisterController.java

@@ -1,22 +1,18 @@
 package com.goafanti.user.controller;
 
 import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
 import java.util.UUID;
-
 import javax.annotation.Resource;
 import javax.validation.Valid;
-
 import org.apache.commons.lang3.StringUtils;
 import org.apache.log4j.Logger;
-import org.apache.shiro.crypto.hash.SimpleHash;
-import org.springframework.http.HttpMethod;
 import org.springframework.stereotype.Controller;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
-
-import com.alibaba.fastjson.JSONObject;
 import com.goafanti.admin.service.AdminService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
@@ -25,16 +21,19 @@ import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.enums.UserAuthentication;
 import com.goafanti.common.enums.UserFields;
 import com.goafanti.common.enums.UserLevel;
+import com.goafanti.common.model.JtVoucherDetail;
 import com.goafanti.common.model.User;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.easemob.EasemobUtils;
-import com.goafanti.easemob.bo.EasemobInfo;
 import com.goafanti.message.service.MessageService;
 import com.goafanti.user.bo.InputUser;
 import com.goafanti.user.service.UserService;
+import com.goafanti.voucher.service.VoucherDetailService;
+import com.goafanti.voucher.service.VoucherService;
 
 @Controller
 public class UserRegisterController extends BaseController {
@@ -48,6 +47,12 @@ public class UserRegisterController extends BaseController {
 	private MessageService messageService;
 	@Resource
 	private EasemobUtils   easemobUtils;
+	@Resource
+	private JDBCIdGenerator	jDBCIdGenerator;
+	@Resource
+	private	VoucherDetailService	voucherDetailService;
+	@Resource
+	private VoucherService		voucherService;
 	Logger					logger	= Logger.getLogger(UserRegisterController.class);
 	
 	/**
@@ -106,6 +111,8 @@ public class UserRegisterController extends BaseController {
 			us.setAuthentication(UserAuthentication.UN_AUTHENTICATION.getCode());
 			us.setTransferTime(now.getTime());
 			userService.insertRegister(us,user.getUnitName(),user.getUsername());
+			//获得抵用券
+			getVoucher(us.getId());
 		}
 		return res;
 	}
@@ -167,10 +174,25 @@ public class UserRegisterController extends BaseController {
 			us.setAuthentication(UserAuthentication.UN_AUTHENTICATION.getCode());
 			us.setTransferTime(now.getTime());
 			userService.insertRegister(us,user.getUnitName(),user.getUsername());
+			//获得抵用券
+			getVoucher(us.getId());
 		}
 		return res;
 	}
 	
+	public void getVoucher(String uid){
+		List<String> ids=voucherService.getSourceVoucher(0);
+		for (String s : ids) {
+			JtVoucherDetail j=new JtVoucherDetail();
+			j.setId(jDBCIdGenerator.generateId().toString());
+			j.setReceiveTime(new Date());
+			j.setVoucherId(s);
+			j.setUseUid(uid);
+			j.setStatus(0);
+			voucherDetailService.saveVoucherDetail(j);
+		}
+	}
+	
 	/*private void registerEasemobAfterRegister(String uuid,User u){
 			JSONObject resultObj = new JSONObject();
 			String easemobName =  String.valueOf(u.getNumber());

+ 68 - 0
src/main/java/com/goafanti/voucher/bo/JtVoucherDetailListBo.java

@@ -0,0 +1,68 @@
+package com.goafanti.voucher.bo;
+
+public class JtVoucherDetailListBo {
+		private String id;
+		private String name;
+		private String source;
+		private String money;
+		private String durationDay;
+		private String activeState;
+		private String grantingUid;
+		private String limitUse;
+		private String limitProjectId;
+		public String getId() {
+			return id;
+		}
+		public void setId(String id) {
+			this.id = id;
+		}
+		public String getName() {
+			return name;
+		}
+		public void setName(String name) {
+			this.name = name;
+		}
+		public String getSource() {
+			return source;
+		}
+		public void setSource(String source) {
+			this.source = source;
+		}
+		public String getMoney() {
+			return money;
+		}
+		public void setMoney(String money) {
+			this.money = money;
+		}
+		public String getDurationDay() {
+			return durationDay;
+		}
+		public void setDurationDay(String durationDay) {
+			this.durationDay = durationDay;
+		}
+		public String getActiveState() {
+			return activeState;
+		}
+		public void setActiveState(String activeState) {
+			this.activeState = activeState;
+		}
+		public String getGrantingUid() {
+			return grantingUid;
+		}
+		public void setGrantingUid(String grantingUid) {
+			this.grantingUid = grantingUid;
+		}
+		public String getLimitUse() {
+			return limitUse;
+		}
+		public void setLimitUse(String limitUse) {
+			this.limitUse = limitUse;
+		}
+		public String getLimitProjectId() {
+			return limitProjectId;
+		}
+		public void setLimitProjectId(String limitProjectId) {
+			this.limitProjectId = limitProjectId;
+		}
+		
+}

+ 68 - 0
src/main/java/com/goafanti/voucher/bo/JtVoucherListBo.java

@@ -0,0 +1,68 @@
+package com.goafanti.voucher.bo;
+
+public class JtVoucherListBo {
+		private String id;
+		private String name;
+		private String source;
+		private String money;
+		private String durationDay;
+		private String activeState;
+		private String grantingUid;
+		private String limitUse;
+		private String limitProjectId;
+		public String getId() {
+			return id;
+		}
+		public void setId(String id) {
+			this.id = id;
+		}
+		public String getName() {
+			return name;
+		}
+		public void setName(String name) {
+			this.name = name;
+		}
+		public String getSource() {
+			return source;
+		}
+		public void setSource(String source) {
+			this.source = source;
+		}
+		public String getMoney() {
+			return money;
+		}
+		public void setMoney(String money) {
+			this.money = money;
+		}
+		public String getDurationDay() {
+			return durationDay;
+		}
+		public void setDurationDay(String durationDay) {
+			this.durationDay = durationDay;
+		}
+		public String getActiveState() {
+			return activeState;
+		}
+		public void setActiveState(String activeState) {
+			this.activeState = activeState;
+		}
+		public String getGrantingUid() {
+			return grantingUid;
+		}
+		public void setGrantingUid(String grantingUid) {
+			this.grantingUid = grantingUid;
+		}
+		public String getLimitUse() {
+			return limitUse;
+		}
+		public void setLimitUse(String limitUse) {
+			this.limitUse = limitUse;
+		}
+		public String getLimitProjectId() {
+			return limitProjectId;
+		}
+		public void setLimitProjectId(String limitProjectId) {
+			this.limitProjectId = limitProjectId;
+		}
+		
+}

+ 96 - 0
src/main/java/com/goafanti/voucher/controller/AdminVoucherController.java

@@ -0,0 +1,96 @@
+package com.goafanti.voucher.controller;
+
+import javax.annotation.Resource;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.model.JtVoucher;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.voucher.service.VoucherDetailService;
+import com.goafanti.voucher.service.VoucherService;
+
+@RestController
+@RequestMapping(value = "/open/api/admin/voucher")
+public class AdminVoucherController extends CertifyApiController {
+	 @Resource
+	 private VoucherService		voucherService;
+	 @Resource
+	private VoucherDetailService voucherDetailService;
+
+	 
+	 
+	 @RequestMapping(value = "/save" ,method=RequestMethod.POST)
+	 public Result saveVoucher(JtVoucher voucher ){
+		 Result result=new Result();
+		 chack(voucher, result);
+		 if (!result.getError().isEmpty()) {
+			 return result;	
+		}
+		 result.data(voucherService.saveVoucher(voucher));
+		 return result;
+	 }
+	 @RequestMapping(value = "/update" ,method=RequestMethod.POST)
+	 public Result updateVoucher(JtVoucher voucher ){
+		 Result result=new Result();
+		 chack(voucher, result);
+		 if (!result.getError().isEmpty()) {
+			 return result;	
+		}
+		 if(voucher.getActiveState()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"活动标识","活动标识"));return result;
+	    	}
+		 result.data(voucherService.updateVoucher(voucher));
+		 return result;
+	 }
+	 @RequestMapping(value = "/delect" ,method=RequestMethod.POST)
+	 public Result delectVoucher(String  id ){
+		 Result result=new Result();
+		 result.data(voucherService.delectVoucher(id));
+		 return result;
+	 }
+	 @RequestMapping(value = "/select" ,method=RequestMethod.GET)
+	 public Result selectVoucher(String  id ){
+		 Result result=new Result();
+		 result.data(voucherService.selectVoucher(id));
+		 return result;
+	 }
+	 @RequestMapping(value = "/selectList" ,method=RequestMethod.GET)
+	 public Result selectVoucherList(String name,Integer limitUse,Integer activeState,Integer source,Integer pageNo,Integer pageSize){
+		 Result result=new Result();
+		 result.data(voucherService.selectVoucherList(name, limitUse, activeState, source, pageNo, pageSize));
+		 return result;
+	 }
+	 
+	 @RequestMapping(value = "/selectDetailList" ,method=RequestMethod.GET)
+	 public Result selectVoucherDetailList(String name,Integer status,String userMobile,Integer source,Integer pageNo,Integer pageSize){
+		 Result result=new Result();
+		 result.data(voucherDetailService.selectVoucherDetailList(name, status, userMobile,source, pageNo, pageSize));
+		 return result;
+	 }
+	 
+
+
+
+	private Result chack(JtVoucher voucher, Result result) {
+		
+		if(StringUtils.isBlank(voucher.getName())) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"名称","名称"));return result;
+	    	}
+		 if(voucher.getSource()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"来源","来源"));return result;
+	    	}
+	    if(voucher.getMoney()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"面额","面额"));return result;
+	    	}
+	    if(voucher.getDurationDay()==null) {
+	    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"使用期限","使用期限"));return result;
+	    	}
+	    
+    
+	    return result;
+	}
+}

+ 20 - 0
src/main/java/com/goafanti/voucher/service/VoucherDetailService.java

@@ -0,0 +1,20 @@
+package com.goafanti.voucher.service;
+
+import com.goafanti.common.model.JtVoucher;
+import com.goafanti.common.model.JtVoucherDetail;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.voucher.bo.JtVoucherDetailListBo;
+
+public interface VoucherDetailService {
+	int saveVoucherDetail(JtVoucherDetail voucher);
+	
+	int updateVoucherDetail(JtVoucherDetail voucher);
+	
+	int delectVoucherDetail(String id);
+	
+	JtVoucher selectVoucherDetail(String id);
+	
+	Pagination<JtVoucherDetailListBo> selectVoucherDetailList(String name,Integer limitUse,String userMobile,Integer source,Integer pageNo,Integer pageSize);
+	
+	
+}

+ 22 - 0
src/main/java/com/goafanti/voucher/service/VoucherService.java

@@ -0,0 +1,22 @@
+package com.goafanti.voucher.service;
+
+import java.util.List;
+
+import com.goafanti.common.model.JtVoucher;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.voucher.bo.JtVoucherListBo;
+
+public interface VoucherService {
+	int saveVoucher(JtVoucher voucher);
+	
+	int updateVoucher(JtVoucher voucher);
+	
+	int delectVoucher(String id);
+	
+	JtVoucher selectVoucher(String id);
+	
+	Pagination<JtVoucherListBo> selectVoucherList(String name,Integer limitUse,Integer activeState,Integer source,Integer pageNo,Integer pageSize);
+	
+	
+	List<String> getSourceVoucher(Integer source);
+}

+ 57 - 0
src/main/java/com/goafanti/voucher/service/impl/VoucherDetailServiceImpl.java

@@ -0,0 +1,57 @@
+package com.goafanti.voucher.service.impl;
+
+
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.JtVoucherDetailMapper;
+
+import com.goafanti.common.model.JtVoucher;
+import com.goafanti.common.model.JtVoucherDetail;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.voucher.bo.JtVoucherDetailListBo;
+import com.goafanti.voucher.bo.JtVoucherListBo;
+import com.goafanti.voucher.service.VoucherDetailService;
+@Service
+public class VoucherDetailServiceImpl extends BaseMybatisDao<JtVoucherDetailMapper> implements VoucherDetailService {
+
+	@Autowired
+	JtVoucherDetailMapper jtVoucherDetailMapper;
+
+	@Override
+	public int saveVoucherDetail(JtVoucherDetail voucher) {
+		return jtVoucherDetailMapper.insertSelective(voucher);
+	}
+
+	@Override
+	public int updateVoucherDetail(JtVoucherDetail voucher) {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public int delectVoucherDetail(String id) {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public JtVoucher selectVoucherDetail(String id) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	
+	@Override
+	public Pagination<JtVoucherDetailListBo> selectVoucherDetailList(String name, Integer limitUse, String userMobile,
+			Integer source, Integer pageNo, Integer pageSize) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	
+
+	
+}

+ 66 - 0
src/main/java/com/goafanti/voucher/service/impl/VoucherServiceImpl.java

@@ -0,0 +1,66 @@
+package com.goafanti.voucher.service.impl;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.JtVoucherMapper;
+import com.goafanti.common.enums.VoucherSourceType;
+import com.goafanti.common.model.JtVoucher;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.voucher.bo.JtVoucherListBo;
+import com.goafanti.voucher.service.VoucherService;
+@Service
+public class VoucherServiceImpl extends BaseMybatisDao<JtVoucherMapper> implements VoucherService {
+
+	@Autowired
+	JtVoucherMapper jtVoucherMapper;
+	@Override
+	public int saveVoucher(JtVoucher v) {
+		v.setId(UUID.randomUUID().toString());
+		v.setActiveState(1);//活动进行中
+		return jtVoucherMapper.insertSelective(v);
+	}
+
+	@Override
+	public int updateVoucher(JtVoucher v) {
+		return jtVoucherMapper.updateByPrimaryKeySelective(v);
+	}
+
+	@Override
+	public int delectVoucher(String id) {
+		return jtVoucherMapper.deleteByPrimaryKey(id);
+	}
+
+	@Override
+	public JtVoucher selectVoucher(String id) {
+		return jtVoucherMapper.selectByPrimaryKey(id);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<JtVoucherListBo> selectVoucherList(String name, Integer limitUse, Integer activeState, Integer source,
+			Integer pageNo, Integer pageSize) {
+		Map<String,Object> params = new HashMap<>();
+		if (pageNo==null||pageNo<1) pageNo=1;
+		if (pageSize==null||pageSize<1) pageSize=10;
+		if (StringUtils.isNotBlank(name)) params.put("name", name);
+		if (null != limitUse) params.put("limitUse", limitUse);
+		if (null != activeState) params.put("activeState", activeState);
+		if (null != source) params.put("category", source);
+		return (Pagination<JtVoucherListBo>) findPage("selectVoucherList", "selectVoucherCount",params,
+				pageNo, pageSize);
+	}
+
+	@Override
+	public List<String> getSourceVoucher(Integer source) {
+		return jtVoucherMapper.getSourceVoucher(source);
+	}
+
+}