Browse Source

[成长值重整][重整]:

1. 每天登录首次给成长值
 2. 消费金额为0时,不给成长值。
 3. 消费金额除以1元,四舍五入给成长值
 4. 绑车牌获得成长值
 5. 微信昵称授权获取成长值
 6. 微信手机授权获取成长值
release_toaliyun_real
Stormeye.Wu 7 years ago
parent
commit
7a200635fc
2 changed files with 113 additions and 80 deletions
  1. +39
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumScoreType.java
  2. +74
    -80
      mallinkService/src/main/resources/mapper/WxScoreHistoryMapper.xml

+ 39
- 0
mallinkService/src/main/java/com/iformall/enums/EnumScoreType.java View File

@@ -0,0 +1,39 @@
package com.iformall.enums;

/**
* Created by Stormeye on 2018/08/09.
*/
public enum EnumScoreType {

LOGIN(1, "每日登录"),
CONSUMPTION(2, "消费"),
BINDCAR(3, "绑车牌"),
WIFI_CONNECTION(4, "连接WIFI"),
WECHAT_PERSION(5, "微信用户昵称授权"),
WECHAT_PHONE(6, "微信用户手机授权");

public static EnumScoreType getEnum(Integer code) {
for (EnumScoreType value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}

private Integer code;
private String message;

EnumScoreType(Integer code, String message) {
this.code = code;
this.message = message;
}

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}

+ 74
- 80
mallinkService/src/main/resources/mapper/WxScoreHistoryMapper.xml View File

@@ -1,86 +1,80 @@
<?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.iformall.mapper.WxScoreHistoryMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxScoreHistory">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="valid_date" jdbcType="TIMESTAMP" property="validDate" />
<result column="order_id" jdbcType="BIGINT" property="orderId" />
<result column="pay_type" jdbcType="INTEGER" property="payType" />
<result column="pay_amount" jdbcType="DECIMAL" property="payAmount" />
<result column="score_amount" jdbcType="INTEGER" property="scoreAmount" />
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`c_user_id`,`create_date`,`valid_date`,`order_id`,`pay_type`,`pay_amount`,`score_amount`
</sql>
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxScoreHistory">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="c_user_id" jdbcType="BIGINT" property="cUserId"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="score_type" jdbcType="INTEGER" property="scoreType"/>
<result column="valid_date" jdbcType="TIMESTAMP" property="validDate"/>
<result column="order_id" jdbcType="BIGINT" property="orderId"/>
<result column="pay_type" jdbcType="INTEGER" property="payType"/>
<result column="pay_amount" jdbcType="INTEGER" property="payAmount"/>
<result column="score_amount" jdbcType="INTEGER" property="scoreAmount"/>
</resultMap>

<sql id="dynamicWhereConditions">
where 1 = 1
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != cUserId ">
and `c_user_id` = #{cUserId}
</if>
<if test=" null != createDate ">
and `create_date` = #{createDate}
</if>
<if test=" null != validDate ">
and `valid_date` = #{validDate}
</if>
<if test=" null != orderId ">
and `order_id` = #{orderId}
</if>
<if test=" null != payType ">
and `pay_type` = #{payType}
</if>
<if test=" null != payAmount ">
and `pay_amount` = #{payAmount}
</if>
<if test=" null != scoreAmount ">
and `score_amount` = #{scoreAmount}
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
<sql id="allColumns">
`id`,`tenant_id`,`c_user_id`,`create_date`,`score_type`,`valid_date`,`order_id`,`pay_type`,`pay_amount`,`score_amount`
</sql>
<select id="findList" parameterType="com.iformall.domain.po.WxScoreHistory" resultMap="BaseResultMap">
select <include refid="allColumns" /> from wx_score_history
<include refid="dynamicWhereConditions" />
</select>

<sql id="dynamicWhereConditions">
where 1 = 1

<if test=" null != id ">
and `id` = #{id}
</if>

<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>

<if test=" null != cUserId ">
and `c_user_id` = #{cUserId}
</if>

<if test=" null != createDate ">
and `create_date` = #{createDate}
</if>

<if test=" null != scoreType ">
and `score_type` = #{scoreType}
</if>

<if test=" null != validDate ">
and `valid_date` = #{validDate}
</if>

<if test=" null != orderId ">
and `order_id` = #{orderId}
</if>

<if test=" null != payType ">
and `pay_type` = #{payType}
</if>

<if test=" null != payAmount ">
and `pay_amount` = #{payAmount}
</if>

<if test=" null != scoreAmount ">
and `score_amount` = #{scoreAmount}
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>

<select id="findList" parameterType="com.iformall.domain.po.WxScoreHistory" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_score_history
<include refid="dynamicWhereConditions"/>
</select>


</mapper>

Loading…
Cancel
Save