Browse Source

最新后台代码

5 năm trước cách đây
mục cha
commit
5e274b45c1

+ 101 - 51
minigame/src/com/hssx/controller/PrizeController.java

@@ -18,11 +18,14 @@ import org.springframework.web.bind.annotation.RequestParam;
 
 import com.hssx.entity.Prize;
 import com.hssx.entity.PrizeExample;
+import com.hssx.entity.PrizeOpportunity;
 import com.hssx.entity.PrizeRecord;
 import com.hssx.entity.PrizeRecordExample;
 import com.hssx.entity.User;
+import com.hssx.entity.UserPrizeCount;
 import com.hssx.entity.UserPrizeCountExample;
 import com.hssx.mapper.PrizeMapper;
+import com.hssx.mapper.PrizeOpportunityMapper;
 import com.hssx.mapper.PrizeRecordMapper;
 import com.hssx.mapper.UserMapper;
 import com.hssx.mapper.UserPrizeCountMapper;
@@ -41,6 +44,8 @@ public class PrizeController {
 	PrizeRecordMapper prizeRecordMapper;
 	@Autowired
 	UserPrizeCountMapper UserPrizeCountMapper;
+	@Autowired
+	PrizeOpportunityMapper prizeOpportunityMapper;
 
 	/**
 	 * 小游戏抽奖 参数: userId:当前抽奖人id
@@ -60,60 +65,35 @@ public class PrizeController {
 		prizeRecord.setNickName(user.getNickName());
 		UserPrizeCountExample uExp = new UserPrizeCountExample();
 		Integer luckDrawCount = UserPrizeCountMapper.selectCountByToday();
-		if (luckDrawCount < 2) {
-			synchronized (this) {
-				Random ran = new Random();
-				int num = ran.nextInt(9999);
-				Prize prize = prizeMapper.selectByPrimaryKey(num);
-				if (prize == null) {
-					count = -1;
-				} else {
-					if (prize.getPrizeLevel() == 0 && prize.getIsSelected() == 0) {
-						count = 0;
-						// prize.setIsSelected(1);
-						// prizeMapper.updateByPrimaryKeySelective(prize);
-						prizeRecord.setPrizeId(prize.getPrizeLevel());
-						prizeRecord.setPrize(prize.getName());
-						prizeRecordMapper.insert(prizeRecord);
-					} else if (prize.getPrizeLevel() == 1 && prize.getIsSelected() == 0) {
-						count = 1;
-						// prize.setIsSelected(1);
-						// prizeMapper.updateByPrimaryKeySelective(prize);
-						prizeRecord.setPrizeId(prize.getPrizeLevel());
-						prizeRecord.setPrize(prize.getName());
-						prizeRecordMapper.insert(prizeRecord);
-					} else if (prize.getPrizeLevel() == 2 && prize.getIsSelected() == 0) {
-						count = 2;
-						// prize.setIsSelected(1);
-						// prizeMapper.updateByPrimaryKeySelective(prize);
-						prizeRecord.setPrizeId(prize.getPrizeLevel());
-						prizeRecord.setPrize(prize.getName());
-						prizeRecordMapper.insert(prizeRecord);
-					} else if (prize.getPrizeLevel() == 3 && prize.getIsSelected() == 0) {
-						count = 3;
-						// prize.setIsSelected(1);
-						// prizeMapper.updateByPrimaryKeySelective(prize);
-						prizeRecord.setPrizeId(prize.getPrizeLevel());
-						prizeRecord.setPrize(prize.getName());
-						prizeRecordMapper.insert(prizeRecord);
-					} else if (prize.getPrizeLevel() == 4 && prize.getIsSelected() == 0) {
-						count = 4;
-						// prize.setIsSelected(1);
-						// prizeMapper.updateByPrimaryKeySelective(prize);
-						prizeRecord.setPrizeId(prize.getPrizeLevel());
-						prizeRecord.setPrize(prize.getName());
-						prizeRecordMapper.insert(prizeRecord);
-					} else {
-						count = -1;
-					}
-				}
-			}
-			HashMap<String, Object> map = new HashMap<String, Object>();
+		HashMap<String, Object> map = new HashMap<String, Object>();
+		if (luckDrawCount == 0) {
+			// 直接抽奖
+			count = getLuckDraw(prizeRecord, count);
+			// 添加抽奖记录
+			UserPrizeCount userPrizeCount = new UserPrizeCount();
+			userPrizeCount.setUserId(userId);
+			UserPrizeCountMapper.insert(userPrizeCount);
 			map.put("prizeLevel", count);
 			map.put("prizeRecord", prizeRecord);
 			msg.data = map;
-		}else{
-			
+		} else if (luckDrawCount == 1) {
+			int opportunityCount = prizeOpportunityMapper.selectCountByToday();
+			if (opportunityCount > 0) {
+				// 直接抽奖
+				count = getLuckDraw(prizeRecord, count);
+				// 添加抽奖记录
+				UserPrizeCount userPrizeCount = new UserPrizeCount();
+				userPrizeCount.setUserId(userId);
+				UserPrizeCountMapper.insert(userPrizeCount);
+				map.put("prizeLevel", count);
+				map.put("prizeRecord", prizeRecord);
+				msg.data = map;
+			}else{
+				msg.setError("抽奖次数已达上限,去分享即可添加分享机会");
+			}
+
+		} else {
+			msg.setError("抽奖次数已达上限");
 		}
 		response.setContentType("application/json");
 		response.setCharacterEncoding("UTF-8");
@@ -121,6 +101,55 @@ public class PrizeController {
 
 	}
 
+	public synchronized Integer getLuckDraw(PrizeRecord prizeRecord, Integer count) {
+		Random ran = new Random();
+		int num = ran.nextInt(9999);
+		Prize prize = prizeMapper.selectByPrimaryKey(num);
+		if (prize == null) {
+			count = -1;
+		} else {
+			if (prize.getPrizeLevel() == 0 && prize.getIsSelected() == 0) {
+				count = 0;
+				// prize.setIsSelected(1);
+				// prizeMapper.updateByPrimaryKeySelective(prize);
+				prizeRecord.setPrizeId(prize.getPrizeLevel());
+				prizeRecord.setPrize(prize.getName());
+				prizeRecordMapper.insert(prizeRecord);
+			} else if (prize.getPrizeLevel() == 1 && prize.getIsSelected() == 0) {
+				count = 1;
+				// prize.setIsSelected(1);
+				// prizeMapper.updateByPrimaryKeySelective(prize);
+				prizeRecord.setPrizeId(prize.getPrizeLevel());
+				prizeRecord.setPrize(prize.getName());
+				prizeRecordMapper.insert(prizeRecord);
+			} else if (prize.getPrizeLevel() == 2 && prize.getIsSelected() == 0) {
+				count = 2;
+				// prize.setIsSelected(1);
+				// prizeMapper.updateByPrimaryKeySelective(prize);
+				prizeRecord.setPrizeId(prize.getPrizeLevel());
+				prizeRecord.setPrize(prize.getName());
+				prizeRecordMapper.insert(prizeRecord);
+			} else if (prize.getPrizeLevel() == 3 && prize.getIsSelected() == 0) {
+				count = 3;
+				// prize.setIsSelected(1);
+				// prizeMapper.updateByPrimaryKeySelective(prize);
+				prizeRecord.setPrizeId(prize.getPrizeLevel());
+				prizeRecord.setPrize(prize.getName());
+				prizeRecordMapper.insert(prizeRecord);
+			} else if (prize.getPrizeLevel() == 4 && prize.getIsSelected() == 0) {
+				count = 4;
+				// prize.setIsSelected(1);
+				// prizeMapper.updateByPrimaryKeySelective(prize);
+				prizeRecord.setPrizeId(prize.getPrizeLevel());
+				prizeRecord.setPrize(prize.getName());
+				prizeRecordMapper.insert(prizeRecord);
+			} else {
+				count = -1;
+			}
+		}
+		return count;
+	}
+
 	/**
 	 * 小游戏抽奖列表
 	 *
@@ -152,4 +181,25 @@ public class PrizeController {
 		response.setCharacterEncoding("UTF-8");
 		response.getWriter().println(msg.toJSONStr());
 	}
+
+	/**
+	 * 转发链接添加抽奖次数 参数: uid:用户id
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/luckDrawAddShare")
+	public void luckDrawAddCount(PrizeRecord prizeRecord, HttpServletResponse response)
+			throws Exception, KeyManagementException, NoSuchAlgorithmException, NoSuchProviderException, IOException {
+		HttpRespMsg msg = new HttpRespMsg();
+		int count = prizeOpportunityMapper.selectCountByToday();
+		if (count == 0) {
+			PrizeOpportunity prizeOpportunity = new PrizeOpportunity();
+			prizeOpportunity.setIsShare(1);
+			prizeOpportunity.setUid(prizeRecord.getUid());
+			prizeOpportunityMapper.insert(prizeOpportunity);
+		}
+		response.setContentType("application/json");
+		response.setCharacterEncoding("UTF-8");
+		response.getWriter().println(msg.toJSONStr());
+	}
 }

+ 105 - 120
minigame/src/com/hssx/entity/PrizeOpportunity.java

@@ -3,135 +3,120 @@ package com.hssx.entity;
 import java.util.Date;
 
 public class PrizeOpportunity {
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column mini_prize_opportunity.id
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    private Integer id;
 
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column mini_prize_opportunity.is_share
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    private Integer isShare;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column mini_prize_opportunity.id
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	private Integer id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column mini_prize_opportunity.is_share
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	private Integer isShare;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column mini_prize_opportunity.opportunity_count
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	private Integer opportunityCount;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column mini_prize_opportunity.indate
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	private Date indate;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column mini_prize_opportunity.uid
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	private Integer uid;
 
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column mini_prize_opportunity.opportunity_count
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    private Integer opportunityCount;
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column mini_prize_opportunity.id
+	 * @return  the value of mini_prize_opportunity.id
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	public Integer getId() {
+		return id;
+	}
 
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column mini_prize_opportunity.indate
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    private Date indate;
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column mini_prize_opportunity.id
+	 * @param id  the value for mini_prize_opportunity.id
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	public void setId(Integer id) {
+		this.id = id;
+	}
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column mini_prize_opportunity.id
-     *
-     * @return the value of mini_prize_opportunity.id
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    public Integer getId() {
-        return id;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column mini_prize_opportunity.is_share
+	 * @return  the value of mini_prize_opportunity.is_share
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	public Integer getIsShare() {
+		return isShare;
+	}
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column mini_prize_opportunity.id
-     *
-     * @param id the value for mini_prize_opportunity.id
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    public void setId(Integer id) {
-        this.id = id;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column mini_prize_opportunity.is_share
+	 * @param isShare  the value for mini_prize_opportunity.is_share
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	public void setIsShare(Integer isShare) {
+		this.isShare = isShare;
+	}
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column mini_prize_opportunity.is_share
-     *
-     * @return the value of mini_prize_opportunity.is_share
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    public Integer getIsShare() {
-        return isShare;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column mini_prize_opportunity.opportunity_count
+	 * @return  the value of mini_prize_opportunity.opportunity_count
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	public Integer getOpportunityCount() {
+		return opportunityCount;
+	}
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column mini_prize_opportunity.is_share
-     *
-     * @param isShare the value for mini_prize_opportunity.is_share
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    public void setIsShare(Integer isShare) {
-        this.isShare = isShare;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column mini_prize_opportunity.opportunity_count
+	 * @param opportunityCount  the value for mini_prize_opportunity.opportunity_count
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	public void setOpportunityCount(Integer opportunityCount) {
+		this.opportunityCount = opportunityCount;
+	}
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column mini_prize_opportunity.opportunity_count
-     *
-     * @return the value of mini_prize_opportunity.opportunity_count
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    public Integer getOpportunityCount() {
-        return opportunityCount;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column mini_prize_opportunity.indate
+	 * @return  the value of mini_prize_opportunity.indate
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	public Date getIndate() {
+		return indate;
+	}
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column mini_prize_opportunity.opportunity_count
-     *
-     * @param opportunityCount the value for mini_prize_opportunity.opportunity_count
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    public void setOpportunityCount(Integer opportunityCount) {
-        this.opportunityCount = opportunityCount;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column mini_prize_opportunity.indate
+	 * @param indate  the value for mini_prize_opportunity.indate
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	public void setIndate(Date indate) {
+		this.indate = indate;
+	}
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column mini_prize_opportunity.indate
-     *
-     * @return the value of mini_prize_opportunity.indate
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    public Date getIndate() {
-        return indate;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column mini_prize_opportunity.uid
+	 * @return  the value of mini_prize_opportunity.uid
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	public Integer getUid() {
+		return uid;
+	}
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column mini_prize_opportunity.indate
-     *
-     * @param indate the value for mini_prize_opportunity.indate
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    public void setIndate(Date indate) {
-        this.indate = indate;
-    }
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column mini_prize_opportunity.uid
+	 * @param uid  the value for mini_prize_opportunity.uid
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	public void setUid(Integer uid) {
+		this.uid = uid;
+	}
 }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 542 - 523
minigame/src/com/hssx/entity/PrizeOpportunityExample.java


+ 59 - 77
minigame/src/com/hssx/mapper/PrizeOpportunityMapper.java

@@ -6,91 +6,73 @@ import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
 public interface PrizeOpportunityMapper {
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table mini_prize_opportunity
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    long countByExample(PrizeOpportunityExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table mini_prize_opportunity
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    int deleteByExample(PrizeOpportunityExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table mini_prize_opportunity
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	long countByExample(PrizeOpportunityExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table mini_prize_opportunity
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    int deleteByPrimaryKey(Integer id);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table mini_prize_opportunity
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	int deleteByExample(PrizeOpportunityExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table mini_prize_opportunity
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    int insert(PrizeOpportunity record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table mini_prize_opportunity
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	int deleteByPrimaryKey(Integer id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table mini_prize_opportunity
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    int insertSelective(PrizeOpportunity record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table mini_prize_opportunity
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	int insert(PrizeOpportunity record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table mini_prize_opportunity
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    List<PrizeOpportunity> selectByExample(PrizeOpportunityExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table mini_prize_opportunity
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	int insertSelective(PrizeOpportunity record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table mini_prize_opportunity
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    PrizeOpportunity selectByPrimaryKey(Integer id);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table mini_prize_opportunity
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	List<PrizeOpportunity> selectByExample(PrizeOpportunityExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table mini_prize_opportunity
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    int updateByExampleSelective(@Param("record") PrizeOpportunity record, @Param("example") PrizeOpportunityExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table mini_prize_opportunity
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	PrizeOpportunity selectByPrimaryKey(Integer id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table mini_prize_opportunity
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    int updateByExample(@Param("record") PrizeOpportunity record, @Param("example") PrizeOpportunityExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table mini_prize_opportunity
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	int updateByExampleSelective(@Param("record") PrizeOpportunity record,
+			@Param("example") PrizeOpportunityExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table mini_prize_opportunity
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    int updateByPrimaryKeySelective(PrizeOpportunity record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table mini_prize_opportunity
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	int updateByExample(@Param("record") PrizeOpportunity record, @Param("example") PrizeOpportunityExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table mini_prize_opportunity
-     *
-     * @mbg.generated Thu Sep 19 18:52:38 CST 2019
-     */
-    int updateByPrimaryKey(PrizeOpportunity record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table mini_prize_opportunity
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	int updateByPrimaryKeySelective(PrizeOpportunity record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table mini_prize_opportunity
+	 * @mbg.generated  Thu Sep 19 20:14:16 CST 2019
+	 */
+	int updateByPrimaryKey(PrizeOpportunity record);
+
+	int selectCountByToday();
 }

+ 43 - 22
minigame/src/com/hssx/mapper/PrizeOpportunityMapper.xml

@@ -5,18 +5,19 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="is_share" jdbcType="INTEGER" property="isShare" />
     <result column="opportunity_count" jdbcType="INTEGER" property="opportunityCount" />
     <result column="indate" jdbcType="TIMESTAMP" property="indate" />
+    <result column="uid" jdbcType="INTEGER" property="uid" />
   </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 Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -50,7 +51,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -84,15 +85,15 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
-    id, is_share, opportunity_count, indate
+    id, is_share, opportunity_count, indate, uid
   </sql>
   <select id="selectByExample" parameterType="com.hssx.entity.PrizeOpportunityExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     select
     <if test="distinct">
@@ -111,7 +112,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -122,7 +123,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     delete from mini_prize_opportunity
     where id = #{id,jdbcType=INTEGER}
@@ -131,7 +132,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     delete from mini_prize_opportunity
     <if test="_parameter != null">
@@ -142,21 +143,21 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
       SELECT LAST_INSERT_ID()
     </selectKey>
-    insert into mini_prize_opportunity (is_share, opportunity_count, indate
-      )
-    values (#{isShare,jdbcType=INTEGER}, #{opportunityCount,jdbcType=INTEGER}, #{indate,jdbcType=TIMESTAMP}
-      )
+    insert into mini_prize_opportunity (is_share, opportunity_count, indate, 
+      uid)
+    values (#{isShare,jdbcType=INTEGER}, #{opportunityCount,jdbcType=INTEGER}, #{indate,jdbcType=TIMESTAMP}, 
+      #{uid,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.hssx.entity.PrizeOpportunity">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
       SELECT LAST_INSERT_ID()
@@ -172,6 +173,9 @@
       <if test="indate != null">
         indate,
       </if>
+      <if test="uid != null">
+        uid,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="isShare != null">
@@ -183,13 +187,16 @@
       <if test="indate != null">
         #{indate,jdbcType=TIMESTAMP},
       </if>
+      <if test="uid != null">
+        #{uid,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.hssx.entity.PrizeOpportunityExample" resultType="java.lang.Long">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     select count(*) from mini_prize_opportunity
     <if test="_parameter != null">
@@ -200,7 +207,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     update mini_prize_opportunity
     <set>
@@ -216,6 +223,9 @@
       <if test="record.indate != null">
         indate = #{record.indate,jdbcType=TIMESTAMP},
       </if>
+      <if test="record.uid != null">
+        uid = #{record.uid,jdbcType=INTEGER},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -225,13 +235,14 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     update mini_prize_opportunity
     set id = #{record.id,jdbcType=INTEGER},
       is_share = #{record.isShare,jdbcType=INTEGER},
       opportunity_count = #{record.opportunityCount,jdbcType=INTEGER},
-      indate = #{record.indate,jdbcType=TIMESTAMP}
+      indate = #{record.indate,jdbcType=TIMESTAMP},
+      uid = #{record.uid,jdbcType=INTEGER}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -240,7 +251,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     update mini_prize_opportunity
     <set>
@@ -253,6 +264,9 @@
       <if test="indate != null">
         indate = #{indate,jdbcType=TIMESTAMP},
       </if>
+      <if test="uid != null">
+        uid = #{uid,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -260,12 +274,19 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Sep 19 18:52:38 CST 2019.
+      This element was generated on Thu Sep 19 20:14:16 CST 2019.
     -->
     update mini_prize_opportunity
     set is_share = #{isShare,jdbcType=INTEGER},
       opportunity_count = #{opportunityCount,jdbcType=INTEGER},
-      indate = #{indate,jdbcType=TIMESTAMP}
+      indate = #{indate,jdbcType=TIMESTAMP},
+      uid = #{uid,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
+  
+   <select id="selectCountByToday" resultType="java.lang.Integer">
+  select count(id) from mini_prize_opportunity
+  WHERE TO_DAYS(indate) = TO_DAYS(NOW())
+  </select>
+  
 </mapper>