车辆司机
parent
6e39af0276
commit
4f0bd0c151
|
|
@ -79,7 +79,7 @@ public class BizTruckController {
|
|||
* @return BizTruckEntity 结果
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public R<BizTruckEntity> detail(@RequestParam Long id) {
|
||||
public R<SearchTruckResult> detail(@RequestParam Long id) {
|
||||
return R.success(bizTruckService.detail(id));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,15 +15,19 @@ import org.apache.ibatis.annotations.Select;
|
|||
*/
|
||||
@Mapper
|
||||
public interface BizDriverMapper extends BaseMapper<BizDriverEntity> {
|
||||
@Select("SELECT id,uscc FROM biz_company WHERE user_id = #{userId}")
|
||||
@Select("SELECT id,uscc,company_name FROM biz_company WHERE user_id = #{userId}")
|
||||
SearchCompanyResult selectCompanyByUserId(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 分页查询司机信息,包含清运公司名称
|
||||
* @param page 分页参数
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
IPage<BizDriverEntity> selectPageWithCompanyName(Page<BizDriverEntity> page, @Param("ew") Wrapper<BizDriverEntity> queryWrapper);
|
||||
|
||||
@Select("SELECT id,uscc,company_name FROM biz_company WHERE id = #{companyId}")
|
||||
SearchCompanyResult selectCompanyById(@Param("companyId") Long companyId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,4 +21,9 @@ public interface BizTruckMapper extends BaseMapper<BizTruckEntity> {
|
|||
SearchCompanyResult selectCompanyByUserId(@Param("userId") Long userId);
|
||||
|
||||
IPage<SearchTruckResult> paging(Page<Object> page, @Param("ew") QueryWrapper<SearchTruckResult> ew);
|
||||
|
||||
/**
|
||||
* 根据ID查询预警详情(包含关联信息)
|
||||
*/
|
||||
SearchTruckResult selectDetailById(@Param("id") Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ public class SearchTruckResult {
|
|||
* 清运公司/消纳场名称; biz_company.name
|
||||
*/
|
||||
private String companyName;
|
||||
private String uscc;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -83,7 +83,14 @@ public class BizDriverService extends ServiceImpl<BizDriverMapper, BizDriverEnti
|
|||
* @return BizDriverEntity 结果
|
||||
*/
|
||||
public BizDriverEntity detail(Long id) {
|
||||
return this.getById(id);
|
||||
BizDriverEntity entity = this.getById(id);
|
||||
if (null != entity && null != entity.getUserId()) {
|
||||
SearchCompanyResult result = baseMapper.selectCompanyById(entity.getCompanyId());
|
||||
if (null != result) {
|
||||
entity.setCompanyName(result.getCompanyName());
|
||||
}
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -96,9 +103,15 @@ public class BizDriverService extends ServiceImpl<BizDriverMapper, BizDriverEnti
|
|||
public PageResult<BizDriverEntity> paging(PageParam pageParam, BizDriverEntity bizDriverEntity) {
|
||||
String driverName = bizDriverEntity.getDriverName();
|
||||
String phone = bizDriverEntity.getPhone();
|
||||
AuditStatus auditStatus = bizDriverEntity.getAuditStatus();
|
||||
String aStatus = "";
|
||||
if (null != auditStatus) {
|
||||
aStatus = auditStatus.getVal();
|
||||
}
|
||||
QueryWrapper<BizDriverEntity> ew = Wrappers.<BizDriverEntity>query()
|
||||
.like(StrUtil.isNotBlank(driverName), "d.driver_name", driverName)
|
||||
.like(StrUtil.isNotBlank(phone), "d.phone", phone);
|
||||
.like(StrUtil.isNotBlank(phone), "d.phone", phone)
|
||||
.eq(StrUtil.isNotBlank(aStatus), "d.audit_status", aStatus);
|
||||
|
||||
UserDetail userDetail = SecurityUtil.loginUser();
|
||||
BizObj parse = Dict.parse(userDetail.getBizObj(), BizObj.values());
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity>
|
|||
* @param id Id
|
||||
* @return BizTruckEntity 结果
|
||||
*/
|
||||
public BizTruckEntity detail(Long id) {
|
||||
return this.getById(id);
|
||||
public SearchTruckResult detail(Long id) {
|
||||
return baseMapper.selectDetailById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
d.create_time,
|
||||
d.modify_time,
|
||||
d.deleted,
|
||||
d.driving_licence_no,
|
||||
c.company_name
|
||||
FROM biz_driver d
|
||||
LEFT JOIN biz_company c ON d.company_id = c.id AND c.deleted = 0
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
a.id,
|
||||
a.company_id,
|
||||
b.company_name,
|
||||
b.uscc,
|
||||
a.license_plate,
|
||||
a.truck_license,
|
||||
a.vn_code,
|
||||
|
|
@ -33,5 +34,34 @@
|
|||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
${ew.customSqlSegment}
|
||||
</if>
|
||||
ORDER BY a.modify_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectDetailById" resultMap="SearchTruckResultMap">
|
||||
SELECT
|
||||
a.id,
|
||||
a.company_id,
|
||||
b.company_name,
|
||||
b.uscc,
|
||||
a.license_plate,
|
||||
a.truck_license,
|
||||
a.vn_code,
|
||||
a.qualification,
|
||||
a.carrying_capacity,
|
||||
a.tare_weight,
|
||||
a.audit_status,
|
||||
a.audit_memo,
|
||||
a.creator_id,
|
||||
a.modifier_id,
|
||||
a.create_time,
|
||||
a.modify_time,
|
||||
a.truck_license_date,
|
||||
a.qualification_date,
|
||||
a.deleted,
|
||||
a.gps,
|
||||
a.picture
|
||||
FROM biz_truck a
|
||||
INNER JOIN biz_company b ON b.id = a.company_id AND b.deleted = 0
|
||||
WHERE a.id = #{id} AND a.deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue