| | |
| | | import com.ycl.annotation.LogSave; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.controller.BaseController; |
| | | import com.ycl.dto.carManage.CarEnforcecarVo; |
| | | import com.ycl.entity.carManage.CarEnforcecar; |
| | | import com.ycl.entity.carManage.CarSlagcar; |
| | | import com.ycl.enums.common.ResultCode; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @ApiOperation(value = "查询执法车") |
| | | @GetMapping("/query_enforce") |
| | | public CommonResult searchEnforceCar(@RequestParam(required = false) String carNum, |
| | | @RequestParam Integer size, |
| | | @RequestParam Integer current) { |
| | | Page<CarEnforcecar> carEnforcecarPage = new Page<>(); |
| | | carEnforcecarPage.setSize(size); |
| | | carEnforcecarPage.setCurrent(current); |
| | | return CommonResult.success(iCarEnforcecarService |
| | | .page(carEnforcecarPage, new LambdaQueryWrapper<CarEnforcecar>() |
| | | .like(StringUtils.isNotBlank(carNum), CarEnforcecar::getCarNumber, carNum))); |
| | | public CommonResult<Page<CarEnforcecarVo>> searchEnforceCar(@RequestParam(required = false) String carNum, |
| | | @RequestParam Integer size, |
| | | @RequestParam Integer current) { |
| | | Page<CarEnforcecarVo> page = iCarEnforcecarService.searchEnforceCar(size, current, carNum); |
| | | return CommonResult.success(page); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询渣土车") |
| | |
| | | private String trajectory; |
| | | |
| | | /** |
| | | * 所属部门大队id |
| | | */ |
| | | @TableField("depart_id") |
| | | private String departId; |
| | | /** |
| | | * 所属大队 |
| | | */ |
| | | @TableField("belong") |
| | | @Deprecated |
| | | private String belong; |
| | | |
| | | /** |
| | | * 所属部门 |
| | | */ |
| | | @TableField("depart") |
| | | @Deprecated |
| | | private String depart; |
| | | } |
| | |
| | | package com.ycl.mapper.carManage; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ycl.dto.carManage.CarEnforcecarVo; |
| | | import com.ycl.entity.carManage.CarEnforcecar; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface CarEnforcecarMapper extends BaseMapper<CarEnforcecar> { |
| | | |
| | | List<CarEnforcecarVo> searchEnforceCar(@Param("carNum") String carNum, @Param("offset") long offset, @Param("size") long size); |
| | | } |
| | |
| | | package com.ycl.service.carManage; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ycl.dto.carManage.CarEnforcecarVo; |
| | | import com.ycl.entity.carManage.CarEnforcecar; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface ICarEnforcecarService extends IService<CarEnforcecar> { |
| | | |
| | | Page<CarEnforcecarVo> searchEnforceCar(Integer size, Integer current, String carNum); |
| | | } |
| | |
| | | package com.ycl.service.carManage.impl; |
| | | |
| | | import com.alibaba.excel.util.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.dto.carManage.CarEnforcecarVo; |
| | | import com.ycl.entity.carManage.CarEnforcecar; |
| | | import com.ycl.mapper.carManage.CarEnforcecarMapper; |
| | | import com.ycl.service.carManage.ICarEnforcecarService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class CarEnforcecarServiceImpl extends ServiceImpl<CarEnforcecarMapper, CarEnforcecar> implements ICarEnforcecarService { |
| | | |
| | | @Override |
| | | public Page<CarEnforcecarVo> searchEnforceCar(Integer size, Integer current, String carNum) { |
| | | Page<CarEnforcecarVo> page = new Page<>(); |
| | | page.setSize(size); |
| | | page.setCurrent(current); |
| | | |
| | | List<CarEnforcecarVo> ls = baseMapper.searchEnforceCar(carNum, page.offset(), page.getSize()); |
| | | page.setRecords(ls); |
| | | LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<CarEnforcecar>() |
| | | .like(StringUtils.isNotBlank(carNum), CarEnforcecar::getCarNumber, carNum); |
| | | page.setTotal(this.count(queryWrapper)); |
| | | |
| | | return page; |
| | | } |
| | | } |
| | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ycl.entity.carManage.CarEnforcecar"> |
| | | <id column="id" property="id" /> |
| | | <result column="car_number" property="carNumber" /> |
| | | <result column="owner_name" property="ownerName" /> |
| | | <result column="vehicle_user" property="vehicleUser" /> |
| | | <result column="contact" property="contact" /> |
| | | <result column="trajectory" property="trajectory" /> |
| | | <result column="group" property="group" /> |
| | | <id column="id" property="id"/> |
| | | <result column="car_number" property="carNumber"/> |
| | | <result column="owner_name" property="ownerName"/> |
| | | <result column="vehicle_user" property="vehicleUser"/> |
| | | <result column="contact" property="contact"/> |
| | | <result column="trajectory" property="trajectory"/> |
| | | <result column="depart_id" property="departId"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="VoMap" type="com.ycl.dto.carManage.CarEnforcecarVo"> |
| | | <result column="depart_name" property="departName" jdbcType="VARCHAR"/> |
| | | <result column="p_depart_name" property="pDepartName" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, car_number, owner_name, vehicle_user, contact, trajectory, group |
| | | id |
| | | , car_number, owner_name, vehicle_user, contact, trajectory, group |
| | | </sql> |
| | | <select id="searchEnforceCar" resultType="com.ycl.dto.carManage.CarEnforcecarVo"> |
| | | SELECT ce.*,IF(p.depart_name is null ,'',d.depart_name) depart_name,IFNULL(p.depart_name,d.depart_name) |
| | | p_depart_name |
| | | FROM ums_car_enforcecar ce |
| | | LEFT JOIN ums_depart d on ce.depart_id = d.id |
| | | LEFT JOIN ums_depart p on d.parent_id = p.id |
| | | <where> |
| | | <if test="carNum!=null"> |
| | | ce.car_number like CONCAT('%',#{carNum},'%') |
| | | </if> |
| | | </where> |
| | | order by ce.id desc |
| | | LIMIT #{offset}, #{size} |
| | | </select> |
| | | |
| | | </mapper> |