| @@ -23,7 +23,6 @@ public class WxChartDataController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| private WxChartDataService wxChartDataService; | private WxChartDataService wxChartDataService; | ||||
| @@ -31,7 +30,9 @@ public class WxChartDataController extends BaseController { | |||||
| @GetMapping("/queryData") | @GetMapping("/queryData") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "chart", value = "chart", dataType = "String", paramType = "query", required = true), | @ApiImplicitParam(name = "chart", value = "chart", dataType = "String", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "querytime", value = "querytime", dataType = "String", paramType = "query", required = true)}) | |||||
| @ApiImplicitParam(name = "startdate", value = "startdate", dataType = "String", paramType = "query"), | |||||
| @ApiImplicitParam(name = "enddate", value = "enddate", dataType = "String", paramType = "query") | |||||
| }) | |||||
| public ResultData queryData(@RequestParam Map<String, String> params) { | public ResultData queryData(@RequestParam Map<String, String> params) { | ||||
| logger.debug("[" + getIpAddr() + "] WxChartDataController::queryData"); | logger.debug("[" + getIpAddr() + "] WxChartDataController::queryData"); | ||||
| params.put("tenantId",super.getTenantId()); | params.put("tenantId",super.getTenantId()); | ||||
| @@ -157,6 +157,25 @@ public class WxCouponController extends BaseController { | |||||
| return new ResultData(wxCouponService.findCouponData(wxCoupon,pageNum,pageSize)); | return new ResultData(wxCouponService.findCouponData(wxCoupon,pageNum,pageSize)); | ||||
| } | } | ||||
| @ApiOperation("砍价营销列表接口") | |||||
| @GetMapping("findPressCountList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData findPressCountList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||||
| //默认时间本月第一天,截止到当天 | |||||
| Map<String,Object> result = new HashedMap(); | |||||
| if(wxCoupon.getStartdate() == null){ | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.add(Calendar.MONTH, 0); | |||||
| c.set(Calendar.DAY_OF_MONTH,1); | |||||
| wxCoupon.setStartdate(c.getTime()); | |||||
| } | |||||
| if(wxCoupon.getEnddate() == null){ | |||||
| wxCoupon.setEnddate(new Date()); | |||||
| } | |||||
| return new ResultData(wxCouponService.findPressData(wxCoupon,pageNum,pageSize)); | |||||
| } | |||||
| @@ -1,7 +1,5 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | |||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import javax.persistence.Table; | import javax.persistence.Table; | ||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| @@ -43,6 +43,15 @@ public interface WxCouponService { | |||||
| */ | */ | ||||
| PageInfo<WxCoupon> findCouponData(WxCoupon record,Integer pageNum, Integer pageSize); | PageInfo<WxCoupon> findCouponData(WxCoupon record,Integer pageNum, Integer pageSize); | ||||
| /** | |||||
| * 砍价列表,包括统计 | |||||
| * @param record | |||||
| * @param pageNum | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxCoupon> findPressData(WxCoupon record,Integer pageNum, Integer pageSize); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| * | * | ||||
| @@ -105,7 +114,7 @@ public interface WxCouponService { | |||||
| * 卷发放数量 | * 卷发放数量 | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<WxCoupon> findCouponSendCount(WxCoupon wxCoupon); | |||||
| //List<WxCoupon> findCouponSendCount(WxCoupon wxCoupon); | |||||
| /** | /** | ||||
| * 卷购买数量 | * 卷购买数量 | ||||
| @@ -117,7 +126,7 @@ public interface WxCouponService { | |||||
| * 卷领取数量 | * 卷领取数量 | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<WxCoupon> findCouponGetCount(WxCoupon wxCoupon); | |||||
| //List<WxCoupon> findCouponGetCount(WxCoupon wxCoupon); | |||||
| /** | /** | ||||
| * 卷核销数量 | * 卷核销数量 | ||||
| @@ -2,6 +2,7 @@ package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.WxCarPayRecord; | import com.iformall.domain.po.WxCarPayRecord; | ||||
| import com.iformall.mapper.WxCarPayRecordMapper; | import com.iformall.mapper.WxCarPayRecordMapper; | ||||
| import com.iformall.service.WxCarPayRecordService; | import com.iformall.service.WxCarPayRecordService; | ||||
| @@ -25,6 +26,8 @@ public class WxCarPayRecordServiceImpl implements WxCarPayRecordService{ | |||||
| @Override | @Override | ||||
| public void saveOrUpdate(WxCarPayRecord record) { | public void saveOrUpdate(WxCarPayRecord record) { | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| wxCarPayRecordMapper.insertSelective(record); | wxCarPayRecordMapper.insertSelective(record); | ||||
| } else { | } else { | ||||
| wxCarPayRecordMapper.updateByPrimaryKeySelective(record); | wxCarPayRecordMapper.updateByPrimaryKeySelective(record); | ||||
| @@ -67,18 +67,14 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| public ResultData queryData(Map<String, String> paramsMap) { | public ResultData queryData(Map<String, String> paramsMap) { | ||||
| String tenantId = paramsMap.get("tenantId"); | String tenantId = paramsMap.get("tenantId"); | ||||
| Integer chart = Integer.valueOf(paramsMap.get("chart")); | Integer chart = Integer.valueOf(paramsMap.get("chart")); | ||||
| String querytime = paramsMap.get("querytime"); | |||||
| String startdate = DateUtils.getSystemTime("yyyy-MM-dd"); | |||||
| String enddate = startdate; | |||||
| if (!StringUtils.isEmpty(querytime)) { | |||||
| String[] split = querytime.split(","); | |||||
| if (split.length == 2) { | |||||
| startdate = split[0]; | |||||
| enddate = split[1]; | |||||
| } else { | |||||
| startdate = split[0]; | |||||
| enddate = split[0]; | |||||
| } | |||||
| String startdate = paramsMap.get("startdate") + " 00:00:00"; | |||||
| String enddate = paramsMap.get("enddate") + " 23:59:59"; | |||||
| if (StringUtils.isEmpty(startdate)) { | |||||
| startdate = DateUtils.getSystemTime("yyyy-MM-dd") + " 00:00:00" ; | |||||
| } | |||||
| if(StringUtils.isBlank(enddate)){ | |||||
| enddate = DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59"; | |||||
| } | } | ||||
| //出租率 | //出租率 | ||||
| @@ -1472,23 +1468,25 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| //卡营销数据 | //卡营销数据 | ||||
| if (chart.equals(EnumChart.SALE_CARD.getCode())) { | if (chart.equals(EnumChart.SALE_CARD.getCode())) { | ||||
| WxCoupon wxCoupon = new WxCoupon(); | WxCoupon wxCoupon = new WxCoupon(); | ||||
| //默认时间本月第一天,截止到当天 | //默认时间本月第一天,截止到当天 | ||||
| Map<String,Object> result = new HashedMap(); | |||||
| if(startdate == null){ | |||||
| if(paramsMap.get("startdate") == null){ | |||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| c.add(Calendar.MONTH, 0); | c.add(Calendar.MONTH, 0); | ||||
| c.set(Calendar.DAY_OF_MONTH,1); | c.set(Calendar.DAY_OF_MONTH,1); | ||||
| wxCoupon.setStartdate(c.getTime()); | wxCoupon.setStartdate(c.getTime()); | ||||
| }else{ | }else{ | ||||
| Date startTime = DateUtils.stringToDate(startdate + " 00:00:00"); | |||||
| Date startTime = DateUtils.stringToDate(startdate); | |||||
| wxCoupon.setStartdate(startTime); | wxCoupon.setStartdate(startTime); | ||||
| } | } | ||||
| if(enddate == null){ | |||||
| wxCoupon.setEnddate(new Date()); | |||||
| if(paramsMap.get("enddate") == null){ | |||||
| wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); | |||||
| }else{ | }else{ | ||||
| Date endTime = DateUtils.stringToDate(enddate + " 23:59:59"); | |||||
| Date endTime = DateUtils.stringToDate(enddate); | |||||
| wxCoupon.setEnddate(endTime); | wxCoupon.setEnddate(endTime); | ||||
| } | } | ||||
| Map<String,Object> result = new HashedMap(); | |||||
| List<WxCoupon> saleMoneyList = wxCouponService.findSaleMoneyByDate(wxCoupon); | List<WxCoupon> saleMoneyList = wxCouponService.findSaleMoneyByDate(wxCoupon); | ||||
| List<WxCoupon> paymentList = wxCouponService.findPaymentByDate(wxCoupon); | List<WxCoupon> paymentList = wxCouponService.findPaymentByDate(wxCoupon); | ||||
| Map<String,Long> saleMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); | Map<String,Long> saleMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); | ||||
| @@ -1508,49 +1506,40 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| //卡营销数据 | |||||
| //卷营销数据 | |||||
| if (chart.equals(EnumChart.SALE_COUPON.getCode())) { | if (chart.equals(EnumChart.SALE_COUPON.getCode())) { | ||||
| WxCoupon wxCoupon = new WxCoupon(); | WxCoupon wxCoupon = new WxCoupon(); | ||||
| //默认时间本月第一天,截止到当天 | |||||
| Map<String,Object> result = new HashedMap(); | Map<String,Object> result = new HashedMap(); | ||||
| if(startdate == null){ | |||||
| //默认时间本月第一天,截止到当天 | |||||
| if(paramsMap.get("startdate") == null){ | |||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| c.add(Calendar.MONTH, 0); | c.add(Calendar.MONTH, 0); | ||||
| c.set(Calendar.DAY_OF_MONTH,1); | c.set(Calendar.DAY_OF_MONTH,1); | ||||
| wxCoupon.setStartdate(c.getTime()); | wxCoupon.setStartdate(c.getTime()); | ||||
| }else{ | }else{ | ||||
| Date startTime = DateUtils.stringToDate(startdate + " 00:00:00"); | |||||
| Date startTime = DateUtils.stringToDate(startdate); | |||||
| wxCoupon.setStartdate(startTime); | wxCoupon.setStartdate(startTime); | ||||
| } | } | ||||
| if(enddate == null){ | |||||
| wxCoupon.setEnddate(new Date()); | |||||
| if(paramsMap.get("enddate") == null){ | |||||
| wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); | |||||
| }else{ | }else{ | ||||
| Date endTime = DateUtils.stringToDate(enddate + " 23:59:59"); | |||||
| Date endTime = DateUtils.stringToDate(enddate); | |||||
| wxCoupon.setEnddate(endTime); | wxCoupon.setEnddate(endTime); | ||||
| } | } | ||||
| List<WxCoupon> sendList = wxCouponService.findCouponSendCount(wxCoupon); | |||||
| List<WxCoupon> orderCountList = wxCouponService.findCouponOrderCount(wxCoupon); | List<WxCoupon> orderCountList = wxCouponService.findCouponOrderCount(wxCoupon); | ||||
| List<WxCoupon> getCountList = wxCouponService.findCouponGetCount(wxCoupon); | |||||
| List<WxCoupon> paymentCountList = wxCouponService.findCouponPaymentCount(wxCoupon); | List<WxCoupon> paymentCountList = wxCouponService.findCouponPaymentCount(wxCoupon); | ||||
| List<WxCoupon> priceCouponSaleCountList = wxCouponService.priceCouponSaleCount(wxCoupon); | List<WxCoupon> priceCouponSaleCountList = wxCouponService.priceCouponSaleCount(wxCoupon); | ||||
| List<WxCoupon> priceCouponPaymentCountList = wxCouponService.priceCouponPaymentCount(wxCoupon); | List<WxCoupon> priceCouponPaymentCountList = wxCouponService.priceCouponPaymentCount(wxCoupon); | ||||
| Map<String,Long> sendMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); | |||||
| Map<String,Long> orderCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); | Map<String,Long> orderCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); | ||||
| Map<String,Long> getCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); | |||||
| Map<String,Long> paymentCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); | Map<String,Long> paymentCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); | ||||
| Map<String,Long> priceCouponSaleCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); | Map<String,Long> priceCouponSaleCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); | ||||
| Map<String,Long> priceCouponPaymentCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); | Map<String,Long> priceCouponPaymentCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate()); | ||||
| for (WxCoupon coupon:sendList){ | |||||
| sendMap.put(coupon.getXtime(),coupon.getXcount()); | |||||
| } | |||||
| for (WxCoupon coupon:orderCountList){ | for (WxCoupon coupon:orderCountList){ | ||||
| orderCountMap.put(coupon.getXtime(),coupon.getXcount()); | orderCountMap.put(coupon.getXtime(),coupon.getXcount()); | ||||
| } | } | ||||
| for (WxCoupon coupon:getCountList){ | |||||
| getCountMap.put(coupon.getXtime(),coupon.getXcount()); | |||||
| } | |||||
| for (WxCoupon coupon:paymentCountList){ | for (WxCoupon coupon:paymentCountList){ | ||||
| paymentCountMap.put(coupon.getXtime(),coupon.getXcount()); | paymentCountMap.put(coupon.getXtime(),coupon.getXcount()); | ||||
| } | } | ||||
| @@ -1560,9 +1549,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| for (WxCoupon coupon:priceCouponPaymentCountList){ | for (WxCoupon coupon:priceCouponPaymentCountList){ | ||||
| priceCouponPaymentCountMap.put(coupon.getXtime(),coupon.getXcount()); | priceCouponPaymentCountMap.put(coupon.getXtime(),coupon.getXcount()); | ||||
| } | } | ||||
| result.put("sendList",sendMap); | |||||
| result.put("orderCountList",orderCountMap); | result.put("orderCountList",orderCountMap); | ||||
| result.put("getCountList",getCountMap); | |||||
| result.put("paymentCountList",paymentCountMap); | result.put("paymentCountList",paymentCountMap); | ||||
| result.put("priceCouponSaleCountList",priceCouponSaleCountMap); | result.put("priceCouponSaleCountList",priceCouponSaleCountMap); | ||||
| result.put("priceCouponPaymentCountList",priceCouponPaymentCountMap); | result.put("priceCouponPaymentCountList",priceCouponPaymentCountMap); | ||||
| @@ -354,20 +354,11 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCouponData(record)); | return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCouponData(record)); | ||||
| } | } | ||||
| @Override | |||||
| public List<WxCoupon> findCouponSendCount(WxCoupon wxCoupon) { | |||||
| return wxCouponMapper.findCouponSendCount(wxCoupon); | |||||
| } | |||||
| @Override | @Override | ||||
| public List<WxCoupon> findCouponOrderCount(WxCoupon wxCoupon) { | public List<WxCoupon> findCouponOrderCount(WxCoupon wxCoupon) { | ||||
| return wxCouponMapper.findCouponOrderCount(wxCoupon); | return wxCouponMapper.findCouponOrderCount(wxCoupon); | ||||
| } | } | ||||
| @Override | |||||
| public List<WxCoupon> findCouponGetCount(WxCoupon wxCoupon) { | |||||
| return wxCouponMapper.findCouponGetCount(wxCoupon); | |||||
| } | |||||
| @Override | @Override | ||||
| public List<WxCoupon> findCouponPaymentCount(WxCoupon wxCoupon) { | public List<WxCoupon> findCouponPaymentCount(WxCoupon wxCoupon) { | ||||
| @@ -398,4 +389,10 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| public Long findSumSubsidyMoney(WxCoupon wxCoupon) { | public Long findSumSubsidyMoney(WxCoupon wxCoupon) { | ||||
| return wxCouponMapper.findSumSubsidyMoney(wxCoupon); | return wxCouponMapper.findSumSubsidyMoney(wxCoupon); | ||||
| } | } | ||||
| @Override | |||||
| public PageInfo<WxCoupon> findPressData(WxCoupon record, Integer pageNum, Integer pageSize) { | |||||
| return null; | |||||
| } | |||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.service.impl; | package com.iformall.service.impl; | ||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.WxMsgRecordService; | import com.iformall.service.WxMsgRecordService; | ||||
| @@ -20,14 +21,17 @@ public class WxMsgRecordServiceImpl implements WxMsgRecordService { | |||||
| @Override | @Override | ||||
| public void save(BaseMsg data) { | public void save(BaseMsg data) { | ||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| data.setUuid(UUID.randomUUID().toString()); | data.setUuid(UUID.randomUUID().toString()); | ||||
| if(data instanceof WxMsgRecord){ | if(data instanceof WxMsgRecord){ | ||||
| WxMsgRecord msgRecord = (WxMsgRecord)data; | WxMsgRecord msgRecord = (WxMsgRecord)data; | ||||
| msgRecord.setMsgJson(JsonUtil.obj2Json(data)); | msgRecord.setMsgJson(JsonUtil.obj2Json(data)); | ||||
| msgRecord.setId(idWorker.nextId()); | |||||
| wxMsgRecordMapper.save(msgRecord); | wxMsgRecordMapper.save(msgRecord); | ||||
| }else if(data instanceof WxMsg || data instanceof MailMsg){ | }else if(data instanceof WxMsg || data instanceof MailMsg){ | ||||
| WxMsgRecord msgRecord = new WxMsgRecord(); | WxMsgRecord msgRecord = new WxMsgRecord(); | ||||
| msgRecord.setMsgJson(JsonUtil.obj2Json(data)); | msgRecord.setMsgJson(JsonUtil.obj2Json(data)); | ||||
| msgRecord.setId(idWorker.nextId()); | |||||
| wxMsgRecordMapper.save(msgRecord); | wxMsgRecordMapper.save(msgRecord); | ||||
| } | } | ||||
| } | } | ||||
| @@ -730,8 +730,11 @@ | |||||
| (select count(distinct wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 1 and wc.id = c.id) as payment_count, | (select count(distinct wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 1 and wc.id = c.id) as payment_count, | ||||
| (select count(distinct wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 3 and wc.id = c.id) as backpay_count | (select count(distinct wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 3 and wc.id = c.id) as backpay_count | ||||
| from wx_coupon c where 1=1 | from wx_coupon c where 1=1 | ||||
| <if test=" null != type "> | |||||
| and c.type = #{type} | |||||
| <if test=" 1 == type "> | |||||
| and c.sale_price > 0 | |||||
| </if> | |||||
| <if test=" 2 == type "> | |||||
| and c.sale_price = 0 | |||||
| </if> | </if> | ||||
| <if test="id != null"> | <if test="id != null"> | ||||
| and c.id = #{id} | and c.id = #{id} | ||||
| @@ -739,32 +742,32 @@ | |||||
| order by status asc,create_date desc | order by status asc,create_date desc | ||||
| </select> | </select> | ||||
| <!-- | |||||
| <select id="findCouponSendCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon"> | <select id="findCouponSendCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon"> | ||||
| select DATE_FORMAT(c.create_time,'%Y-%m-%d') xtime,count(id) xcount from wx_coupon_action_log c | select DATE_FORMAT(c.create_time,'%Y-%m-%d') xtime,count(id) xcount from wx_coupon_action_log c | ||||
| where c.create_time between #{startdate} and #{enddate} | where c.create_time between #{startdate} and #{enddate} | ||||
| group by xtime | group by xtime | ||||
| </select> | </select> | ||||
| <select id="findCouponOrderCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon"> | |||||
| <select id="findCouponGetCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon"> | |||||
| select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c | select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c | ||||
| left join wx_coupon_order wco on c.id = wco.coupon_id | left join wx_coupon_order wco on c.id = wco.coupon_id | ||||
| where 1=1 | where 1=1 | ||||
| and wco.create_date between #{startdate} and #{enddate} | and wco.create_date between #{startdate} and #{enddate} | ||||
| and wco.coupon_price > 0 | |||||
| and wco.coupon_price = 0 | |||||
| group by xtime | group by xtime | ||||
| </select> | </select> | ||||
| --> | |||||
| <select id="findCouponGetCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon"> | |||||
| <select id="findCouponOrderCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon"> | |||||
| select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c | select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c | ||||
| left join wx_coupon_order wco on c.id = wco.coupon_id | left join wx_coupon_order wco on c.id = wco.coupon_id | ||||
| where 1=1 | where 1=1 | ||||
| and wco.create_date between #{startdate} and #{enddate} | and wco.create_date between #{startdate} and #{enddate} | ||||
| and wco.coupon_price = 0 | |||||
| group by xtime | group by xtime | ||||
| </select> | </select> | ||||
| <select id="findCouponPaymentCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon"> | <select id="findCouponPaymentCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon"> | ||||
| select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c,wx_coupon_order wco | select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(wco.id) xcount from wx_coupon c,wx_coupon_order wco | ||||
| where wco.coupon_id = c.id and wco.coupon_order_status = 1 | where wco.coupon_id = c.id and wco.coupon_order_status = 1 | ||||