master
yangkai 6 years ago
parent cc6d0ed83d
commit 400a1cb38d

@ -457,12 +457,13 @@ public class RetailAppServiceImp implements RetailAppService {
@Override
public JSONObject getCouponCusCouponLog(String client_moniker, AppQueryBean appQueryBean) {
String keyword = "CTRIP_";
JSONObject client = clientMapper.findClientByMoniker(client_moniker);
if (client == null) {
throw new BadRequestException("Partner not exists");
}
PageList<JSONObject> cusCouponLogs = couponAccuessLogMapper.getCouponAccuessLog(
client.getIntValue("client_id"), new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("creation_date.desc")));
client.getIntValue("client_id"), keyword, new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("creation_date.desc")));
HashMap<String, JSONObject> couponMap = new HashMap<>();
for(JSONObject cusCouponLog : cusCouponLogs) {
cusCouponLog.put("client_moniker", client_moniker);

@ -29,5 +29,5 @@ public interface CouponAccuessLogMapper {
@AutoSql(type = SqlType.SELECT)
List<JSONObject> findCouponByOrderId(@Param("order_id") String order_id);
PageList<JSONObject> getCouponAccuessLog(@Param("client_id")int client_id, PageBounds pageBounds);
PageList<JSONObject> getCouponAccuessLog(@Param("client_id")int client_id, @Param("keyword")String keyword, PageBounds pageBounds);
}

@ -4,10 +4,10 @@
<select id="getCouponAccuessLog" resultType="com.alibaba.fastjson.JSONObject">
SELECT
accuess_id,client_id,customer_openid,order_id,
TRIM(LEADING 'CTRIP_' FROM coupon_id) coupon_id,
TRIM(LEADING #{keyword} FROM coupon_id) coupon_id,
coupon_deal_amount,min_pay_amount,currency,creation_date,
last_update_date,is_valid,transaction_id,transaction_refund_id,refund_id
FROM cus_coupon_accuess_log
WHERE locate("CTRIP_",coupon_id) AND client_id = #{client_id}
WHERE locate(#{keyword},coupon_id) = 1 AND client_id = #{client_id}
</select>
</mapper>
Loading…
Cancel
Save