master
parent
7ae48b8da0
commit
507c6ca6bf
|
|
@ -2,16 +2,13 @@ package com.cpxt.web.controller.biz;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.cpxt.biz.domain.BizCarModel;
|
||||||
|
import com.cpxt.common.constant.HttpStatus;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.cpxt.common.annotation.Log;
|
import com.cpxt.common.annotation.Log;
|
||||||
import com.cpxt.common.core.controller.BaseController;
|
import com.cpxt.common.core.controller.BaseController;
|
||||||
import com.cpxt.common.core.domain.AjaxResult;
|
import com.cpxt.common.core.domain.AjaxResult;
|
||||||
|
|
@ -35,15 +32,31 @@ public class BizCustomerController extends BaseController
|
||||||
private IBizCustomerService bizCustomerService;
|
private IBizCustomerService bizCustomerService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询客户列表
|
* 查询客户列表(分页)
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('biz:customer:list')")
|
@PreAuthorize("@ss.hasPermi('biz:customer:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(BizCustomer bizCustomer)
|
public TableDataInfo list(BizCustomer bizCustomer,
|
||||||
|
@RequestParam(defaultValue = "1") int pageNum,
|
||||||
|
@RequestParam(defaultValue = "10") int pageSize)
|
||||||
{
|
{
|
||||||
startPage();
|
Page<BizCustomer> recordPage = bizCustomerService.selectBizCustomerPage(bizCustomer,pageNum,pageSize);
|
||||||
List<BizCustomer> list = bizCustomerService.selectBizCustomerList(bizCustomer);
|
TableDataInfo rspData = new TableDataInfo();
|
||||||
return getDataTable(list);
|
rspData.setCode(HttpStatus.SUCCESS);
|
||||||
|
rspData.setMsg("查询成功");
|
||||||
|
rspData.setRows(recordPage.getRecords());
|
||||||
|
rspData.setTotal(recordPage.getTotal());
|
||||||
|
return rspData;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('biz:customer:list')")
|
||||||
|
@GetMapping("/list2")
|
||||||
|
public AjaxResult list(BizCustomer bizCustomer)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(bizCustomerService.selectBizCustomerList(bizCustomer));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import com.cpxt.common.core.domain.BaseEntity;
|
||||||
* @date 2024-12-16
|
* @date 2024-12-16
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class BizCustomerWarehouse extends BaseEntity
|
public class BizCustomerWarehouse
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,11 @@ package com.cpxt.biz.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.cpxt.biz.domain.BizCar;
|
import com.cpxt.biz.domain.BizCar;
|
||||||
|
import org.apache.ibatis.annotations.Insert;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
import org.apache.ibatis.annotations.Update;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆Mapper接口
|
* 车辆Mapper接口
|
||||||
|
|
@ -14,6 +17,9 @@ import org.apache.ibatis.annotations.Select;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface BizCarMapper extends BaseMapper<BizCar>
|
public interface BizCarMapper extends BaseMapper<BizCar>
|
||||||
{
|
{
|
||||||
|
@Update("create table ${tableName} as select * from track_temp")
|
||||||
|
void createTable(String tableName);
|
||||||
|
|
||||||
@Select("select * from biz_car where car_no = #{carNo}")
|
@Select("select * from biz_car where car_no = #{carNo}")
|
||||||
BizCar selectByCarNo(String carNo);
|
BizCar selectByCarNo(String carNo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.cpxt.biz.service;
|
package com.cpxt.biz.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.cpxt.biz.domain.BizCustomer;
|
import com.cpxt.biz.domain.BizCustomer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -19,6 +21,8 @@ public interface IBizCustomerService
|
||||||
*/
|
*/
|
||||||
public BizCustomer selectBizCustomerById(Long id);
|
public BizCustomer selectBizCustomerById(Long id);
|
||||||
|
|
||||||
|
Page<BizCustomer> selectBizCustomerPage(BizCustomer bizCustomer, int pageNum, int pageSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询客户列表
|
* 查询客户列表
|
||||||
*
|
*
|
||||||
|
|
@ -58,4 +62,6 @@ public interface IBizCustomerService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteBizCustomerById(Long id);
|
public int deleteBizCustomerById(Long id);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,14 @@ public class BizCarServiceImpl implements IBizCarService
|
||||||
@Override
|
@Override
|
||||||
public int insertBizCar(BizCar bizCar)
|
public int insertBizCar(BizCar bizCar)
|
||||||
{
|
{
|
||||||
return bizCarMapper.insert(bizCar);
|
int i = bizCarMapper.insert(bizCar);
|
||||||
|
// 新增完车辆后,创建该车辆的行驶轨迹表
|
||||||
|
if (i > 0){
|
||||||
|
Long id = bizCar.getId();
|
||||||
|
String tableName = "track_" + id;
|
||||||
|
bizCarMapper.createTable(tableName);
|
||||||
|
}
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,11 @@ import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.cpxt.biz.domain.BizCarModel;
|
import com.cpxt.biz.domain.BizCarModel;
|
||||||
import com.cpxt.common.utils.DateUtils;
|
import com.cpxt.common.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.core.parameters.P;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.cpxt.biz.mapper.BizCustomerMapper;
|
import com.cpxt.biz.mapper.BizCustomerMapper;
|
||||||
import com.cpxt.biz.domain.BizCustomer;
|
import com.cpxt.biz.domain.BizCustomer;
|
||||||
|
|
@ -37,6 +39,20 @@ public class BizCustomerServiceImpl implements IBizCustomerService
|
||||||
return bizCustomerMapper.selectById(id);
|
return bizCustomerMapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户列表(分页)
|
||||||
|
*
|
||||||
|
* @param bizCustomer 客户
|
||||||
|
* @return 客户
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Page<BizCustomer> selectBizCustomerPage(BizCustomer bizCustomer, int pageNum, int pageSize) {
|
||||||
|
LambdaQueryWrapper<BizCustomer> queryWrapper= new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
return bizCustomerMapper.selectPage(new Page<>(pageNum,pageSize),queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询客户列表
|
* 查询客户列表
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?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.cpxt.biz.mapper.BizCarMapper">
|
||||||
|
|
||||||
|
<resultMap type="BizCar" id="BizCarResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="modelId" column="model_id" />
|
||||||
|
<result property="modelName" column="model_name" />
|
||||||
|
<result property="carType" column="car_type" />
|
||||||
|
<result property="carNo" column="car_no" />
|
||||||
|
<result property="vin" column="vin" />
|
||||||
|
<result property="serialNo" column="serial_no" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
</resultMap>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue