Commit 310696e2 authored by macro's avatar macro
Browse files

修复mybatis generator重复生成mapper.xml内容的问题

parent 79000a1e
......@@ -159,7 +159,7 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.UmsMemberRuleSettingExample" resultType="java.lang.Integer">
<select id="countByExample" parameterType="com.macro.mall.model.UmsMemberRuleSettingExample" resultType="java.lang.Long">
select count(*) from ums_member_rule_setting
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
......
......@@ -229,7 +229,7 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.UmsMemberStatisticsInfoExample" resultType="java.lang.Integer">
<select id="countByExample" parameterType="com.macro.mall.model.UmsMemberStatisticsInfoExample" resultType="java.lang.Long">
select count(*) from ums_member_statistics_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
......
......@@ -135,7 +135,7 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.UmsMemberTagExample" resultType="java.lang.Integer">
<select id="countByExample" parameterType="com.macro.mall.model.UmsMemberTagExample" resultType="java.lang.Long">
select count(*) from ums_member_tag
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
......
......@@ -142,7 +142,7 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.UmsMemberTaskExample" resultType="java.lang.Integer">
<select id="countByExample" parameterType="com.macro.mall.model.UmsMemberTaskExample" resultType="java.lang.Long">
select count(*) from ums_member_task
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
......
......@@ -179,7 +179,7 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.UmsPermissionExample" resultType="java.lang.Integer">
<select id="countByExample" parameterType="com.macro.mall.model.UmsPermissionExample" resultType="java.lang.Long">
select count(*) from ums_permission
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
......
......@@ -158,7 +158,7 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.UmsRoleExample" resultType="java.lang.Integer">
<select id="countByExample" parameterType="com.macro.mall.model.UmsRoleExample" resultType="java.lang.Long">
select count(*) from ums_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
......
......@@ -126,7 +126,7 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.UmsRolePermissionRelationExample" resultType="java.lang.Integer">
<select id="countByExample" parameterType="com.macro.mall.model.UmsRolePermissionRelationExample" resultType="java.lang.Long">
select count(*) from ums_role_permission_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
......
......@@ -13,6 +13,8 @@
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"/>
<!-- 为生成的Java模型创建一个toString方法 -->
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
<!--生成mapper.xml时覆盖原文件-->
<plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin" />
<commentGenerator type="com.macro.mall.CommentGenerator">
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<property name="suppressAllComments" value="true"/>
......
......@@ -47,7 +47,7 @@ public class UmsMemberCouponServiceImpl implements UmsMemberCouponService {
//判断用户领取的优惠券数量是否超过限制
SmsCouponHistoryExample couponHistoryExample = new SmsCouponHistoryExample();
couponHistoryExample.createCriteria().andCouponIdEqualTo(couponId).andMemberIdEqualTo(currentMember.getId());
int count = couponHistoryMapper.countByExample(couponHistoryExample);
long count = couponHistoryMapper.countByExample(couponHistoryExample);
if(count>=coupon.getPerLimit()){
return CommonResult.failed("您已经领取过该优惠券");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment