Commit 45f2d50c authored by hekaiwen's avatar hekaiwen

增加车辆信息表分页查询接口

parent 72f2c4dc
......@@ -16,9 +16,8 @@ import java.util.Date;
* @date 2024-11-08
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="ShCarDto", description="三环系统-车辆信息表")
public class ShCarDto extends BaseDto {
public class ShCarDto {
private static final long serialVersionUID = 1L;
......@@ -139,7 +138,7 @@ public class ShCarDto extends BaseDto {
@TableField("PREVIOUS_INSPECTION_REPORT_NUMBER")
private String previousInspectionReportNumber;
@ApiModelProperty(value = "是否认领")
@ApiModelProperty(value = "是否认领 1已认领 0未认领")
@TableField("CLAIMED_FLAG")
private String claimedFlag;
......
......@@ -16,9 +16,8 @@ import java.util.Date;
* @date 2024-11-08
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="ShCarEquDto", description="")
public class ShCarEquDto extends BaseDto {
public class ShCarEquDto {
private static final long serialVersionUID = 1L;
......@@ -95,7 +94,7 @@ public class ShCarEquDto extends BaseDto {
@TableField("EQU_CZFS")
private String equCzfs;
@ApiModelProperty(value = "是否认领")
@ApiModelProperty(value = "是否认领 1已认领 0未认领")
@TableField("CLAIMED_FLAG")
private String claimedFlag;
......
......@@ -202,7 +202,7 @@ public class ShCar {
private String previousInspectionReportNumber;
/**
* 是否认领
* 是否认领 1已认领 0未认领
*/
@TableField(value = "\"CLAIMED_FLAG\"")
private String claimedFlag;
......
......@@ -131,7 +131,7 @@ public class ShCarEqu {
private String equCzfs;
/**
* 是否认领
* 是否认领 1已认领 0未认领
*/
@TableField(value = "\"CLAIMED_FLAG\"")
private String claimedFlag;
......
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto;
import com.yeejoin.amos.boot.module.jg.api.entity.ShCar;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -11,4 +13,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface ShCarMapper extends BaseMapper<ShCar> {
Page<ShCarDto> queryForshCarPage(Page<ShCarDto> page, ShCarDto dto);
}
package com.yeejoin.amos.boot.module.jg.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto;
/**
* 三环系统-车辆信息表接口类
*
* @author system_generator
* @date 2024-11-08
*/
public interface IShCarService {}
public interface IShCarService {
Page<ShCarDto> queryForShCarPage(Page<ShCarDto> page, ShCarDto dto);
}
......@@ -2,4 +2,27 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.ShCarMapper">
<select id="queryForshCarPage" resultType="com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto">
select
*
FROM tzs_sh_car tsc
<where>
<if test="dto != null ">
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
AND tsc.USE_REGISTRATION_CODE LIKE CONCAT('%', #{dto.useRegistrationCode}, '%')
</if>
<if test="dto.carNumber != null and dto.carNumber != ''">
AND tsc.CAR_NUMBER LIKE CONCAT('%', #{dto.carNumber}, '%')
</if>
<if test="dto.frameNumber != null and dto.frameNumber != ''">
AND tsc.FRAME_NUMBER LIKE CONCAT('%', #{dto.frameNumber}, '%')
</if>
<if test="dto.claimedFlag != null and dto.claimedFlag != ''">
AND tsc.CLAIMED_FLAG = #{dto.claimedFlag}
</if>
</if>
</where>
ORDER BY
tsc.USE_REGISTRATION_CODE DESC
</select>
</mapper>
package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto;
import com.yeejoin.amos.boot.module.jg.api.entity.ShCar;
import com.yeejoin.amos.boot.module.jg.api.service.IShCarService;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -32,6 +34,8 @@ public class ShCarController extends BaseController {
@Autowired
ShCarServiceImpl shCarServiceImpl;
@Autowired
IShCarService iShCarService;
/**
* 新增
*
......@@ -54,7 +58,7 @@ public class ShCarController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<ShCar> updateBySequenceNbrShCar(@RequestBody ShCar entity,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
public ResponseModel<ShCar> updateBySequenceNbrShCar(@RequestBody ShCar entity,@PathVariable(value = "sequenceNbr") String sequenceNbr) {
entity.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(shCarServiceImpl.updateWithModel(entity));
}
......@@ -86,21 +90,30 @@ public class ShCarController extends BaseController {
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
* 列表分页查询
*
* @param current 当前页
* @param size 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<ShCar>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
Page<ShCar> page = new Page<ShCar>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(shCarServiceImpl.queryForShCarPage(page));
public ResponseModel<Page<ShCarDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
ShCarDto dto) {
Page<ShCarDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
Page<ShCarDto> shCarDtoPage = iShCarService.queryForShCarPage(page, dto);
shCarDtoPage.getRecords().forEach(record -> {
if ("1".equals(record.getClaimedFlag())) {
record.setClaimedFlag("是");
} else if ("0".equals(record.getClaimedFlag())) {
record.setClaimedFlag("否");
}
});
return ResponseHelper.buildResponse(shCarDtoPage);
}
/**
......
......@@ -53,7 +53,7 @@ public class ShCarEquController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<ShCarEqu> updateBySequenceNbrShCarEqu(@RequestBody ShCarEqu entity,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
public ResponseModel<ShCarEqu> updateBySequenceNbrShCarEqu(@RequestBody ShCarEqu entity,@PathVariable(value = "sequenceNbr") String sequenceNbr) {
entity.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(shCarEquServiceImpl.updateWithModel(entity));
}
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto;
import com.yeejoin.amos.boot.module.jg.api.entity.ShCar;
import com.yeejoin.amos.boot.module.jg.api.mapper.ShCarMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IShCarService;
......@@ -16,6 +17,12 @@ import java.util.List;
*/
@Service
public class ShCarServiceImpl extends BaseService<ShCar,ShCar,ShCarMapper> implements IShCarService {
private final ShCarMapper shCarMapper;
public ShCarServiceImpl(ShCarMapper shCarMapper) {
this.shCarMapper = shCarMapper;
}
/**
* 分页查询
*/
......@@ -29,4 +36,9 @@ public class ShCarServiceImpl extends BaseService<ShCar,ShCar,ShCarMapper> imple
public List<ShCar> queryForShCarList() {
return this.queryForList("" , false);
}
@Override
public Page<ShCarDto> queryForShCarPage(Page<ShCarDto> page, ShCarDto dto) {
return shCarMapper.queryForshCarPage(page, dto);
}
}
\ No newline at end of file
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