| | |
| | | private SysOrderService sysOrderService; |
| | | |
| | | @Autowired |
| | | private AchieveNewService achieveNewService; |
| | | |
| | | @Autowired |
| | | private AchieveNewDao achieveNewDao; |
| | | |
| | | @ApiOperation(value = "顾问业绩排行榜", notes = "顾问业绩排行榜") |
| | |
| | | }) |
| | | @PostMapping(value = "/findStaffAchieveRanking") |
| | | public AjaxResult findStaffAchieveRanking(@RequestBody RankingDto rankingDto) { |
| | | return null; |
| | | SysOrder sysOrder = new SysOrder(); |
| | | if (DataAuthUtil.hasAllShopAuth()) { |
| | | QueryUtil.setQueryLimitCom(sysOrder); |
| | | } else { |
| | | QueryUtil.setQueryLimit(sysOrder); |
| | | } |
| | | sysOrder.setType(rankingDto.getType()); |
| | | return AjaxResult.buildSuccessInstance(sysOrderService.findStaffSaleAchieveRanking(sysOrder)); |
| | | } |
| | | |
| | | @ApiOperation(value = "门店业绩排行榜", notes = "门店业绩排行榜") |
| | |
| | | }) |
| | | @PostMapping(value = "/findBeauticianAchieveRanking") |
| | | public AjaxResult findBeauticianAchieveRanking(@RequestBody RankingDto rankingDto) { |
| | | return null; |
| | | AchieveNew achieveNew = new AchieveNew(); |
| | | if (DataAuthUtil.hasAllShopAuth()) { |
| | | QueryUtil.setQueryLimitCom(achieveNew); |
| | | } else { |
| | | QueryUtil.setQueryLimit(achieveNew); |
| | | } |
| | | achieveNew.setDatatime(new Date()); |
| | | achieveNew.setT1(rankingDto.getType()); |
| | | return AjaxResult.buildSuccessInstance(achieveNewDao.selectBeauticianConsumeAchieveRanking(achieveNew)); |
| | | } |
| | | } |
| | |
| | | List<OrderDetailAchieveItemVo> selectApiOrderItemAchieve(@Param("itemId") Long itemId); |
| | | |
| | | List<RankingVo> selectShopConsumeAchieveRanking(AchieveNew achieveNew); |
| | | |
| | | List<RankingVo> selectBeauticianConsumeAchieveRanking(AchieveNew achieveNew); |
| | | } |
| | |
| | | OrderDetailVo selectApiOrderDetailById(@Param("orderId") Long orderId); |
| | | |
| | | List<RankingVo> selectShopAchieveRanking(@Param("record") SysOrder sysOrder); |
| | | |
| | | List<RankingVo> selectStaffSaleAchieveRanking(@Param("record") SysOrder sysOrder); |
| | | } |
| | |
| | | OrderDetailVo findApiOrderDetailByOrderId(Long orderId); |
| | | |
| | | List<RankingVo> findApiShopAchieveRanking(SysOrder sysOrder); |
| | | |
| | | List<RankingVo> findStaffSaleAchieveRanking(SysOrder sysOrder); |
| | | } |
| | |
| | | public List<RankingVo> findApiShopAchieveRanking(SysOrder sysOrder) { |
| | | return sysOrderDao.selectShopAchieveRanking(sysOrder); |
| | | } |
| | | |
| | | @Override |
| | | public List<RankingVo> findStaffSaleAchieveRanking(SysOrder sysOrder) { |
| | | return sysOrderDao.selectShopAchieveRanking(sysOrder); |
| | | } |
| | | } |
| | |
| | | group by a.shop_id |
| | | order by amount desc, a.shop_id |
| | | </select> |
| | | |
| | | <select id="selectBeauticianConsumeAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> |
| | | select |
| | | b.su_name name, |
| | | sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume, 0) + IFNULL(a.consume, 0)) amount, |
| | | c.shop_short_name shopName |
| | | from achieve_new a |
| | | inner join sys_users b on a.beault_id=b.su_id |
| | | left join sys_shop_info c on a.shop_id=c.ID |
| | | where a.order_type='服务单' |
| | | <where> |
| | | <if test="record.companyId != null"> |
| | | and a.company_id=#{record.companyId} |
| | | </if> |
| | | <if test="record.shopId != null"> |
| | | and a.shop_id=#{record.shopId} |
| | | </if> |
| | | <if test='record.t1 == "1" and record.orderTime != null'> |
| | | and date_format(datatime, '%Y-%m-%d') = date_format(#{record.datatime}, '%Y-%m-%d') |
| | | </if> |
| | | <if test='record.t1 == "2" and record.orderTime != null'> |
| | | and date_format(datatime, '%Y-%m') = date_format(#{record.datatime}, '%Y-%m') |
| | | </if> |
| | | <if test='record.t1 == "3" and record.orderTime != null'> |
| | | and date_format(datatime, '%Y') = date_format(#{record.datatime}, '%Y') |
| | | </if> |
| | | </where> |
| | | group by a.beault_id |
| | | order by amount desc |
| | | </select> |
| | | </mapper> |
| | |
| | | from sys_order a |
| | | left join sys_shop_info b on a.SHOP_ID=b.ID |
| | | <where> |
| | | a.statu in ('已付款', '欠款') |
| | | <if test="record.companyId != null"> |
| | | and a.company_id=#{record.companyId} |
| | | </if> |
| | |
| | | group by a.SHOP_ID |
| | | order by amount desc, a.shop_id |
| | | </select> |
| | | |
| | | <select id="selectStaffSaleAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> |
| | | select |
| | | b.su_name name, |
| | | b.su_photo photo, |
| | | sum(ZK_TOTAL) amount, |
| | | c.shop_short_name shopName |
| | | from sys_order a |
| | | left join sys_users b on a.STAFF_ID=b.su_id |
| | | left join sys_shop_info c on a.SHOP_ID=c.ID |
| | | <where> |
| | | a.statu in ('已付款', '欠款') and b.su_id is not null |
| | | <if test="record.companyId != null"> |
| | | and a.company_id=#{record.companyId} |
| | | </if> |
| | | <if test="record.shopId != null"> |
| | | and a.shop_id=#{record.shopId} |
| | | </if> |
| | | <if test='record.type == "1" and record.orderTime != null'> |
| | | and date_format(order_time, '%Y-%m-%d') = date_format(#{record.orderTime}, '%Y-%m-%d') |
| | | </if> |
| | | <if test='record.type == "2" and record.orderTime != null'> |
| | | and date_format(order_time, '%Y-%m') = date_format(#{record.orderTime}, '%Y-%m') |
| | | </if> |
| | | <if test='record.type == "3" and record.orderTime != null'> |
| | | and date_format(order_time, '%Y') = date_format(#{record.orderTime}, '%Y') |
| | | </if> |
| | | </where> |
| | | group by b.su_id |
| | | order by amount desc, a.su_id |
| | | </select> |
| | | </mapper> |