feat():添加查询车辆类型方法
parent
cf7c7efddd
commit
e48a7cf352
|
@ -2,12 +2,15 @@ package com.muyu.controller;
|
|||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.CarType;
|
||||
import com.muyu.domain.resp.CarTypeResp;
|
||||
import com.muyu.service.CarTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/carType")
|
||||
|
@ -22,5 +25,10 @@ public class CarTypeController {
|
|||
}
|
||||
|
||||
|
||||
@GetMapping("/selectCarTypeRespList")
|
||||
public Result selectCarTypeRespList() {
|
||||
return Result.success(carTypeService.selectCarTypeRespList());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package com.muyu.domain.resp;
|
||||
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.domain.CarType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CarTypeResp extends CarType {
|
||||
/** 报文模版id */
|
||||
@Excel(name = "报文模版名称")
|
||||
private String templateName;
|
||||
}
|
|
@ -2,8 +2,12 @@ package com.muyu.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.CarType;
|
||||
import com.muyu.domain.resp.CarTypeResp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface CarTypeMapper extends BaseMapper<CarType> {
|
||||
List<CarTypeResp> selectCarTypeRespList();
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.domain.CarType;
|
||||
import com.muyu.domain.resp.CarTypeResp;
|
||||
import com.muyu.mapper.CarTypeMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -10,4 +11,6 @@ import java.util.List;
|
|||
public interface CarTypeService extends IService<CarType> {
|
||||
List<CarType> selectCarTypeList();
|
||||
|
||||
List<CarTypeResp> selectCarTypeRespList();
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.service.impl;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.domain.CarType;
|
||||
import com.muyu.domain.resp.CarTypeResp;
|
||||
import com.muyu.mapper.CarTypeMapper;
|
||||
import com.muyu.service.CarTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -19,4 +20,9 @@ private CarTypeMapper carTypeMapper;
|
|||
QueryWrapper<CarType> carTypeQueryWrapper = new QueryWrapper<>();
|
||||
return carTypeMapper.selectList(carTypeQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CarTypeResp> selectCarTypeRespList() {
|
||||
return carTypeMapper.selectCarTypeRespList();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<?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">
|
||||
<mapper namespace="com.muyu.mapper.CarTypeMapper">
|
||||
|
||||
<select id="selectCarTypeRespList" resultType="com.muyu.domain.resp.CarTypeResp">
|
||||
SELECT
|
||||
*,
|
||||
t_template.template_name
|
||||
FROM
|
||||
car_type
|
||||
LEFT JOIN t_template ON car_type.template_id = t_template.template_id
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue