| @@ -138,16 +138,21 @@ BEGIN | |||||
| --UPDATE wx_c_user_car SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | --UPDATE wx_c_user_car SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | ||||
| UPDATE wx_c_user_from_b SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | UPDATE wx_c_user_from_b SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | ||||
| UPDATE wx_coupon_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | UPDATE wx_coupon_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | ||||
| --UPDATE wx_credit_history SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||||
| UPDATE wx_credit_history SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||||
| UPDATE wx_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | UPDATE wx_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | ||||
| UPDATE wx_pay_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | UPDATE wx_pay_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | ||||
| UPDATE wx_refund_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | UPDATE wx_refund_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | ||||
| --UPDATE wx_score_history SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||||
| UPDATE wx_score_history SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ; | |||||
| UPDATE wx_card_spend SET owner_id = newCuserId WHERE owner_id = oldCuserId ; | UPDATE wx_card_spend SET owner_id = newCuserId WHERE owner_id = oldCuserId ; | ||||
| UPDATE wx_coupon_order SET owner_id = newCuserId WHERE owner_id = oldCuserId ; | UPDATE wx_coupon_order SET owner_id = newCuserId WHERE owner_id = oldCuserId ; | ||||
| --UPDATE wx_credit_history SET operator_id = newCuserId WHERE operator_type in (1,2) and operator_id = oldCuserId ; | |||||
| UPDATE wx_credit_history SET operator_id = newCuserId WHERE operator_type in (1,2) and operator_id = oldCuserId ; | |||||
| UPDATE wx_c_user_basic_info SET poins = (SELECT SUM(poins) FROM wx_c_user_basic_info WHERE id in (oldCuserId,newCuserId)), | |||||
| credit = (SELECT SUM(credit) FROM wx_c_user_basic_info WHERE id in (oldCuserId,newCuserId)), | |||||
| login_count = (SELECT SUM(login_count) FROM wx_c_user_basic_info WHERE id in (oldCuserId,newCuserId)) | |||||
| WHERE id = newCuserId ; | |||||
| UPDATE wx_c_user_basic_info SET phone = phone + '(作废)',`status` = 1 WHERE id = oldCuserId ; | UPDATE wx_c_user_basic_info SET phone = phone + '(作废)',`status` = 1 WHERE id = oldCuserId ; | ||||
| @@ -788,6 +788,7 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||||
| if (userTags.getId() != null) { | if (userTags.getId() != null) { | ||||
| wxCUserTagsMapper.updateById(userTags); | wxCUserTagsMapper.updateById(userTags); | ||||
| } else { | } else { | ||||
| userTags.setTenantId(wxCUserBasicInfo.getFinalTenantId()); | |||||
| userTags.setCreateDate(new Date()); | userTags.setCreateDate(new Date()); | ||||
| userTags.setUpdateDate(new Date()); | userTags.setUpdateDate(new Date()); | ||||
| wxCUserTagsMapper.insert(userTags); | wxCUserTagsMapper.insert(userTags); | ||||
| @@ -717,6 +717,7 @@ | |||||
| #{idItem} | #{idItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| order by cu.`active_time` DESC | |||||
| <!--<if test=" null != sortColumns">order by ${sortColumns}</if>--> | <!--<if test=" null != sortColumns">order by ${sortColumns}</if>--> | ||||
| </sql> | </sql> | ||||
| @@ -790,6 +791,7 @@ | |||||
| #{idItem} | #{idItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| order by cu.`active_time` DESC | |||||
| <!-- <if test=" null != sortColumns">order by ${sortColumns}</if>--> | <!-- <if test=" null != sortColumns">order by ${sortColumns}</if>--> | ||||
| </sql> | </sql> | ||||
| @@ -801,7 +803,6 @@ | |||||
| <if test=" null != begin "> | <if test=" null != begin "> | ||||
| limit #{begin}, #{limit} | limit #{begin}, #{limit} | ||||
| </if> | </if> | ||||
| order by cu.`active_time` DESC | |||||
| </select> | </select> | ||||
| <select id="findVoList1" resultMap="VoBaseResultMap"> | <select id="findVoList1" resultMap="VoBaseResultMap"> | ||||
| @@ -814,7 +815,6 @@ | |||||
| <if test=" null != basicInfo.begin "> | <if test=" null != basicInfo.begin "> | ||||
| limit #{basicInfo.begin}, #{basicInfo.limit} | limit #{basicInfo.begin}, #{basicInfo.limit} | ||||
| </if> | </if> | ||||
| order by cu.`active_time` DESC | |||||
| </select> | </select> | ||||
| <select id="countVoList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultType="java.lang.Integer"> | <select id="countVoList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultType="java.lang.Integer"> | ||||
| @@ -790,7 +790,7 @@ | |||||
| </if> | </if> | ||||
| ) co | ) co | ||||
| ON co.coupon_id = couc.product_id | ON co.coupon_id = couc.product_id | ||||
| INNER JOIN wx_c_user_basic_info cu ON cu.id=co.c_user_id | |||||
| LEFT JOIN wx_c_user_basic_info cu ON cu.id=co.c_user_id | |||||
| LEFT JOIN wx_coupon c ON c.id = co.coupon_id | LEFT JOIN wx_coupon c ON c.id = co.coupon_id | ||||
| LEFT JOIN wx_merchant m1 ON m1.id = couc.merchant_id | LEFT JOIN wx_merchant m1 ON m1.id = couc.merchant_id | ||||
| LEFT JOIN wx_merchant_subsidy ms ON co.id = ms.coupon_order_id AND ms.type = 1 | LEFT JOIN wx_merchant_subsidy ms ON co.id = ms.coupon_order_id AND ms.type = 1 | ||||