Commit e762121f authored by hezhen's avatar hezhen

Merge branch 'dev' of http://113.105.137.151:22280/youjj/cloud-platform into dev

parents 9539de93 d33fab28
package com.github.wxiaoqi.security.admin.vo; package com.github.wxiaoqi.security.admin.vo;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -57,8 +58,27 @@ public class SellingWalletVo { ...@@ -57,8 +58,27 @@ public class SellingWalletVo {
@ApiModelProperty("'类别:0-正;1-负(退款时)") @ApiModelProperty("'类别:0-正;1-负(退款时)")
private Integer status; private Integer status;
@JSONField(serialize = false)
private Integer sourceId;
@JSONField(serialize = false)
private BigDecimal commissionnm;
/** /**
* 所获佣金 * 所获佣金
*/ */
private BigDecimal commission; private BigDecimal commission;
/**
* 订单状态
*/
private Integer sellerStatus;
/**
* 订单文案
*/
private String statusText;
/**
* 是否显示 默认false
*/
private Boolean isShow;
} }
...@@ -5,7 +5,6 @@ import com.github.wxiaoqi.security.admin.bo.UserIncomeBo; ...@@ -5,7 +5,6 @@ import com.github.wxiaoqi.security.admin.bo.UserIncomeBo;
import com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo; import com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo;
import com.github.wxiaoqi.security.admin.entity.AppUserDetail; import com.github.wxiaoqi.security.admin.entity.AppUserDetail;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin; import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.entity.AppUserRelation;
import com.github.wxiaoqi.security.admin.vo.UserTeamMemberVo; import com.github.wxiaoqi.security.admin.vo.UserTeamMemberVo;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
......
...@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.admin.mapper; ...@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.bo.UserIncomeBo; import com.github.wxiaoqi.security.admin.bo.UserIncomeBo;
import com.github.wxiaoqi.security.admin.entity.AppUserSellingWater; import com.github.wxiaoqi.security.admin.entity.AppUserSellingWater;
import com.github.wxiaoqi.security.admin.vo.SellingWalletVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.Mapper;
...@@ -20,4 +21,6 @@ public interface AppUserSellingWaterMapper extends Mapper<AppUserSellingWater> { ...@@ -20,4 +21,6 @@ public interface AppUserSellingWaterMapper extends Mapper<AppUserSellingWater> {
List<UserIncomeBo> accquireIncomeByMemberIds(@Param("parentId") Integer parentId); List<UserIncomeBo> accquireIncomeByMemberIds(@Param("parentId") Integer parentId);
BigDecimal selectTotalIncomeByUserId(@Param("userId") Integer userId); BigDecimal selectTotalIncomeByUserId(@Param("userId") Integer userId);
List<SellingWalletVo> selectSellerWalterByUserIdAndWating(@Param("userId") Integer userId, @Param("wating") Integer wating);
} }
...@@ -2,14 +2,12 @@ package com.github.wxiaoqi.security.admin.rest; ...@@ -2,14 +2,12 @@ package com.github.wxiaoqi.security.admin.rest;
import com.github.wxiaoqi.security.admin.biz.UserBusinessBiz; import com.github.wxiaoqi.security.admin.biz.UserBusinessBiz;
import com.github.wxiaoqi.security.admin.bo.PromoteBO; import com.github.wxiaoqi.security.admin.bo.PromoteBO;
import com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo;
import com.github.wxiaoqi.security.admin.vo.UserTeamMemberVo; import com.github.wxiaoqi.security.admin.vo.UserTeamMemberVo;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig; import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil; import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil;
import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo; import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
......
...@@ -48,4 +48,17 @@ public class UserSellingWaterController { ...@@ -48,4 +48,17 @@ public class UserSellingWaterController {
} }
} }
@GetMapping("/pagea")
public ObjectRestResponse<SellingWalletPagVo> findSellingWaterPagea(@RequestParam(required = false,value = "type") Integer wating,
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize,
HttpServletRequest request) {
try {
IJWTInfo infoFromToken = userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request));
SellingWalletPagVo sellingWalletPagVo = appUserSellingWaterBiz.findSellingWaterPageForAppByWaiting(wating, Integer.valueOf(infoFromToken.getId()), pageNo, pageSize);
return ObjectRestResponse.succ(sellingWalletPagVo);
} catch (Exception e) {
throw new BaseException(e);
}
}
} }
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
SELECT SELECT
aur.user_id, aur.user_id,
aur.bind_time as `leagueTime`, aur.bind_time as `leagueTime`,
ausww.income IFNULL(ausww.income,0) AS `income`
FROM FROM
`app_user_relation` AS `aur` `app_user_relation` AS `aur`
LEFT JOIN (SELECT DISTINCT LEFT JOIN (SELECT DISTINCT
`source_id` AS userId, `source_id` AS userId,
IFNULL( IFNULL(
( (
( SELECT SUM( commission ) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 0 AND `waiting` = 1 ) - ( SELECT SUM( commission ) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 1 AND `waiting` = 1 ) ( SELECT IFNULL(SUM( commission ),0) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 0 ) - ( SELECT IFNULL(SUM( commission ),0) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 1 )
), ),
0 0
) AS `income` ) AS `income`
...@@ -31,4 +31,47 @@ FROM ...@@ -31,4 +31,47 @@ FROM
( SELECT IFNULL(SUM( commission ),0) AS upIncome FROM `app_user_selling_water` WHERE STATUS = 0 AND `user_id` = #{userId} ) AS `auswu`, ( SELECT IFNULL(SUM( commission ),0) AS upIncome FROM `app_user_selling_water` WHERE STATUS = 0 AND `user_id` = #{userId} ) AS `auswu`,
( SELECT IFNULL(SUM( commission ),0) AS `dowIncome` FROM `app_user_selling_water` WHERE STATUS = 1 AND `user_id` = #{userId} ) AS `auswd`; ( SELECT IFNULL(SUM( commission ),0) AS `dowIncome` FROM `app_user_selling_water` WHERE STATUS = 1 AND `user_id` = #{userId} ) AS `auswd`;
</select> </select>
<select id="selectSellerWalterByUserIdAndWating" resultType="com.github.wxiaoqi.security.admin.vo.SellingWalletVo">
<!-- SELECT
*
FROM
(
SELECT
ausw.*,
IFNULL( ausw.commission, 0 ) - IFNULL( auswt.commission, 0 ) AS `commissionnm`,
auswt.status AS sellerStatus,
IFNULL(auswt.status,0) AS `isShow`
FROM
( SELECT * FROM `app_user_selling_water` WHERE STATUS = 0 AND `user_id`=#{userId} <if test="wating!=null">
AND `waiting`=#{wating} &lt;!&ndash;AND `status`=0&ndash;&gt;
</if>) AS `ausw`
LEFT JOIN ( SELECT * FROM `app_user_selling_water` WHERE STATUS = 1 AND `user_id`=#{userId} <if
test="wating!=null">
AND `waiting`=#{wating} &lt;!&ndash;AND `status`=0&ndash;&gt;
</if>) AS `auswt` ON auswt.order_no = ausw.order_no
) AS `auswres`
ORDER BY crt_time DESC-->
SELECT w.*,o.commission as commission ,o.type AS `sellerStatus` FROM (
SELECT t.order_no,SUM(t.z)-SUM(t.f) as commission,IF(SUM(t.f)>0,'1',0)as type FROM (
SELECT order_no,commission as z,0 as f FROM app_user_selling_water WHERE user_id=#{userId}
AND `status`=0 and commission>0
UNION
SELECT order_no,0 as z,commission as f FROM app_user_selling_water WHERE user_id=#{userId}
AND `status`=1 and commission>0
) as t
GROUP BY t.order_no
) o LEFT JOIN ( SELECT DISTINCT order_no,user_id,source_id,order_type,img,price,title,waiting,`crt_time` FROM
app_user_selling_water ) w
ON o.order_no=w.order_no
where 1=1
<if test="wating!=null">
and `waiting`= #{wating} and <![CDATA[
o.`type`<>1 ]]>
</if>
ORDER BY `crt_time`
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -54,6 +54,11 @@ public class RentVehiclePriceVO extends OrderPriceVO{ ...@@ -54,6 +54,11 @@ public class RentVehiclePriceVO extends OrderPriceVO{
*/ */
private BigDecimal buyVehicleAmount = BigDecimal.ZERO; private BigDecimal buyVehicleAmount = BigDecimal.ZERO;
/**
* 最后的租车金额
*/
private BigDecimal realVehicleAmount = BigDecimal.ZERO;
/** /**
* 优惠描述 * 优惠描述
*/ */
......
...@@ -344,7 +344,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -344,7 +344,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
}}); }});
if(null == crosstown) { if(null == crosstown) {
throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE, Sets.newSet("退款第一部分押金失败,获取不了还车/定损记录,订单号:"+ orderMQDTO.getId())); throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE, Sets.newSet(StrUtil.format("退款第一部分押金失败,获取不了还车/定损记录,订单号:{}, crosstownTypeEnum: {}", orderMQDTO.getId(), crosstownTypeEnum)));
} }
if(null == crosstown.getRestDeposit() if(null == crosstown.getRestDeposit()
...@@ -365,12 +365,12 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -365,12 +365,12 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
handleDedRefundDesc = handleDed(crosstown, handleDedRefundDesc, csv); handleDedRefundDesc = handleDed(crosstown, handleDedRefundDesc, csv);
if(csv.getDamagesAmount().compareTo(BigDecimal.ZERO) > 0) { if(csv.getDamagesAmount().compareTo(BigDecimal.ZERO) > 0) {
oad.getDeductions().add( oad.getDeductions().add(
initDeduction(crosstown.getDeductionCost(), handleDedRefundDesc, DeductionTypeEnum.DAMAGES, OrderAccountDeduction.ORIGIN_DEPOSIT) initDeduction(csv.getDamagesAmount(), handleDedRefundDesc, DeductionTypeEnum.DAMAGES, OrderAccountDeduction.ORIGIN_DEPOSIT)
); );
} }
//剩余押金 = 押金 - 违章保证金 - 定损金额 //剩余押金 = 押金 - 违章保证金 - 定损金额
oad.setDepositAmount(oad.getDepositAmount().subtract(illegalReserve).subtract(crosstown.getDeductionCost())); oad.setDepositAmount(oad.getDepositAmount().subtract(illegalReserve).subtract(csv.getDamagesAmount()));
handleCrosstownDetail(crosstown, oad); handleCrosstownDetail(crosstown, oad);
//退款 //退款
...@@ -409,11 +409,16 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -409,11 +409,16 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
csv.initParamJson(); csv.initParamJson();
//设置明细 //设置明细
orderRentVehicleBiz.updateSelectiveById(new OrderRentVehicleDetail(){{ orderRentVehicleBiz.updateSelectiveById(new OrderRentVehicleDetail(){{
setId(orderMQDTO.getId()); setId(orderMQDTO.getDetailId());
handelCostDetailExtend(csv); handelCostDetailExtend(csv);
}}); }});
orderMsgBiz.handelMsgDeposit(orderMQDTO.getOrderRentVehicleDetail(), orderMQDTO, userFeign.userDetailById(orderMQDTO.getUserId()).getData()); //捕捉异常
try {
orderMsgBiz.handelMsgDeposit(orderMQDTO.getOrderRentVehicleDetail(), orderMQDTO, userFeign.userDetailById(orderMQDTO.getUserId()).getData());
}catch (Exception e) {
log.error(e.getMessage(), e);
}
} }
} }
......
package com.xxfc.platform.order.biz.inner; package com.xxfc.platform.order.biz.inner;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
...@@ -385,7 +386,7 @@ public class OrderMsgBiz { ...@@ -385,7 +386,7 @@ public class OrderMsgBiz {
BigDecimal residueAmount; BigDecimal residueAmount;
//查询订单退款记录 //查询订单退款记录
OrderAccount orderAccount; OrderAccount orderAccount;
if(RefundStatusEnum.RESIDUE_ILLEGAL.equals(baseOrder.getRefundStatus())) { if(RefundStatusEnum.RESIDUE_ILLEGAL.getCode().equals(baseOrder.getRefundStatus())) {
smstype = SmsTemplateDTO.REFUND_A; smstype = SmsTemplateDTO.REFUND_A;
orderAccount = orderAccountBiz.selectOne(new OrderAccount(){{ orderAccount = orderAccountBiz.selectOne(new OrderAccount(){{
setOrderId(baseOrder.getId()); setOrderId(baseOrder.getId());
...@@ -395,7 +396,7 @@ public class OrderMsgBiz { ...@@ -395,7 +396,7 @@ public class OrderMsgBiz {
violateAmount = orderAccount.getDeductAmount(); violateAmount = orderAccount.getDeductAmount();
refundAmount = orderAccount.getAccountAmount(); refundAmount = orderAccount.getAccountAmount();
residueAmount = orvd.getReturnPayResidue(); residueAmount = orvd.getReturnPayResidue();
}else if(RefundStatusEnum.REFUND_DEPOSIT.equals(baseOrder.getRefundStatus())){ }else if(RefundStatusEnum.REFUND_DEPOSIT.getCode().equals(baseOrder.getRefundStatus())){
smstype = SmsTemplateDTO.REFUND_B; smstype = SmsTemplateDTO.REFUND_B;
orderAccount = orderAccountBiz.selectOne(new OrderAccount(){{ orderAccount = orderAccountBiz.selectOne(new OrderAccount(){{
setOrderId(baseOrder.getId()); setOrderId(baseOrder.getId());
...@@ -407,7 +408,7 @@ public class OrderMsgBiz { ...@@ -407,7 +408,7 @@ public class OrderMsgBiz {
residueAmount = BigDecimal.ZERO; residueAmount = BigDecimal.ZERO;
}else { }else {
throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE, new HashSet<String>() {{ throw new BaseException(ResultCode.PARAM_ILLEGAL_CODE, new HashSet<String>() {{
add("当前退款状态不对,订单号:"+ baseOrder.getNo()); add(StrUtil.format("当前退款状态不对,订单号:{} baseOrder.getRefundStatus(): {}", baseOrder.getNo(), baseOrder.getRefundStatus()));
}}); }});
} }
......
...@@ -356,6 +356,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl ...@@ -356,6 +356,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
rvp.setFreeDayNum(freeDayNum); rvp.setFreeDayNum(freeDayNum);
rvp.setFreeAmount(vehicleOrderItem.getCutAmount()); rvp.setFreeAmount(vehicleOrderItem.getCutAmount());
rvp.setBuyVehicleAmount(vehicleOrderItem.getBuyAmount()); rvp.setBuyVehicleAmount(vehicleOrderItem.getBuyAmount());
rvp.setRealVehicleAmount(vehicleOrderItem.getRealAmount());
rvp.setCouponDesc(couponDesc); rvp.setCouponDesc(couponDesc);
rvp.initParamJson(); rvp.initParamJson();
......
...@@ -27,11 +27,14 @@ public class VehicleModelQueryCondition { ...@@ -27,11 +27,14 @@ public class VehicleModelQueryCondition {
@ApiModelProperty(value = "是否删除") @ApiModelProperty(value = "是否删除")
private Integer isDel; private Integer isDel;
@ApiModelProperty(value = "状态") @ApiModelProperty(value = "状态")
private Integer status; private Integer status=1;
@ApiModelProperty("分类逗号分割") @ApiModelProperty("分类逗号分割")
String catasStr; String catasStr;
@ApiModelProperty("排除的车型id") @ApiModelProperty("排除的车型id")
String notInIds; String notInIds;
@ApiModelProperty(value = "分类列表", hidden = true) @ApiModelProperty(value = "分类列表", hidden = true)
Map<Integer, List<VehiclePlatCata>> catas; Map<Integer, List<VehiclePlatCata>> catas;
@ApiModelProperty(value = "分类列表(1-后台,2-app和小程序)", hidden = true)
private Integer pathType=2;
} }
...@@ -49,7 +49,9 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> { ...@@ -49,7 +49,9 @@ public class VehicleModelBiz extends BaseBiz<VehicleModelMapper, VehicleModel> {
* @return * @return
*/ */
public ObjectRestResponse findVehicleModelPage(VehicleModelQueryCondition vmqc) { public ObjectRestResponse findVehicleModelPage(VehicleModelQueryCondition vmqc) {
if (vmqc.getPathType()==1) {
vmqc.setStatus(null);
}
try { try {
PageDataVO<VehicleModelVo> mPageDataVO = PageDataVO.pageInfo(vmqc.getPage(), PageDataVO<VehicleModelVo> mPageDataVO = PageDataVO.pageInfo(vmqc.getPage(),
vmqc.getLimit(), () -> mapper.findVehicleModelPage(vmqc)); vmqc.getLimit(), () -> mapper.findVehicleModelPage(vmqc));
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.xxfc.platform.vehicle.mapper.VehicleModelMapper"> <mapper namespace="com.xxfc.platform.vehicle.mapper.VehicleModelMapper">
<select id="findVehicleModelPage" parameterType="com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition" <select id="findVehicleModelPage" parameterType="com.xxfc.platform.vehicle.pojo.VehicleModelQueryCondition"
resultType="com.xxfc.platform.vehicle.pojo.VehicleModelVo"> resultType="com.xxfc.platform.vehicle.pojo.VehicleModelVo">
SELECT * from SELECT * from
(select vm.*,v.sum,v2.leasableQuantity,vpc.`name` brandName,vpc2.name numberName from vehicle_model vm left JOIN (select vm.*,v.sum,v2.leasableQuantity,vpc.`name` brandName,vpc2.name numberName from vehicle_model vm left JOIN
(select model_id as mid, count(1) as sum FROM vehicle GROUP BY mid) v (select model_id as mid, count(1) as sum FROM vehicle GROUP BY mid) v
on vm.id=v.mid left JOIN on vm.id=v.mid left JOIN
(select model_id as mid2, count(1) as leasableQuantity FROM vehicle where`use_type`=1 GROUP BY model_id) v2 (select model_id as mid2, count(1) as leasableQuantity FROM vehicle where`use_type`=1 GROUP BY model_id) v2
on v.mid=v2.mid2 on v.mid=v2.mid2
left join (SELECT id,name FROM vehicle_plat_cata where state=0) vpc on vm.brand=vpc.id left join (SELECT id,name FROM vehicle_plat_cata where state=0) vpc on vm.brand=vpc.id
left join (SELECT id,name FROM vehicle_plat_cata where state=0) vpc2 on vm.number=vpc2.id left join (SELECT id,name FROM vehicle_plat_cata where state=0) vpc2 on vm.number=vpc2.id
where isdel = 0 where isdel = 0
) vmqc WHERE 1=1 ) vmqc WHERE 1=1
<if test="isDel !=null "> <if test="isDel !=null ">
and isdel=#{isDel} and isdel=#{isDel}
</if> </if>
<if test="status != null">
and status = #{status}
</if> <if test="status != null">
<if test="vehicleName !=null and vehicleName !=''"> and status = #{status}
AND vmqc.name LIKE CONCAT('%',#{vehicleName},'%') </if>
</if>
<if test="vehicleType!=null and vehicleType!=''"> <if test="vehicleName !=null and vehicleName !=''">
AND EXISTS (SELECT vc.vehicle_model_id FROM vehicle_cata vc WHERE vc.cata_id=#{vehicleType} AND vmqc.id=vc.vehicle_model_id ) AND vmqc.name LIKE CONCAT('%',#{vehicleName},'%')
</if> </if>
<if test="takeALieTheNumber!=null and takeALieTheNumber!=''"> <if test="vehicleType!=null and vehicleType!=''">
AND EXISTS(SELECT vc2.vehicle_model_id FROM vehicle_cata vc2 WHERE vc2.cata_id=#{takeALieTheNumber} AND vmqc.id=vc2.vehicle_model_id) AND EXISTS (SELECT vc.vehicle_model_id FROM vehicle_cata vc WHERE vc.cata_id=#{vehicleType} AND
</if> vmqc.id=vc.vehicle_model_id )
</if>
<if test="catas != null">
AND ( 1 <if test="takeALieTheNumber!=null and takeALieTheNumber!=''">
<foreach collection="catas" index="key" item="cataList"> AND EXISTS(SELECT vc2.vehicle_model_id FROM vehicle_cata vc2 WHERE vc2.cata_id=#{takeALieTheNumber} AND
&amp; ( vmqc.id=vc2.vehicle_model_id)
<foreach collection="cataList" index="cIndex" item="cata"> </if>
<if test=" cIndex != 0">
| <if test="catas != null">
</if> AND ( 1
(case when FIND_IN_SET(#{cata.id},vmqc.config) > 0 then 1 else 0 end) <foreach collection="catas" index="key" item="cataList">
</foreach> &amp; (
) <foreach collection="cataList" index="cIndex" item="cata">
</foreach> <if test=" cIndex != 0">
) > 0 |
</if> </if>
<if test="notInIds != null"> (case when FIND_IN_SET(#{cata.id},vmqc.config) > 0 then 1 else 0 end)
and vmqc.id not in ( </foreach>
)
</foreach>
) > 0
</if>
<if test="notInIds != null">
and vmqc.id not in (
<foreach collection="notInIds.split(',')" item="noIdItem" index="noIdIndex"> <foreach collection="notInIds.split(',')" item="noIdItem" index="noIdIndex">
#{noIdItem} #{noIdItem}
</foreach> </foreach>
) )
</if> </if>
ORDER BY vmqc.sort ASC ORDER BY vmqc.sort ASC
</select> </select>
<update id="updateScoreByModelIdAndavgScore"> <update id="updateScoreByModelIdAndavgScore">
update `vehicle_model` set `score`=(`score`+#{avgScore})/2 where `id`=#{modelId} update `vehicle_model` set `score`=(`score`+#{avgScore})/2 where `id`=#{modelId}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment