功能调整
This commit is contained in:
parent
1a1965bd82
commit
e260df48a0
|
@ -119,9 +119,9 @@ public class ArtificerController {
|
||||||
@ApiOperation("查询技师列表")
|
@ApiOperation("查询技师列表")
|
||||||
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId, String artificerName,
|
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId, String artificerName,
|
||||||
String longitude,String latitude,Integer sort,Integer authentication,
|
String longitude,String latitude,Integer sort,Integer authentication,
|
||||||
Integer by,Integer status,String city,String classifyId,String phone,Integer isStart,Integer technicianType,String isBack){
|
Integer by,Integer status,String city,String classifyId,String phone,Integer isStart,Integer technicianType,String isBack,Integer isGoods){
|
||||||
return artificerService.selectArtificerList(page, limit, massageTypeId, artificerName,longitude,latitude,
|
return artificerService.selectArtificerList(page, limit, massageTypeId, artificerName,longitude,latitude,
|
||||||
sort,authentication,by,status,city,classifyId,phone,null,isStart,technicianType,isBack);
|
sort,authentication,by,status,city,classifyId,phone,null,isStart,technicianType,isBack,isGoods);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/selectArtificer")
|
@GetMapping("/selectArtificer")
|
||||||
|
@ -451,19 +451,36 @@ public class ArtificerController {
|
||||||
return Result.success().put("data",result);
|
return Result.success().put("data",result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @GetMapping("/selectArtificerMoneyList")
|
||||||
|
// @ApiOperation("技师收益排行榜(在线时长+业绩++加钟率+充值率)")
|
||||||
|
// public Result selectArtificerMoneyList(Integer page,Integer limit,String startTime,String endTime,String title,String classifyId){
|
||||||
|
// return artificerService.selectArtificerMoneyList(page, limit, startTime, endTime, title,classifyId);
|
||||||
|
// }
|
||||||
|
|
||||||
@GetMapping("/selectArtificerMoneyList")
|
@GetMapping("/selectArtificerMoneyList")
|
||||||
@ApiOperation("技师收益排行榜(在线时长+业绩++加钟率+充值率)")
|
@ApiOperation("技师收益排行榜(在线时长+业绩++加钟率+充值率)")
|
||||||
public Result selectArtificerMoneyList(Integer page,Integer limit,String startTime,String endTime,String title,String classifyId){
|
public Result selectArtificerMoneyList(Integer page,Integer limit,String startTime,String endTime,Integer status,Integer px,Integer type){
|
||||||
return artificerService.selectArtificerMoneyList(page, limit, startTime, endTime, title,classifyId);
|
return artificerService.selectArtificerMoneyList(page, limit, startTime, endTime, status, px, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/selectArtificerPhbList")
|
@GetMapping("/selectArtificerPhbList")
|
||||||
@ApiOperation("排行榜(在线时长+业绩++加钟率+充值率)")
|
@ApiOperation("排行榜(在线时长+业绩++加钟率+充值率+积分)")
|
||||||
public Result selectArtificerPhbList(Integer page,Integer limit,String startTime,String endTime,String type){
|
public Result selectArtificerPhbList(Integer page,Integer limit,String startTime,String endTime,String type){
|
||||||
return artificerService.selectArtificerPhbList(page, limit, startTime, endTime, type);
|
return artificerService.selectArtificerPhbList(page, limit, startTime, endTime, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getJfDetailList")
|
||||||
|
@ApiOperation("排行榜(积分详情)")
|
||||||
|
public Result getJfDetailList(Integer page,Integer limit,Long artificerId,String startTime,String endTime,Integer classify){
|
||||||
|
return artificerService.getJfDetailList(page, limit, artificerId, startTime, endTime, classify);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/insertJfDetail")
|
||||||
|
@ApiOperation("修改积分")
|
||||||
|
public Result insertJfDetail(Long artificerId, String artificerName, Integer type, BigDecimal integral, String remarks){
|
||||||
|
artificerService.insertJfDetail(artificerId, artificerName, type, integral, remarks);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/selectArtificerOrdersList")
|
@GetMapping("/selectArtificerOrdersList")
|
||||||
@ApiOperation("查询进行中的技师订单")
|
@ApiOperation("查询进行中的技师订单")
|
||||||
|
|
|
@ -135,12 +135,12 @@ public class AppArtificerController {
|
||||||
@ApiOperation("查询技师列表")
|
@ApiOperation("查询技师列表")
|
||||||
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId, String artificerName,
|
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId, String artificerName,
|
||||||
String longitude,String latitude,Integer sort,Integer authentication,
|
String longitude,String latitude,Integer sort,Integer authentication,
|
||||||
Integer by,String city,String classifyId,String phone, Integer isStart,Integer technicianType,String isBack,Integer status){
|
Integer by,String city,String classifyId,String phone, Integer isStart,Integer technicianType,String isBack,Integer status,Integer isGoods) {
|
||||||
if(status == null){
|
if(status == null){
|
||||||
status = -1;
|
status = -1;
|
||||||
}
|
}
|
||||||
return artificerService.selectArtificerList(page, limit, massageTypeId, artificerName,longitude,latitude,
|
return artificerService.selectArtificerList(page, limit, massageTypeId, artificerName,longitude,latitude,
|
||||||
sort,authentication,by,status,city,classifyId,phone,1,isStart,technicianType,isBack);
|
sort,authentication,by,status,city,classifyId,phone,1,isStart,technicianType,isBack,isGoods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.sqx.modules.artificer.entity.Artificer;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -22,7 +23,7 @@ public interface ArtificerDao extends BaseMapper<Artificer> {
|
||||||
@Param("authentication") Integer authentication,@Param("by") Integer by,
|
@Param("authentication") Integer authentication,@Param("by") Integer by,
|
||||||
@Param("status") Integer status,@Param("city") String city,
|
@Param("status") Integer status,@Param("city") String city,
|
||||||
@Param("classifyId") String classifyId,@Param("phone") String phone,
|
@Param("classifyId") String classifyId,@Param("phone") String phone,
|
||||||
Integer user,@Param("isStart") Integer isStart,@Param("technicianType")Integer technicianType,@Param("isBack")String isBack, @Param("userIdList")List<Long> userIdList);
|
Integer user,@Param("isStart") Integer isStart,@Param("technicianType")Integer technicianType,@Param("isBack")String isBack, @Param("userIdList")List<Long> userIdList,@Param("isGoods") Integer isGoods);
|
||||||
|
|
||||||
Artificer selectArtificerById(@Param("userId") Long userId,@Param("artificerId") Long artificerId,@Param("longitude") String longitude,@Param("latitude") String latitude);
|
Artificer selectArtificerById(@Param("userId") Long userId,@Param("artificerId") Long artificerId,@Param("longitude") String longitude,@Param("latitude") String latitude);
|
||||||
|
|
||||||
|
@ -55,4 +56,11 @@ public interface ArtificerDao extends BaseMapper<Artificer> {
|
||||||
IPage<Map<String, Object>> getJzlList(Page<Object> objectPage, String startTime, String endTime);
|
IPage<Map<String, Object>> getJzlList(Page<Object> objectPage, String startTime, String endTime);
|
||||||
|
|
||||||
IPage<Map<String, Object>> getCzlList(Page<Object> objectPage, String startTime, String endTime);
|
IPage<Map<String, Object>> getCzlList(Page<Object> objectPage, String startTime, String endTime);
|
||||||
|
|
||||||
|
IPage<Map<String, Object>> getJfList(Page<Object> objectPage, String startTime, String endTime);
|
||||||
|
|
||||||
|
IPage<Map<String, Object>> getJfDetailList(Page<Object> objectPage,@Param("artificerId") Long artificerId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("classify") Integer classify);
|
||||||
|
|
||||||
|
void insertJfDetail(Long artificerId, String artificerName, Integer type, BigDecimal integral,String remarks);
|
||||||
|
|
||||||
}
|
}
|
|
@ -106,8 +106,12 @@ public interface OrdersDao extends BaseMapper<Orders> {
|
||||||
|
|
||||||
String selectOrdersArtificerIntegraladdNum(Long artificerId, String endDate, String startDate);
|
String selectOrdersArtificerIntegraladdNum(Long artificerId, String endDate, String startDate);
|
||||||
|
|
||||||
|
BigDecimal selectOrdersArtificerAddMoney(Long artificerId, String endDate, String startDate);
|
||||||
|
|
||||||
String selectOrdersCurrentPeriodRechargeSum(Long artificerId, String endDate, String startDate,@Param("isSfwc") Integer isSfwc);
|
String selectOrdersCurrentPeriodRechargeSum(Long artificerId, String endDate, String startDate,@Param("isSfwc") Integer isSfwc);
|
||||||
|
|
||||||
|
BigDecimal selectOrdersRechargeMoney(Long artificerId, String endDate, String startDate);
|
||||||
|
|
||||||
String selectOrdersStoredValueIntegral(Long artificerId, String endDate, String startDate);
|
String selectOrdersStoredValueIntegral(Long artificerId, String endDate, String startDate);
|
||||||
|
|
||||||
String selectOnlineCredits(Long artificerId, String endDate, String startDate);
|
String selectOnlineCredits(Long artificerId, String endDate, String startDate);
|
||||||
|
@ -148,4 +152,6 @@ public interface OrdersDao extends BaseMapper<Orders> {
|
||||||
|
|
||||||
BigDecimal selectSumRefund(Long artificerId, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
BigDecimal selectSumRefund(Long artificerId, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||||
|
|
||||||
|
IPage<Map<String,Object>> selectArtificerMoneyList(Page<Map<String,Object>> page,String startTime,String endTime,Integer status,Integer by);
|
||||||
|
|
||||||
}
|
}
|
|
@ -7,6 +7,7 @@ import com.sqx.common.utils.Result;
|
||||||
import com.sqx.modules.artificer.entity.Artificer;
|
import com.sqx.modules.artificer.entity.Artificer;
|
||||||
import com.sqx.modules.chat.entity.ChatContent;
|
import com.sqx.modules.chat.entity.ChatContent;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +15,7 @@ public interface ArtificerService extends IService<Artificer> {
|
||||||
|
|
||||||
Result selectArtificerList(Integer page, Integer limit, Long massageTypeId, String artificerName,
|
Result selectArtificerList(Integer page, Integer limit, Long massageTypeId, String artificerName,
|
||||||
String longitude,String latitude,Integer sort,Integer authentication,
|
String longitude,String latitude,Integer sort,Integer authentication,
|
||||||
Integer by,Integer status,String city,String classifyId,String phone,Integer user, Integer isStart,Integer technicianType,String isBack);
|
Integer by,Integer status,String city,String classifyId,String phone,Integer user, Integer isStart,Integer technicianType,String isBack, Integer isGoods);
|
||||||
|
|
||||||
Artificer selectArtificerById(Long userId,Long artificerId,String longitude,String latitude);
|
Artificer selectArtificerById(Long userId,Long artificerId,String longitude,String latitude);
|
||||||
|
|
||||||
|
@ -26,7 +27,7 @@ public interface ArtificerService extends IService<Artificer> {
|
||||||
|
|
||||||
Result signIn(Long userId, String longitude, String latitude, String city,String address);
|
Result signIn(Long userId, String longitude, String latitude, String city,String address);
|
||||||
|
|
||||||
Result selectArtificerMoneyList(Integer page,Integer limit,String startTime,String endTime,String title,String classifyId);
|
Result selectArtificerMoneyList(Integer page,Integer limit,String startTime,String endTime,Integer status,Integer px,Integer type);
|
||||||
|
|
||||||
Result selectUserListByConsortiaId(Integer page,Integer limit,String userName,String phone,Long consortiaId,Long shopId,Integer flag,String time);
|
Result selectUserListByConsortiaId(Integer page,Integer limit,String userName,String phone,Long consortiaId,Long shopId,Integer flag,String time);
|
||||||
|
|
||||||
|
@ -49,4 +50,8 @@ public interface ArtificerService extends IService<Artificer> {
|
||||||
Artificer selectByPhone(String mobile);
|
Artificer selectByPhone(String mobile);
|
||||||
|
|
||||||
Result selectArtificerPhbList(Integer page, Integer limit, String startTime, String endTime, String type);
|
Result selectArtificerPhbList(Integer page, Integer limit, String startTime, String endTime, String type);
|
||||||
|
|
||||||
|
Result getJfDetailList(Integer page,Integer limit,Long artificerId,String startTime,String endTime,Integer classify);
|
||||||
|
|
||||||
|
void insertJfDetail(Long artificerId, String artificerName, Integer type, BigDecimal integral, String remarks);
|
||||||
}
|
}
|
|
@ -81,7 +81,7 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
||||||
@Override
|
@Override
|
||||||
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId,String artificerName,
|
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId,String artificerName,
|
||||||
String longitude,String latitude,Integer sort,Integer authentication,
|
String longitude,String latitude,Integer sort,Integer authentication,
|
||||||
Integer by,Integer status,String city,String classifyId,String phone,Integer user, Integer isStart,Integer technicianType,String isBack){
|
Integer by,Integer status,String city,String classifyId,String phone,Integer user, Integer isStart,Integer technicianType,String isBack, Integer isGoods){
|
||||||
Page<Artificer> pages=new Page<>(page,limit);
|
Page<Artificer> pages=new Page<>(page,limit);
|
||||||
|
|
||||||
if(StringUtils.isEmpty(longitude)){
|
if(StringUtils.isEmpty(longitude)){
|
||||||
|
@ -110,7 +110,7 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, massageTypeId, artificerName,
|
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, massageTypeId, artificerName,
|
||||||
longitude, latitude, sort, authentication, by, status, city, classifyId,phone,user,isStart,technicianType,isBack,userIdList);
|
longitude, latitude, sort, authentication, by, status, city, classifyId,phone,user,isStart,technicianType,isBack,userIdList,isGoods);
|
||||||
List<Artificer> records = artificerIPage.getRecords();
|
List<Artificer> records = artificerIPage.getRecords();
|
||||||
String value = commonInfoService.findOne(392).getValue();
|
String value = commonInfoService.findOne(392).getValue();
|
||||||
if("30".equals(value)){
|
if("30".equals(value)){
|
||||||
|
@ -612,54 +612,116 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public Result selectArtificerMoneyList(Integer page,Integer limit,String startTime,String endTime,String title,String classifyId){
|
||||||
|
// IPage<Map<String,Object>> pageList = baseMapper.selectArtificerMoneyList(new Page<>(page,limit),startTime,endTime,title,classifyId);
|
||||||
|
// for(Map<String,Object> map:pageList.getRecords()){
|
||||||
|
// Long artificerId = Long.parseLong(map.get("artificerId").toString());
|
||||||
|
// //当期业绩
|
||||||
|
//// BigDecimal currentPerformance = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, endTime, startTime);
|
||||||
|
// Integer dqyjOld = ordersDao.selectOrdersArtificerIntegralAchievement(artificerId, endTime, startTime);
|
||||||
|
// BigDecimal currentPerformance = new BigDecimal(dqyjOld);
|
||||||
|
// currentPerformance = currentPerformance.setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||||
|
// map.put("yj",String.valueOf(currentPerformance));
|
||||||
|
//
|
||||||
|
// //首页
|
||||||
|
// BigDecimal earnings = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, endTime, startTime);
|
||||||
|
// map.put("sy",String.valueOf(earnings));
|
||||||
|
//
|
||||||
|
// //当期订单数:计算订单发生了按摩行为的订单数,订单状态经历了开始服务到订单结束。
|
||||||
|
// String currentPeriodOrdersSum = ordersDao.selectOrdersArtificerIntegral(artificerId, endTime, startTime);
|
||||||
|
// BigDecimal currentPeriodOrdersSumBig = new BigDecimal(currentPeriodOrdersSum);
|
||||||
|
//
|
||||||
|
// //当期加钟率:本周期内,加钟数/本单数
|
||||||
|
//// String v = ordersDao.selectOrdersArtificerIntegraladdNum(artificerId, endTime, startTime);
|
||||||
|
//// //加钟数
|
||||||
|
//// BigDecimal currentPeriodAddBellsSumBig = new BigDecimal(v);
|
||||||
|
//// //加钟率
|
||||||
|
//// BigDecimal clockRate = BigDecimal.ZERO;
|
||||||
|
//// //充值率
|
||||||
|
//// BigDecimal divide1 = BigDecimal.ZERO;
|
||||||
|
//// if (currentPeriodOrdersSumBig.compareTo(new BigDecimal("0")) != 0) {
|
||||||
|
//// clockRate = currentPeriodAddBellsSumBig.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP);//加钟率
|
||||||
|
////
|
||||||
|
//// //当前周期充值率(本周期内充值订单数/本单数)
|
||||||
|
//// String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, endTime, startTime,1);
|
||||||
|
//// BigDecimal c = new BigDecimal(currentPeriodRechargeSum);
|
||||||
|
//// divide1 = c.divide(currentPeriodOrdersSumBig, 2, BigDecimal.ROUND_HALF_UP);//充值率
|
||||||
|
//// } else {
|
||||||
|
//// clockRate = new BigDecimal("0");
|
||||||
|
//// divide1 = new BigDecimal("0");
|
||||||
|
//// }
|
||||||
|
//// map.put("jzl",String.valueOf(clockRate));//加钟率
|
||||||
|
//// map.put("czl",String.valueOf(divide1));//充值率
|
||||||
|
//
|
||||||
|
// BigDecimal addMoney = ordersDao.selectOrdersArtificerAddMoney(artificerId, endTime, startTime);
|
||||||
|
// BigDecimal divideMoney = ordersDao.selectOrdersRechargeMoney(artificerId, endTime, startTime);
|
||||||
|
// map.put("jzl",addMoney.toString());//加钟金额
|
||||||
|
// map.put("czl",divideMoney.toString());//充值金额
|
||||||
|
//
|
||||||
|
// //在线时长
|
||||||
|
// String mint = ordersDao.selectOrdersZxscNum(artificerId,startTime,endTime);
|
||||||
|
// map.put("zxsc",String.valueOf(mint));//在线时长
|
||||||
|
// map.put("ddsl",currentPeriodOrdersSum);//订单数量
|
||||||
|
// }
|
||||||
|
// return Result.success().put("data",pageList);
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result selectArtificerMoneyList(Integer page,Integer limit,String startTime,String endTime,String title,String classifyId){
|
public Result selectArtificerMoneyList(Integer page,Integer limit,String startTime,String endTime,Integer status,Integer px,Integer type){
|
||||||
IPage<Map<String,Object>> pageList = baseMapper.selectArtificerMoneyList(new Page<>(page,limit),startTime,endTime,title,classifyId);
|
Integer by = 1;
|
||||||
for(Map<String,Object> map:pageList.getRecords()){
|
if(px!=null && type!=null){
|
||||||
Long artificerId = Long.parseLong(map.get("artificerId").toString());
|
if(px == 1){
|
||||||
//当期业绩
|
switch (type){
|
||||||
// BigDecimal currentPerformance = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, endTime, startTime);
|
case 1:
|
||||||
Integer dqyjOld = ordersDao.selectOrdersArtificerIntegralAchievement(artificerId, endTime, startTime);
|
by = 1;
|
||||||
BigDecimal currentPerformance = new BigDecimal(dqyjOld);
|
break;
|
||||||
currentPerformance = currentPerformance.setScale(0,BigDecimal.ROUND_DOWN);
|
case 2:
|
||||||
map.put("yj",String.valueOf(currentPerformance));
|
by = 3;
|
||||||
|
break;
|
||||||
//首页
|
case 3:
|
||||||
BigDecimal earnings = ordersDao.selectOrdersArtificerIntegralEarnings(artificerId, endTime, startTime);
|
by = 5;
|
||||||
map.put("sy",String.valueOf(earnings));
|
break;
|
||||||
|
case 4:
|
||||||
//当期订单数:计算订单发生了按摩行为的订单数,订单状态经历了开始服务到订单结束。
|
by = 7;
|
||||||
String currentPeriodOrdersSum = ordersDao.selectOrdersArtificerIntegral(artificerId, endTime, startTime);
|
break;
|
||||||
BigDecimal currentPeriodOrdersSumBig = new BigDecimal(currentPeriodOrdersSum);
|
case 5:
|
||||||
|
by = 9;
|
||||||
//当期加钟率:本周期内,加钟数/本单数
|
break;
|
||||||
String v = ordersDao.selectOrdersArtificerIntegraladdNum(artificerId, endTime, startTime);
|
case 6:
|
||||||
//加钟数
|
by = 11;
|
||||||
BigDecimal currentPeriodAddBellsSumBig = new BigDecimal(v);
|
break;
|
||||||
//加钟率
|
case 7:
|
||||||
BigDecimal clockRate = BigDecimal.ZERO;
|
by = 11;
|
||||||
//充值率
|
break;
|
||||||
BigDecimal divide1 = BigDecimal.ZERO;
|
|
||||||
if (currentPeriodOrdersSumBig.compareTo(new BigDecimal("0")) != 0) {
|
|
||||||
clockRate = currentPeriodAddBellsSumBig.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP);//加钟率
|
|
||||||
|
|
||||||
//当前周期充值率(本周期内充值订单数/本单数)
|
|
||||||
String currentPeriodRechargeSum = ordersDao.selectOrdersCurrentPeriodRechargeSum(artificerId, endTime, startTime,1);
|
|
||||||
BigDecimal c = new BigDecimal(currentPeriodRechargeSum);
|
|
||||||
divide1 = c.divide(currentPeriodOrdersSumBig, 2, RoundingMode.HALF_UP);//充值率
|
|
||||||
} else {
|
|
||||||
clockRate = new BigDecimal("0");
|
|
||||||
divide1 = new BigDecimal("0");
|
|
||||||
}
|
}
|
||||||
map.put("jzl",String.valueOf(clockRate));//加钟率
|
}else{
|
||||||
map.put("czl",String.valueOf(divide1));//充值率
|
switch (type){
|
||||||
//在线时长
|
case 1:
|
||||||
String mint = ordersDao.selectOrdersZxscNum(artificerId,startTime,endTime);
|
by = 2;
|
||||||
map.put("zxsc",String.valueOf(mint));//在线时长
|
break;
|
||||||
map.put("ddsl",currentPeriodOrdersSum);//订单数量
|
case 2:
|
||||||
|
by = 4;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
by = 6;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
by = 8;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
by = 10;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
by = 12;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
by = 14;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IPage<Map<String,Object>> pageList = ordersDao.selectArtificerMoneyList(new Page<>(page,limit),startTime,endTime,status,by);
|
||||||
return Result.success().put("data",pageList);
|
return Result.success().put("data",pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -749,7 +811,7 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
||||||
public Result getHomeArtificerList(Integer page, Integer limit, Integer isStart,Integer status, String city, String longitude, String latitude){
|
public Result getHomeArtificerList(Integer page, Integer limit, Integer isStart,Integer status, String city, String longitude, String latitude){
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
Page<Artificer> pages=new Page<>(page,limit);
|
Page<Artificer> pages=new Page<>(page,limit);
|
||||||
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, null, "",longitude, latitude, 1, 2, 1, status, city, null,"",1,0,null,"",null);
|
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, null, "",longitude, latitude, 1, 2, 1, status, city, null,"",1,0,null,"",null,null);
|
||||||
map.put("nearData",new PageUtils(artificerIPage));
|
map.put("nearData",new PageUtils(artificerIPage));
|
||||||
map.put("startData",new PageUtils(baseMapper.getHomeStartArtificerList(pages,isStart,status,city)));
|
map.put("startData",new PageUtils(baseMapper.getHomeStartArtificerList(pages,isStart,status,city)));
|
||||||
return Result.success(map);
|
return Result.success(map);
|
||||||
|
@ -936,11 +998,27 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
||||||
pageList = baseMapper.getJzlList(new Page<>(page,limit),startTime,endTime);
|
pageList = baseMapper.getJzlList(new Page<>(page,limit),startTime,endTime);
|
||||||
}else if(StringUtils.equals(type,"4")){//充值率
|
}else if(StringUtils.equals(type,"4")){//充值率
|
||||||
pageList = baseMapper.getCzlList(new Page<>(page,limit),startTime,endTime);
|
pageList = baseMapper.getCzlList(new Page<>(page,limit),startTime,endTime);
|
||||||
|
}else if(StringUtils.equals(type,"5")){//积分
|
||||||
|
pageList = baseMapper.getJfList(new Page<>(page,limit),startTime,endTime);
|
||||||
}
|
}
|
||||||
return Result.success().put("data",pageList);
|
return Result.success().put("data",pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result getJfDetailList(Integer page,Integer limit,Long artificerId,String startTime,String endTime,Integer classify) {
|
||||||
|
IPage<Map<String,Object>> pageList = null;
|
||||||
|
if(!StringUtils.isEmpty(endTime)){
|
||||||
|
endTime = endTime+" 23:59:59";
|
||||||
|
}
|
||||||
|
pageList = baseMapper.getJfDetailList(new Page<>(page,limit),artificerId,startTime,endTime,classify);
|
||||||
|
return Result.success().put("data",pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertJfDetail(Long artificerId, String artificerName, Integer type, BigDecimal integral,String remarks) {
|
||||||
|
baseMapper.insertJfDetail(artificerId, artificerName, type, integral, remarks);
|
||||||
|
}
|
||||||
|
|
||||||
// public static void main(String[] args) {
|
// public static void main(String[] args) {
|
||||||
// String lifePhoto = "http://1.92.152.160/file/uploadPath/2024/07/09/a892623c518812421cec310d3d5e8d0a.jpg";
|
// String lifePhoto = "http://1.92.152.160/file/uploadPath/2024/07/09/a892623c518812421cec310d3d5e8d0a.jpg";
|
||||||
// String artificerImg = "https://sausers.blxinchuang.com/file/uploadPath/2024/07/03/423843a244c16b04819a131c2160c0af.png";
|
// String artificerImg = "https://sausers.blxinchuang.com/file/uploadPath/2024/07/03/423843a244c16b04819a131c2160c0af.png";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package com.sqx.modules.dlssqjl.controller.app;
|
package com.sqx.modules.dlssqjl.controller.app;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.sqx.common.utils.Result;
|
import com.sqx.common.utils.Result;
|
||||||
import com.sqx.modules.dlssqjl.entity.Dlssqjl;
|
import com.sqx.modules.dlssqjl.entity.Dlssqjl;
|
||||||
import com.sqx.modules.dlssqjl.service.DlssqjlService;
|
import com.sqx.modules.dlssqjl.service.DlssqjlService;
|
||||||
|
@ -8,9 +8,8 @@ import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/app/dlssqjl")
|
@RequestMapping("/app/dlssqjl")
|
||||||
|
@ -23,7 +22,10 @@ public class AppDlssqjlController {
|
||||||
@PostMapping("/insertDlssqjl")
|
@PostMapping("/insertDlssqjl")
|
||||||
@ApiOperation("添加代理商")
|
@ApiOperation("添加代理商")
|
||||||
public Result insertDlssqjl(@RequestBody Dlssqjl dlssqjl){
|
public Result insertDlssqjl(@RequestBody Dlssqjl dlssqjl){
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
List<Dlssqjl> list = dlssqjlService.list(new QueryWrapper<Dlssqjl>().eq("phone",dlssqjl.getPhone()));
|
||||||
|
if(list.size()>0){
|
||||||
|
return Result.error("您已申请!");
|
||||||
|
}
|
||||||
dlssqjl.setCreateTime(new Date());
|
dlssqjl.setCreateTime(new Date());
|
||||||
dlssqjlService.save(dlssqjl);
|
dlssqjlService.save(dlssqjl);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
|
@ -43,7 +45,6 @@ public class AppDlssqjlController {
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/selectDlssqjlPage")
|
@GetMapping("/selectDlssqjlPage")
|
||||||
@ApiOperation("查询代理商(分页)")
|
@ApiOperation("查询代理商(分页)")
|
||||||
public Result selectDlssqjlPage(Integer page,Integer limit,String name,String phone){
|
public Result selectDlssqjlPage(Integer page,Integer limit,String name,String phone){
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
<if test="isStart!=null and isStart!=0">
|
<if test="isStart!=null and isStart!=0">
|
||||||
and a.is_start=#{isStart}
|
and a.is_start=#{isStart}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="isGoods!=null and isGoods!=0">
|
||||||
|
and a.is_goods=#{isGoods}
|
||||||
|
</if>
|
||||||
<!-- <if test="classifyId!=null and classifyId!=0">-->
|
<!-- <if test="classifyId!=null and classifyId!=0">-->
|
||||||
<!-- and FIND_IN_SET(#{classifyId},a.classify_id) > 0-->
|
<!-- and FIND_IN_SET(#{classifyId},a.classify_id) > 0-->
|
||||||
<!-- </if>-->
|
<!-- </if>-->
|
||||||
|
@ -428,4 +431,63 @@
|
||||||
GROUP BY t.artificer_id
|
GROUP BY t.artificer_id
|
||||||
order by IFNULL(ur.num,0) / IFNULL(count(*),0) desc
|
order by IFNULL(ur.num,0) / IFNULL(count(*),0) desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getJfList" resultType="Map">
|
||||||
|
select t.artificer_id as artificerId,t.artificer_name as artificerName,
|
||||||
|
sum(case when type = 1 then IFNULL(t.integral,0) else -IFNULL(t.integral,0) end) AS typeval
|
||||||
|
from bl_artificer_integral_statistics t
|
||||||
|
<where>
|
||||||
|
<if test="startTime!=null and startTime!=''">
|
||||||
|
and t.create_time >= #{startTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime!=null and endTime!=''">
|
||||||
|
and t.create_time <= #{endTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
group BY t.artificer_id,t.artificer_name
|
||||||
|
order by IFNULL(SUM(integral),0) desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getJfDetailList" resultType="Map">
|
||||||
|
select t.artificer_id as artificerId,t.artificer_name as artificerName,
|
||||||
|
t.create_time as createTime,t.classify,t.type,t.achievement,t.integral,
|
||||||
|
t.orders_no as ordersNo,t.remarks
|
||||||
|
from bl_artificer_integral_statistics t
|
||||||
|
<where>
|
||||||
|
<if test="artificerId!=null">
|
||||||
|
and t.artificer_id = #{artificerId}
|
||||||
|
</if>
|
||||||
|
<if test="classify!=null">
|
||||||
|
and t.classify = #{classify}
|
||||||
|
</if>
|
||||||
|
<if test="startTime!=null and startTime!=''">
|
||||||
|
and t.create_time >= #{startTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime!=null and endTime!=''">
|
||||||
|
and t.create_time <= #{endTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by t.create_time,t.type
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertJfDetail">
|
||||||
|
insert into bl_artificer_integral_statistics(
|
||||||
|
artificer_id,
|
||||||
|
artificer_name,
|
||||||
|
create_time,
|
||||||
|
classify,
|
||||||
|
type,
|
||||||
|
integral,
|
||||||
|
remarks
|
||||||
|
)values(
|
||||||
|
#{artificerId},
|
||||||
|
#{artificerName},
|
||||||
|
date_format(now(),'%Y-%m-%d %H:%i:%s'),
|
||||||
|
4,
|
||||||
|
#{type},
|
||||||
|
#{integral},
|
||||||
|
#{remarks}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -1400,6 +1400,52 @@
|
||||||
and o.status in (3,5)
|
and o.status in (3,5)
|
||||||
) t
|
) t
|
||||||
</select>
|
</select>
|
||||||
|
<!-- 加钟金额-->
|
||||||
|
<select id="selectOrdersArtificerAddMoney" resultType="java.math.BigDecimal">
|
||||||
|
select
|
||||||
|
IFNULL(SUM(artificer_money),0) AS currentPeriodAddMoneySum
|
||||||
|
from (
|
||||||
|
select o.*
|
||||||
|
from orders o
|
||||||
|
left join orders o2 on o.old_orders_id = o2.orders_id and o2.status != 4
|
||||||
|
left join orders o3 on o2.old_orders_id = o3.orders_id and o3.status != 4
|
||||||
|
where o.artificer_id = #{artificerId}
|
||||||
|
and o.old_orders_id is not null
|
||||||
|
and o.status not in (4,11,15)
|
||||||
|
and o.add_num > 0
|
||||||
|
<if test="startDate!=null and startDate !=''">
|
||||||
|
and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') >= #{startDate}
|
||||||
|
</if>
|
||||||
|
<if test="endDate!=null and endDate !=''">
|
||||||
|
and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') <= #{endDate}
|
||||||
|
</if>
|
||||||
|
and o.status in (3,5)
|
||||||
|
union all
|
||||||
|
select o.*
|
||||||
|
from orders o
|
||||||
|
where o.artificer_id = #{artificerId}
|
||||||
|
and o.parent_id = 0
|
||||||
|
and o.old_orders_id is null
|
||||||
|
and o.orders_id not in (
|
||||||
|
select orders_id from orders
|
||||||
|
where old_orders_id is not null
|
||||||
|
and status != 4
|
||||||
|
)
|
||||||
|
and o.orders_id not in (
|
||||||
|
select old_orders_id from orders
|
||||||
|
where old_orders_id is not null
|
||||||
|
and status != 4
|
||||||
|
)
|
||||||
|
and o.add_num > 0
|
||||||
|
<if test="startDate!=null and startDate !=''">
|
||||||
|
and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') >= #{startDate}
|
||||||
|
</if>
|
||||||
|
<if test="endDate!=null and endDate !=''">
|
||||||
|
and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') <= #{endDate}
|
||||||
|
</if>
|
||||||
|
and o.status in (3,5)
|
||||||
|
) t
|
||||||
|
</select>
|
||||||
<!-- 充值率-->
|
<!-- 充值率-->
|
||||||
<select id="selectOrdersCurrentPeriodRechargeSum" resultType="java.lang.String">
|
<select id="selectOrdersCurrentPeriodRechargeSum" resultType="java.lang.String">
|
||||||
select IFNULL( count(*),'0') AS currentPeriodRechargeSum
|
select IFNULL( count(*),'0') AS currentPeriodRechargeSum
|
||||||
|
@ -1490,6 +1536,23 @@
|
||||||
and o.status in (3,5)
|
and o.status in (3,5)
|
||||||
) t
|
) t
|
||||||
</select>
|
</select>
|
||||||
|
<!-- 充值金额-->
|
||||||
|
<select id="selectOrdersRechargeMoney" resultType="java.math.BigDecimal">
|
||||||
|
select IFNULL(sum(money),0) AS currentPeriodRechargeMoney
|
||||||
|
from user_money_details t
|
||||||
|
inner join artificer a on a.user_id=t.user_id
|
||||||
|
where t.classify = 4
|
||||||
|
and t.state = 2
|
||||||
|
<if test="startDate!=null and startDate !=''">
|
||||||
|
and date_format(t.create_time,'%Y-%m-%d %H:%i:%s') >= #{startDate}
|
||||||
|
</if>
|
||||||
|
<if test="endDate!=null and endDate !=''">
|
||||||
|
and date_format(t.create_time,'%Y-%m-%d %H:%i:%s') <= #{endDate}
|
||||||
|
</if>
|
||||||
|
<if test="artificerId!=null and artificerId !=''">
|
||||||
|
and a.artificer_id = #{artificerId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
<!-- 储值积分数-->
|
<!-- 储值积分数-->
|
||||||
<select id="selectOrdersStoredValueIntegral" resultType="java.lang.String">
|
<select id="selectOrdersStoredValueIntegral" resultType="java.lang.String">
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -1778,4 +1841,200 @@
|
||||||
) t
|
) t
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectArtificerMoneyList" resultType="Map">
|
||||||
|
select artificerId,artificerName,sum(ddsl) as ddsl,sum(sy) as sy,sum(yj) as yj,sum(zxsc) as zxsc,sum(jzl) as jzl,sum(czl) as czl,sum(jf) as jf
|
||||||
|
from (
|
||||||
|
select artificerId,artificerName,IFNULL(count(*),0) AS ddsl,IFNULL(sum(artificer_money_total),0) AS sy,IFNULL(SUM(price_total),0) yj,0 zxsc,0 jzl,0 czl,0 jf
|
||||||
|
from (
|
||||||
|
select a.artificer_id as artificerId,a.artificer_name as artificerName,
|
||||||
|
(case when o.status = 4
|
||||||
|
then o.artificer_money + ifnull(o.add_artificer_money,0)
|
||||||
|
else o.artificer_money + ifnull(o.add_artificer_money,0) + ifnull(o2.artificer_money,0) + ifnull(o2.add_artificer_money,0) + ifnull(o3.artificer_money,0) + ifnull(o3.add_artificer_money,0)
|
||||||
|
end) as artificer_money_total,
|
||||||
|
((case when o.is_supplement in (1,3,4) then 0 else o.price end) + ifnull(o.add_price,0)
|
||||||
|
+ ifnull((case when o2.is_supplement in (1,3,4) then 0 else o2.price end),0) + ifnull(o2.add_price,0)
|
||||||
|
+ ifnull((case when o3.is_supplement in (1,3,4) then 0 else o3.price end),0) + ifnull(o3.add_price,0)
|
||||||
|
) as price_total
|
||||||
|
from artificer a
|
||||||
|
inner join tb_user b on a.user_id = b.user_id
|
||||||
|
inner join orders o on a.artificer_id = o.artificer_id
|
||||||
|
left join orders o2 on o.old_orders_id = o2.orders_id and o2.status != 4
|
||||||
|
left join orders o3 on o2.old_orders_id = o3.orders_id and o3.status != 4
|
||||||
|
where o.old_orders_id is not null
|
||||||
|
and o.status in (3,5)
|
||||||
|
<if test="startTime!=null and startTime !=''">
|
||||||
|
and date_format(o.end_times,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
<if test="endTime!=null and endTime !=''">
|
||||||
|
and date_format(o.end_times,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status==1">
|
||||||
|
and b.status = 1
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status==2">
|
||||||
|
and b.status in (2,3)
|
||||||
|
</if>
|
||||||
|
union all
|
||||||
|
select a.artificer_id as artificerId,a.artificer_name as artificerName,
|
||||||
|
o.artificer_money + ifnull(o.add_artificer_money,0) as artificer_money_total,
|
||||||
|
o.price + ifnull(o.add_price,0) as price_total
|
||||||
|
from artificer a
|
||||||
|
inner join tb_user b on a.user_id = b.user_id
|
||||||
|
inner join orders o on a.artificer_id = o.artificer_id
|
||||||
|
where o.parent_id = 0
|
||||||
|
and o.status in (3,5)
|
||||||
|
and o.old_orders_id is null
|
||||||
|
and o.orders_id not in (
|
||||||
|
select orders_id from orders
|
||||||
|
where old_orders_id is not null
|
||||||
|
and status != 4
|
||||||
|
)
|
||||||
|
and o.orders_id not in (
|
||||||
|
select old_orders_id from orders
|
||||||
|
where old_orders_id is not null
|
||||||
|
and status != 4
|
||||||
|
)
|
||||||
|
<if test="startTime!=null and startTime !=''">
|
||||||
|
and date_format(o.end_times,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
<if test="endTime!=null and endTime !=''">
|
||||||
|
and date_format(o.end_times,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status==1">
|
||||||
|
and b.status = 1
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status==2">
|
||||||
|
and b.status in (2,3)
|
||||||
|
</if>
|
||||||
|
) t
|
||||||
|
group by artificerId,artificerName
|
||||||
|
union all
|
||||||
|
select a.artificer_id as artificerId,a.artificer_name as artificerName,0 ddsl,0 sy,0 yj,IFNULL(SUM(user_recharge),0) zxsc,0 jzl,0 czl,0 jf
|
||||||
|
from artificer a
|
||||||
|
inner join tb_user b on a.user_id = b.user_id
|
||||||
|
inner join bl_user_zxsc c on a.artificer_id = c.artificer_id
|
||||||
|
<where>
|
||||||
|
<if test="startTime!=null and startTime!=''">
|
||||||
|
and date_format(c.end_times,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
<if test="endTime!=null and endTime!=''">
|
||||||
|
and date_format(c.end_times,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status==1">
|
||||||
|
and b.status = 1
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status==2">
|
||||||
|
and b.status in (2,3)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
group by a.artificer_id,a.artificer_name
|
||||||
|
union all
|
||||||
|
select a.artificer_id as artificerId,a.artificer_name as artificerName,0 ddsl,0 sy,0 yj,0 zxsc,IFNULL(SUM(artificer_money),0) jzl,0 czl,0 jf
|
||||||
|
from artificer a
|
||||||
|
inner join tb_user b on a.user_id = b.user_id
|
||||||
|
inner join orders o on a.artificer_id = o.artificer_id
|
||||||
|
where o.status in (3,5)
|
||||||
|
and o.add_num > 0
|
||||||
|
<if test="startTime!=null and startTime !=''">
|
||||||
|
and date_format(o.end_times,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
<if test="endTime!=null and endTime !=''">
|
||||||
|
and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status==1">
|
||||||
|
and b.status = 1
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status==2">
|
||||||
|
and b.status in (2,3)
|
||||||
|
</if>
|
||||||
|
group by a.artificer_id,a.artificer_name
|
||||||
|
union all
|
||||||
|
select a.artificer_id as artificerId,a.artificer_name as artificerName,0 ddsl,0 sy,0 yj,0 zxsc,0 jzl,IFNULL(sum(money),0) AS czl,0 jf
|
||||||
|
from artificer a
|
||||||
|
inner join tb_user b on a.user_id = b.user_id
|
||||||
|
inner join user_money_details c on b.user_id=c.user_id
|
||||||
|
where c.classify = 4
|
||||||
|
and c.state = 2
|
||||||
|
<if test="startTime!=null and startTime !=''">
|
||||||
|
and date_format(c.create_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
<if test="endTime!=null and endTime !=''">
|
||||||
|
and date_format(c.create_time,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status==1">
|
||||||
|
and b.status = 1
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status==2">
|
||||||
|
and b.status in (2,3)
|
||||||
|
</if>
|
||||||
|
group by a.artificer_id,a.artificer_name
|
||||||
|
union all
|
||||||
|
select a.artificer_id as artificerId,a.artificer_name as artificerName,
|
||||||
|
0 ddsl,0 sy,0 yj,0 zxsc,0 jzl,0 AS czl,
|
||||||
|
sum(case when c.type = 1 then IFNULL(c.integral,0) else -IFNULL(c.integral,0) end) AS jf
|
||||||
|
from artificer a
|
||||||
|
inner join tb_user b on a.user_id = b.user_id
|
||||||
|
inner join bl_artificer_integral_statistics c on a.artificer_id = c.artificer_id
|
||||||
|
<where>
|
||||||
|
<if test="startTime!=null and startTime!=''">
|
||||||
|
and date_format(c.create_time,'%Y-%m-%d') >= date_format(#{startTime},'%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
<if test="endTime!=null and endTime!=''">
|
||||||
|
and date_format(c.create_time,'%Y-%m-%d') <= date_format(#{endTime},'%Y-%m-%d')
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status==1">
|
||||||
|
and b.status = 1
|
||||||
|
</if>
|
||||||
|
<if test="status!=null and status==2">
|
||||||
|
and b.status in (2,3)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
group BY a.artificer_id,a.artificer_name
|
||||||
|
) tt
|
||||||
|
group by artificerId,artificerName
|
||||||
|
<if test="by!=null and by==1">
|
||||||
|
order by ddsl asc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==2">
|
||||||
|
order by ddsl desc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==3">
|
||||||
|
order by sy asc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==4">
|
||||||
|
order by sy desc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==5">
|
||||||
|
order by yj asc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==6">
|
||||||
|
order by yj desc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==7">
|
||||||
|
order by zxsc asc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==8">
|
||||||
|
order by zxsc desc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==9">
|
||||||
|
order by jzl asc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==10">
|
||||||
|
order by jzl desc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==11">
|
||||||
|
order by czl asc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==12">
|
||||||
|
order by czl desc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==13">
|
||||||
|
order by jf asc
|
||||||
|
</if>
|
||||||
|
<if test="by!=null and by==14">
|
||||||
|
order by jf desc
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
<select id="findPackageAndMassagePage" resultType="com.sqx.modules.bl.massage.entity.MassagePackage">
|
<select id="findPackageAndMassagePage" resultType="com.sqx.modules.bl.massage.entity.MassagePackage">
|
||||||
select a.id,title,a.type,b.value as type_name,old_price,price,package_img,content,content_img,add_num,sales,labels,'套餐' as flag,is_can_coupon,is_can_vip,
|
select a.id,title,a.type,b.value as type_name,old_price,price,package_img,content,content_img,add_num,sales,labels,'套餐' as flag,is_can_coupon,is_can_vip,
|
||||||
(case when a.type in (105,106) then
|
(case when a.type in (105,106,114) then
|
||||||
(
|
(
|
||||||
select sum(service_count) from bl_massage_package_detail d
|
select sum(service_count) from bl_massage_package_detail d
|
||||||
inner join massage_type t on t.massage_type_id = d.massage_type_id and t.status = 1
|
inner join massage_type t on t.massage_type_id = d.massage_type_id and t.status = 1
|
||||||
|
@ -84,6 +84,12 @@
|
||||||
<if test="params.title!=null and params.title!=''">
|
<if test="params.title!=null and params.title!=''">
|
||||||
and a.title like concat('%',#{params.title},'%')
|
and a.title like concat('%',#{params.title},'%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.classifyId!=null">
|
||||||
|
and a.classifyId = #{classifyId}
|
||||||
|
</if>
|
||||||
|
<if test="params.type!=null">
|
||||||
|
and a.type = #{params.title}
|
||||||
|
</if>
|
||||||
union all
|
union all
|
||||||
select massage_type_id as id,title,classify_id as type,b.value as type_name,old_price,price,massage_img,jianjie,content_img,add_num,sales,labels,'项目' as flag,1 as is_can_coupon,1 as is_can_vip,
|
select massage_type_id as id,title,classify_id as type,b.value as type_name,old_price,price,massage_img,jianjie,content_img,add_num,sales,labels,'项目' as flag,1 as is_can_coupon,1 as is_can_vip,
|
||||||
1 as service_count
|
1 as service_count
|
||||||
|
@ -96,6 +102,15 @@
|
||||||
<if test="params.title!=null and params.title!=''">
|
<if test="params.title!=null and params.title!=''">
|
||||||
and a.title like concat('%',#{params.title},'%')
|
and a.title like concat('%',#{params.title},'%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.classifyId!=null">
|
||||||
|
and a.classifyId = #{classifyId}
|
||||||
|
</if>
|
||||||
|
<if test="params.type!=null and type ==1">
|
||||||
|
and 1=1
|
||||||
|
</if>
|
||||||
|
<if test="params.type!=null and type !=1">
|
||||||
|
and 1=2
|
||||||
|
</if>
|
||||||
order by sales desc,id asc
|
order by sales desc,id asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue