|
@@ -16,22 +16,22 @@
|
|
|
<!--全部积分记录-->
|
|
|
<select id="listIntegralInfo" resultType="UseIntegral" parameterType="UseIntegral">
|
|
|
SELECT
|
|
|
- i.integral_type integralType,
|
|
|
- i.integral_number integralNumber,
|
|
|
- i.integral_remarks integralRemarks,
|
|
|
- i.integral_create_time integralCreateTime,
|
|
|
- i.integral_before_number integralBeforeNumber,
|
|
|
- i.integral_end_number integralEndNumber,
|
|
|
- c.integral_config_name integralConfigName,
|
|
|
- s.stay_recorded_time stayRecordedTime
|
|
|
+ i.integral_type integralType,
|
|
|
+ i.integral_number integralNumber,
|
|
|
+ i.integral_remarks integralRemarks,
|
|
|
+ i.integral_create_time integralCreateTime,
|
|
|
+ i.integral_before_number integralBeforeNumber,
|
|
|
+ i.integral_end_number integralEndNumber,
|
|
|
+ c.integral_config_name integralConfigName,
|
|
|
+ s.stay_recorded_time stayRecordedTime
|
|
|
FROM
|
|
|
- tb_iamberry_use_integral i
|
|
|
+ tb_iamberry_use_integral i
|
|
|
LEFT JOIN tb_iamberry_integral_config c ON i.config_id = c.integral_config_id
|
|
|
LEFT JOIN tb_iamberry_stay_integral s ON i.stay_id=s.stay_id
|
|
|
WHERE i.user_openid=#{userOpenId}
|
|
|
- <if test="integralType != null and integralType != ''">
|
|
|
- AND i.integral_type = #{integralType}
|
|
|
- </if>
|
|
|
+ <if test="integralType != null and integralType != ''">
|
|
|
+ AND i.integral_type = #{integralType}
|
|
|
+ </if>
|
|
|
ORDER BY i.integral_id DESC
|
|
|
<if test="page!=null and page.recordBegin>0 and page.pageSize>0 ">
|
|
|
limit ${page.recordBegin},${page.pageSize}
|
|
@@ -66,13 +66,13 @@
|
|
|
<!-- 查询积分来源信息 -->
|
|
|
<select id="listIntegralConfig" parameterType="IntegralConfig" resultType="IntegralConfig">
|
|
|
SELECT
|
|
|
- *
|
|
|
+ *
|
|
|
FROM
|
|
|
- tb_iamberry_integral_config
|
|
|
+ tb_iamberry_integral_config
|
|
|
<where>
|
|
|
- <if test="integralConfigId != null and integralConfigId != ''">
|
|
|
- integral_config_id = #{integralConfigId}
|
|
|
- </if>
|
|
|
+ <if test="integralConfigId != null and integralConfigId != ''">
|
|
|
+ integral_config_id = #{integralConfigId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -125,18 +125,18 @@
|
|
|
<!-- 查询所有待入账积分 -->
|
|
|
<select id="listStayIntegral" parameterType="StayIntegral" resultType="StayIntegral">
|
|
|
SELECT
|
|
|
- t.stay_id AS stayId,
|
|
|
- t.user_openid AS userOpenId,
|
|
|
- t.config_id AS configId,
|
|
|
- t.sales_orderid AS orderId,
|
|
|
- t.stay_number AS stayNumber,
|
|
|
- t.stay_recorded_time AS stayRecordedTime,
|
|
|
- t.stay_status AS stayStatus,
|
|
|
- t.stay_remark AS stayRemark,
|
|
|
- t.stay_create_time AS stayCreateTime,
|
|
|
- t.stay_update_time AS stayUpdateTime
|
|
|
+ t.stay_id AS stayId,
|
|
|
+ t.user_openid AS userOpenId,
|
|
|
+ t.config_id AS configId,
|
|
|
+ t.sales_orderid AS orderId,
|
|
|
+ t.stay_number AS stayNumber,
|
|
|
+ t.stay_recorded_time AS stayRecordedTime,
|
|
|
+ t.stay_status AS stayStatus,
|
|
|
+ t.stay_remark AS stayRemark,
|
|
|
+ t.stay_create_time AS stayCreateTime,
|
|
|
+ t.stay_update_time AS stayUpdateTime
|
|
|
FROM
|
|
|
- tb_iamberry_stay_integral t
|
|
|
+ tb_iamberry_stay_integral t
|
|
|
<where>
|
|
|
<if test="stayId != null">
|
|
|
AND stay_id = #{stayId}
|
|
@@ -190,7 +190,7 @@
|
|
|
<!-- 根据banner图片ID,删除图片 -->
|
|
|
<delete id="delUseIntegral" parameterType="UseIntegral">
|
|
|
DELETE FROM
|
|
|
- tb_iamberry_use_integral
|
|
|
+ tb_iamberry_use_integral
|
|
|
<where>
|
|
|
<if test="integralType != null">
|
|
|
AND integral_type = #{integralType}
|
|
@@ -204,6 +204,129 @@
|
|
|
</where>
|
|
|
</delete>
|
|
|
|
|
|
+ <!-- 积分日志记录列表查询 -->
|
|
|
+ <select id="listUseIntegral" parameterType="UseIntegral" resultType="UseIntegral">
|
|
|
+ SELECT
|
|
|
+ i.*, u.user_nickname,
|
|
|
+ u.user_name
|
|
|
+ FROM
|
|
|
+ tb_iamberry_use_integral i
|
|
|
+ LEFT JOIN tb_iamberry_user_userinfo u ON i.user_openid = u.user_openid
|
|
|
+ WHERE
|
|
|
+ i.integral_type IN (1, 2)
|
|
|
+ <if test="integralNumberMax!=null and integralNumberMax>0">
|
|
|
+ AND integral_number <= #{integralNumberMax}
|
|
|
+ </if>
|
|
|
+ <if test="integralNumberMin!=null and integralNumberMin>0">
|
|
|
+ AND integral_number >= #{integralNumberMin}
|
|
|
+ </if>
|
|
|
+ <if test="userName!=null and userName != ''">
|
|
|
+ AND u.user_name like CONCAT('%',#{userName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="userNikeName!=null and userNikeName != ''">
|
|
|
+ AND u.user_nickname like CONCAT('%',#{userNikeName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="page!=null and page.recordBegin>0 and page.pageSize>0 ">
|
|
|
+ limit ${page.recordBegin},${page.pageSize}
|
|
|
+ </if>
|
|
|
+ <if test="page!=null and page.recordBegin==0 and page.pageSize>0 ">
|
|
|
+ limit ${page.pageSize}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
|
|
|
+ <select id="listUseIntegralCount" parameterType="UseIntegral" resultType="Integer">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM
|
|
|
+ tb_iamberry_use_integral i
|
|
|
+ LEFT JOIN tb_iamberry_user_userinfo u ON i.user_openid = u.user_openid
|
|
|
+ WHERE
|
|
|
+ i.integral_type IN (1, 2)
|
|
|
+ <if test="integralNumberMax!=null and integralNumberMax>0">
|
|
|
+ AND integral_number <= #{integralNumberMax}
|
|
|
+ </if>
|
|
|
+ <if test="integralNumberMin!=null and integralNumberMin>0">
|
|
|
+ AND integral_number >= #{integralNumberMin}
|
|
|
+ </if>
|
|
|
+ <if test="userName!=null and userName != ''">
|
|
|
+ AND u.user_name like CONCAT('%',#{userName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="userNikeName!=null and userNikeName != ''">
|
|
|
+ AND u.user_nickname like CONCAT('%',#{userNikeName},'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <!--待入账积分列表查询-->
|
|
|
+ <select id="listAdminStayIntegral" parameterType="StayIntegral" resultType="StayIntegral">
|
|
|
+ SELECT
|
|
|
+ i.*, u.user_nickname,
|
|
|
+ u.user_name,
|
|
|
+ u.user_integral,
|
|
|
+ u.user_surplus_integral,
|
|
|
+ u.user_use_integral,
|
|
|
+ u.user_stay_integral,
|
|
|
+ ui.integral_remarks
|
|
|
+ FROM
|
|
|
+ tb_iamberry_stay_integral i
|
|
|
+ LEFT JOIN tb_iamberry_user_userinfo u ON i.user_openid = u.user_openid
|
|
|
+ LEFT JOIN tb_iamberry_use_integral ui on i.stay_id = ui.stay_id
|
|
|
+ <where>
|
|
|
+ <if test="integralRemark != null and integralRemark != ''">
|
|
|
+ ui.integral_remarks = #{integralRemark}
|
|
|
+ </if>
|
|
|
+ <if test="productType != null and productType.typeId !=null and productType.typeId !=''">
|
|
|
+ and PRODUCT_TYPE=#{productType.typeId}
|
|
|
+ </if>
|
|
|
+ <if test="userName!=null and userName != ''">
|
|
|
+ AND u.user_name like CONCAT('%',#{userName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="userNikeName!=null and userNikeName != ''">
|
|
|
+ AND u.user_nickname like CONCAT('%',#{userNikeName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="stayRecordedTime != null and stayRecordedTime != ''">
|
|
|
+ <![CDATA[AND DATE_FORMAT(stay_recorded_time, '%Y-%m-%d') = DATE_FORMAT(#{stayRecordedTime},'%Y-%m-%d')]]>
|
|
|
+ </if>
|
|
|
+ <if test="changeIntegralMax!=null and changeIntegralMax>0">
|
|
|
+ AND i.stay_number <= #{changeIntegralMax}
|
|
|
+ </if>
|
|
|
+ <if test="changeIntegralMin!=null and changeIntegralMin>0">
|
|
|
+ AND i.stay_number >= #{changeIntegralMin}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="listAdminStayIntegralCount" parameterType="StayIntegral" resultType="StayIntegral">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM
|
|
|
+ tb_iamberry_stay_integral i
|
|
|
+ LEFT JOIN tb_iamberry_user_userinfo u ON i.user_openid = u.user_openid
|
|
|
+ LEFT JOIN tb_iamberry_use_integral ui on i.stay_id = ui.stay_id
|
|
|
+ <where>
|
|
|
+ <if test="integralRemark != null and integralRemark != ''">
|
|
|
+ ui.integral_remarks = #{integralRemark}
|
|
|
+ </if>
|
|
|
+ <if test="productType != null and productType.typeId !=null and productType.typeId !=''">
|
|
|
+ and PRODUCT_TYPE=#{productType.typeId}
|
|
|
+ </if>
|
|
|
+ <if test="userName!=null and userName != ''">
|
|
|
+ AND u.user_name like CONCAT('%',#{userName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="userNikeName!=null and userNikeName != ''">
|
|
|
+ AND u.user_nickname like CONCAT('%',#{userNikeName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="stayRecordedTime != null and stayRecordedTime != ''">
|
|
|
+ <![CDATA[AND DATE_FORMAT(stay_recorded_time, '%Y-%m-%d') = DATE_FORMAT(#{stayRecordedTime},'%Y-%m-%d')]]>
|
|
|
+ </if>
|
|
|
+ <if test="changeIntegralMax!=null and changeIntegralMax>0">
|
|
|
+ AND i.stay_number <= #{changeIntegralMax}
|
|
|
+ </if>
|
|
|
+ <if test="changeIntegralMin!=null and changeIntegralMin>0">
|
|
|
+ AND i.stay_number >= #{changeIntegralMin}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
|
|
|
+ <!--修改待入账积分状态-->
|
|
|
+ <update id="updatestayIntegralStatus" parameterType="StayIntegral" >
|
|
|
+ UPDATE tb_iamberry_stay_integral SET stay_status = #{stayStatus} WHERE stay_id = #{stayId}
|
|
|
+ </update>
|
|
|
</mapper>
|