This commit is contained in:
齐天大圣 2024-03-06 17:30:32 +08:00
parent 7293a918a5
commit b50287eaba
2 changed files with 3 additions and 1 deletions

View File

@ -117,6 +117,8 @@ public class CardFuelDieselController extends BaseController {
@PutMapping @PutMapping
public ResponseObject update(@RequestBody CardFuelDiesel cardFuelDiesel) { public ResponseObject update(@RequestBody CardFuelDiesel cardFuelDiesel) {
cardFuelDiesel.setStatus(cardFuelDiesel.getStatus().equals("true") ? "1" : "2"); cardFuelDiesel.setStatus(cardFuelDiesel.getStatus().equals("true") ? "1" : "2");
String substring = cardFuelDiesel.getType().substring(0, 3);
cardFuelDiesel.setType(substring);
return getSuccessResult(this.cardFuelDieselService.updateById(cardFuelDiesel)); return getSuccessResult(this.cardFuelDieselService.updateById(cardFuelDiesel));
} }

View File

@ -55,7 +55,7 @@ public class CardFuelDieselServiceImpl extends ServiceImpl<CardFuelDieselMapper,
//构建查询条件 //构建查询条件
LambdaQueryWrapper<CardFuelDiesel> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CardFuelDiesel> queryWrapper = new LambdaQueryWrapper<>();
if(ObjectUtils.isNotEmpty(cardFuelDiesel.getOilType())){ if(ObjectUtils.isNotEmpty(cardFuelDiesel.getOilType())){
queryWrapper.eq(CardFuelDiesel::getOilType,cardFuelDiesel.getOilType()); queryWrapper.like(CardFuelDiesel::getOilType,cardFuelDiesel.getOilType());
} }
if (ObjectUtils.isNotEmpty(cardFuelDiesel.getActiveStatus())){ if (ObjectUtils.isNotEmpty(cardFuelDiesel.getActiveStatus())){
queryWrapper.eq(CardFuelDiesel::getActiveStatus,cardFuelDiesel.getActiveStatus()); queryWrapper.eq(CardFuelDiesel::getActiveStatus,cardFuelDiesel.getActiveStatus());