Merge branch 'dev' of http://122.51.230.86:3000/dianliang/lanan-system into dev
This commit is contained in:
commit
c2cb6324e1
@ -108,6 +108,7 @@ public class CustomerMainServiceImpl extends ServiceImpl<CustomerMainMapper, Cus
|
||||
try {
|
||||
/*1、入参及基础参数值设置*/
|
||||
CustomerMain main = JSONUtil.toBean(JSONUtil.parseObj(saveReqVO).toJSONString(0), CustomerMain.class);
|
||||
|
||||
/*2、新增客户时绑定绑定客户信息*/
|
||||
if (SIGN_CREATE.equals(sign)){
|
||||
//查询数据字典,根据客户类型匹配出预设角色code;
|
||||
@ -163,10 +164,12 @@ public class CustomerMainServiceImpl extends ServiceImpl<CustomerMainMapper, Cus
|
||||
roleCodes.add(dict.getRemark());
|
||||
permissionApi.assignUserRole(userId, roleCodes);
|
||||
}
|
||||
|
||||
/*3、保存客户主表信息*/
|
||||
//暂时写死会员id TODO
|
||||
main.setMemberLevelId("9d4567b7e68803933f4917a4aab6b745");
|
||||
this.saveOrUpdate(main);
|
||||
|
||||
/*4、保存扩展表信息*/
|
||||
if ( null!=saveReqVO.getItemList() && !saveReqVO.getItemList().isEmpty()) {
|
||||
customerItemService.saveCutomItem(main.getId(), saveReqVO.getItemList());
|
||||
|
@ -0,0 +1,84 @@
|
||||
package cn.iocoder.yudao.module.notice.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.notice.entity.DlBaseNotice;
|
||||
import cn.iocoder.yudao.module.notice.service.DlBaseNoticeService;
|
||||
import cn.iocoder.yudao.module.notice.vo.DlBaseNoticeReqVO;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 平台通用信息公告(DlBaseNotice)表控制层
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:48 2024/10/9
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/base/notice")
|
||||
public class DlBaseNoticeController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private DlBaseNoticeService dlBaseNoticeService;
|
||||
|
||||
/**
|
||||
* 平台通用信息公告 分页查询 按服务
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:52 2024/10/9
|
||||
* @param reqVO 查询对象
|
||||
* @param pageNo 页数
|
||||
* @param pageSize 条数
|
||||
**/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "平台通用信息公告 分页查询 按服务")
|
||||
public CommonResult<?> pageNotice(DlBaseNoticeReqVO reqVO,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize) {
|
||||
Page<DlBaseNotice> page = new Page<>(pageNo, pageSize);
|
||||
return success(dlBaseNoticeService.pageNotice(reqVO, page));
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台通用信息公告 新增、修改 按服务
|
||||
*
|
||||
* @author 小李
|
||||
* @date 10:04 2024/10/9
|
||||
* @param reqVO 请求对象
|
||||
**/
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "平台通用信息公告 新增、修改 按服务")
|
||||
public CommonResult<?> updateNotice(@RequestBody DlBaseNoticeReqVO reqVO) {
|
||||
dlBaseNoticeService.updateNotice(reqVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台通用信息公告 删除 按服务
|
||||
*
|
||||
* @author 小李
|
||||
* @date 10:10 2024/10/9
|
||||
* @param ids ids
|
||||
**/
|
||||
@DeleteMapping("/remove")
|
||||
@Operation(summary = "平台通用信息公告 删除 按服务")
|
||||
public CommonResult<?> removeNotice(@RequestParam("ids") List<String> ids) {
|
||||
dlBaseNoticeService.removeNotice(ids);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
@GetMapping("get")
|
||||
@Operation(summary = "平台通用信息公告 查询 按服务")
|
||||
public CommonResult<?> getNoticeById(@RequestParam("id") String id) {
|
||||
return success(dlBaseNoticeService.getById(id));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.notice.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 平台通用信息公告
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:41 2024/10/9
|
||||
**/
|
||||
@TableName(value ="dl_base_notice")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DlBaseNotice extends TenantBaseDO {
|
||||
/**
|
||||
* 公告ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 公告标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 公告内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 公告类型(1通知 2公告)
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 公告状态(0正常 1关闭)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/** 父服务(服务拼音,例:维修业务即weixiu) */
|
||||
private String parentServer;
|
||||
|
||||
/**
|
||||
* 展示在那个服务(使用端,例:小程序即wx,APP即app)
|
||||
*/
|
||||
private String server;
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.notice.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.notice.entity.DlBaseNotice;
|
||||
import cn.iocoder.yudao.module.notice.vo.DlBaseNoticeReqVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 针对表【dl_base_notice(平台通用信息公告)】的数据库操作Mapper
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:44 2024/10/9
|
||||
**/
|
||||
@Mapper
|
||||
public interface DlBaseNoticeMapper extends BaseMapper<DlBaseNotice> {
|
||||
|
||||
/**
|
||||
* 平台通用信息公告 分页查询 按服务
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:52 2024/10/9
|
||||
* @param reqVO 查询对象
|
||||
**/
|
||||
IPage<DlBaseNotice> pageNotice(@Param("map") DlBaseNoticeReqVO reqVO, Page<DlBaseNotice> page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.notice.service;
|
||||
|
||||
import cn.iocoder.yudao.module.notice.entity.DlBaseNotice;
|
||||
import cn.iocoder.yudao.module.notice.vo.DlBaseNoticeReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 针对表【dl_base_notice(平台通用信息公告)】的数据库操作Service
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:45 2024/10/9
|
||||
**/
|
||||
public interface DlBaseNoticeService extends IService<DlBaseNotice> {
|
||||
|
||||
/**
|
||||
* 平台通用信息公告 分页查询 按服务
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:52 2024/10/9
|
||||
* @param reqVO 查询对象
|
||||
**/
|
||||
IPage<DlBaseNotice> pageNotice(DlBaseNoticeReqVO reqVO, Page<DlBaseNotice> page);
|
||||
|
||||
/**
|
||||
* 平台通用信息公告 新增、修改 按服务
|
||||
*
|
||||
* @author 小李
|
||||
* @date 10:04 2024/10/9
|
||||
* @param reqVO 请求对象
|
||||
**/
|
||||
void updateNotice(DlBaseNoticeReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 平台通用信息公告 删除 按服务
|
||||
*
|
||||
* @author 小李
|
||||
* @date 10:10 2024/10/9
|
||||
* @param ids ids
|
||||
**/
|
||||
void removeNotice(List<String> ids);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.notice.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.module.notice.entity.DlBaseNotice;
|
||||
import cn.iocoder.yudao.module.notice.mapper.DlBaseNoticeMapper;
|
||||
import cn.iocoder.yudao.module.notice.service.DlBaseNoticeService;
|
||||
import cn.iocoder.yudao.module.notice.vo.DlBaseNoticeReqVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 针对表【dl_base_notice(平台通用信息公告)】的数据库操作Service实现
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:45 2024/10/9
|
||||
**/
|
||||
@Service
|
||||
public class DlBaseNoticeServiceImpl extends ServiceImpl<DlBaseNoticeMapper, DlBaseNotice>
|
||||
implements DlBaseNoticeService {
|
||||
|
||||
/**
|
||||
* 平台通用信息公告 分页查询 按服务
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:52 2024/10/9
|
||||
* @param reqVO 查询对象
|
||||
**/
|
||||
@Override
|
||||
public IPage<DlBaseNotice> pageNotice(DlBaseNoticeReqVO reqVO, Page<DlBaseNotice> page){
|
||||
return baseMapper.pageNotice(reqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台通用信息公告 新增、修改 按服务
|
||||
*
|
||||
* @author 小李
|
||||
* @date 10:04 2024/10/9
|
||||
* @param reqVO 请求对象
|
||||
**/
|
||||
@Override
|
||||
public void updateNotice(DlBaseNoticeReqVO reqVO){
|
||||
baseMapper.insertOrUpdate(reqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台通用信息公告 删除 按服务
|
||||
*
|
||||
* @author 小李
|
||||
* @date 10:10 2024/10/9
|
||||
* @param ids ids
|
||||
**/
|
||||
@Override
|
||||
public void removeNotice(List<String> ids){
|
||||
baseMapper.deleteByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.notice.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.notice.entity.DlBaseNotice;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 平台通用信息公告 请求VO
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:43 2024/10/9
|
||||
**/
|
||||
@Data
|
||||
public class DlBaseNoticeReqVO extends DlBaseNotice {
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.notice.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.notice.entity.DlBaseNotice;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 平台通用信息公告 响应VO
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:43 2024/10/9
|
||||
**/
|
||||
@Data
|
||||
public class DlBaseNoticeRespVO extends DlBaseNotice {
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
<?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="cn.iocoder.yudao.module.notice.mapper.DlBaseNoticeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.notice.entity.DlBaseNotice">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="title" column="title" jdbcType="VARCHAR"/>
|
||||
<result property="content" column="content" jdbcType="VARCHAR"/>
|
||||
<result property="type" column="type" jdbcType="TINYINT"/>
|
||||
<result property="status" column="status" jdbcType="TINYINT"/>
|
||||
<result property="parentServer" column="parent_server" jdbcType="VARCHAR"/>
|
||||
<result property="server" column="server" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_SQL">
|
||||
select id,
|
||||
title,
|
||||
content,
|
||||
type,
|
||||
status,
|
||||
parent_server,
|
||||
server
|
||||
from dl_base_notice dbn
|
||||
where dbn.deleted = '0'
|
||||
</sql>
|
||||
|
||||
<select id="pageNotice" resultMap="BaseResultMap">
|
||||
<include refid="Base_SQL" />
|
||||
and dbn.parent_server = #{map.parentServer}
|
||||
<if test="map.server != null and map.server != ''">
|
||||
and dbn.server = #{map.server}
|
||||
</if>
|
||||
<if test="map.status != null">
|
||||
and dbn.status = #{map.status}
|
||||
</if>
|
||||
<if test="map.title != null and map.title != ''">
|
||||
and dbn.title like concat('%', #{map.title}, '%')
|
||||
</if>
|
||||
order by dbn.create_time desc
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.base.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsSaveReqVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 维修记录 管理 API
|
||||
* @author lzt
|
||||
*/
|
||||
@Tag(name = "管理后台 - 维修记录")
|
||||
@RestController
|
||||
@RequestMapping("/dl/repair-records")
|
||||
@Validated
|
||||
public class RepairRecordsController {
|
||||
|
||||
@Resource
|
||||
private RepairRecordsService repairRecordsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建维修记录")
|
||||
public CommonResult<String> createRepairRecords(@Valid @RequestBody RepairRecordsSaveReqVO createReqVO) {
|
||||
return success(repairRecordsService.createRepairRecords(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新维修记录")
|
||||
public CommonResult<Boolean> updateRepairRecords(@Valid @RequestBody RepairRecordsSaveReqVO updateReqVO) {
|
||||
repairRecordsService.updateRepairRecords(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除维修记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deleteRepairRecords(@RequestParam("id") String id) {
|
||||
repairRecordsService.deleteRepairRecords(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
// @GetMapping("/get")
|
||||
// @Operation(summary = "获得维修记录")
|
||||
// @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
// public CommonResult<RepairRecordsRespVO> getRecords(@RequestParam("id") String id) {
|
||||
// RepairRecords records = repairRecordsService.getRepairRecords(id);
|
||||
// return success(BeanUtils.toBean(records, RepairRecordsRespVO.class));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 维修工查询维修记录
|
||||
* @param pageReqVO 维修工分页查询条件
|
||||
*
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得维修记录分页")
|
||||
public List<RepairRecordsRespVO> queryAllRepairRecords(@RequestBody RepairRecordsPageReqVO pageReqVO) {
|
||||
return repairRecordsService.queryAllRepairRecords(pageReqVO);
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package cn.iocoder.yudao.module.base.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
||||
import cn.iocoder.yudao.module.base.service.RepairWorkerService;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerSaveReqVO;
|
||||
import cn.iocoder.yudao.module.project.vo.RepairProjectPageReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 维修工人")
|
||||
@RestController
|
||||
@RequestMapping("/repair/worker")
|
||||
@Validated
|
||||
public class RepairWorkerController {
|
||||
|
||||
@Resource
|
||||
private RepairWorkerService workerService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建维修工人")
|
||||
public CommonResult<String> createWorker(@Valid @RequestBody RepairWorkerSaveReqVO createReqVO) {
|
||||
return success(workerService.createWorker(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新维修工人")
|
||||
public CommonResult<Boolean> updateWorker(@Valid @RequestBody RepairWorkerSaveReqVO updateReqVO) {
|
||||
workerService.updateWorker(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除维修工人")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deleteWorker(@RequestParam("id") String id) {
|
||||
workerService.deleteWorker(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得维修工人")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<RepairWorkerRespVO> getWorker(@RequestParam("id") String id) {
|
||||
RepairWorker worker = workerService.getWorker(id);
|
||||
return success(BeanUtils.toBean(worker, RepairWorkerRespVO.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询维修工人
|
||||
* @author PQZ
|
||||
* @date 14:10 2024/10/9
|
||||
* @param pageReqVO RepairWorkerPageReqVO实体
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.framework.common.pojo.PageResult<cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO>>
|
||||
**/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得维修工人分页")
|
||||
public CommonResult<IPage<?>> getWorkerPage(RepairWorkerPageReqVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<RepairWorkerRespVO> page = new Page<>(pageNo,pageSize);
|
||||
return success(workerService.queryListPage(pageReqVO,page));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.base.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 维修记录 DO
|
||||
*
|
||||
* @author lzt
|
||||
*/
|
||||
@TableName("dl_repair_records")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RepairRecords extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String id;
|
||||
/**
|
||||
* 工单id
|
||||
*/
|
||||
private String ticketId;
|
||||
/**
|
||||
* 工单子表id
|
||||
*/
|
||||
private String repairTitemId;
|
||||
/**
|
||||
* 记录类型(repair_records_type)
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 记录描述
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 过程记录中的图片(多个,拼接)
|
||||
*/
|
||||
private String image;
|
||||
/**
|
||||
* 处理人
|
||||
*/
|
||||
private String dealUserName;
|
||||
/**
|
||||
* 处理人员工表id
|
||||
*/
|
||||
private String dealUserId;
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.base.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 维修工人 DO
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@TableName("dl_repair_worker")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RepairWorker extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String userId;
|
||||
/**
|
||||
* 维修工人名称
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 工种
|
||||
*/
|
||||
private String workType;
|
||||
/**
|
||||
* 是否为组长(0代表不是 1代表是)
|
||||
*/
|
||||
private String isLeads;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.base.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 维修记录 Mapper
|
||||
*
|
||||
* @author lzt
|
||||
*/
|
||||
@Mapper
|
||||
public interface RepairRecordsMapper extends BaseMapper<RepairRecords> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询维修记录
|
||||
* @author lzt
|
||||
* @param entity 查询条件
|
||||
* @return List<RepairRecordsRespVO>
|
||||
* @date 2024年10月9日
|
||||
*/
|
||||
List<RepairRecordsRespVO> queryAllRepairRecords(@Param("entity") RepairRecordsPageReqVO entity);
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.base.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 维修工人 Mapper
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@Mapper
|
||||
public interface RepairWorkerMapper extends BaseMapper<RepairWorker> {
|
||||
|
||||
/**
|
||||
* @param entity RepairWorkerPageReqVO实体
|
||||
* @param page 分页参数
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO>
|
||||
* @author PQZ
|
||||
* @date 14:13 2024/10/9
|
||||
**/
|
||||
IPage<RepairWorkerRespVO> queryListPage(@Param("entity") RepairWorkerPageReqVO entity, Page<RepairWorkerRespVO> page);
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.base.service;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 维修记录 Service 接口
|
||||
*
|
||||
* @author lzt
|
||||
*/
|
||||
public interface RepairRecordsService extends IService<RepairRecords> {
|
||||
|
||||
/**
|
||||
* 创建维修记录
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
String createRepairRecords(@Valid RepairRecordsSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新维修记录
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRepairRecords(@Valid RepairRecordsSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除维修记录
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRepairRecords(String id);
|
||||
|
||||
// /**
|
||||
// * 获得维修记录
|
||||
// *
|
||||
// * @param id 编号
|
||||
// * @return 维修记录
|
||||
// */
|
||||
// RepairRecords getRepairRecords(String id);
|
||||
|
||||
/**
|
||||
* 获得维修记录
|
||||
*
|
||||
* @param pageReqVO 查询条件
|
||||
* @return queryAllRepairRecords 所有维修记录
|
||||
*/
|
||||
List<RepairRecordsRespVO> queryAllRepairRecords(RepairRecordsPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.base.service;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerSaveReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 维修工人 Service 接口
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
public interface RepairWorkerService extends IService<RepairWorker> {
|
||||
|
||||
/**
|
||||
* 创建维修工人
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
String createWorker(@Valid RepairWorkerSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新维修工人
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateWorker(@Valid RepairWorkerSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除维修工人
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteWorker(String id);
|
||||
|
||||
/**
|
||||
* 获得维修工人
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 维修工人
|
||||
*/
|
||||
RepairWorker getWorker(String id);
|
||||
|
||||
|
||||
/**
|
||||
* @param pageReqVO RepairWorkerPageReqVO实体
|
||||
* @param page 分页参数
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO>
|
||||
* @author PQZ
|
||||
* @date 14:12 2024/10/9
|
||||
**/
|
||||
IPage<RepairWorkerRespVO> queryListPage(RepairWorkerPageReqVO pageReqVO, Page<RepairWorkerRespVO> page);
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.base.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
||||
import cn.iocoder.yudao.module.base.mapper.RepairRecordsMapper;
|
||||
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 维修记录 Service 实现类
|
||||
*
|
||||
* @author lzt
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RepairRecordsServiceImpl extends ServiceImpl<RepairRecordsMapper, RepairRecords> implements RepairRecordsService {
|
||||
|
||||
@Resource
|
||||
private RepairRecordsMapper repairRecordsMapper;
|
||||
|
||||
@Override
|
||||
public String createRepairRecords(RepairRecordsSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
RepairRecords records = BeanUtils.toBean(createReqVO, RepairRecords.class);
|
||||
repairRecordsMapper.insert(records);
|
||||
// 返回
|
||||
return records.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRepairRecords(RepairRecordsSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
RepairRecords updateObj = BeanUtils.toBean(updateReqVO, RepairRecords.class);
|
||||
repairRecordsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRepairRecords(String id) {
|
||||
// 删除
|
||||
repairRecordsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public RepairRecords getRepairRecords(String id) {
|
||||
// return repairRecordsMapper.selectById(id);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 查询维修记录
|
||||
* @apiNote lzt
|
||||
* @param pageReqVO 查询条件
|
||||
* @return queryAllRepairRecords 所有维修记录
|
||||
* @date
|
||||
*/
|
||||
@Override
|
||||
public List<RepairRecordsRespVO> queryAllRepairRecords(RepairRecordsPageReqVO pageReqVO) {
|
||||
return repairRecordsMapper.queryAllRepairRecords(pageReqVO);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.base.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
||||
import cn.iocoder.yudao.module.base.mapper.RepairWorkerMapper;
|
||||
import cn.iocoder.yudao.module.base.service.RepairWorkerService;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO;
|
||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerSaveReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 维修工人 Service 实现类
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RepairWorkerServiceImpl extends ServiceImpl<RepairWorkerMapper, RepairWorker> implements RepairWorkerService {
|
||||
|
||||
@Resource
|
||||
private RepairWorkerMapper workerMapper;
|
||||
|
||||
@Override
|
||||
public String createWorker(RepairWorkerSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
RepairWorker worker = BeanUtils.toBean(createReqVO, RepairWorker.class);
|
||||
workerMapper.insert(worker);
|
||||
// 返回
|
||||
return worker.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWorker(RepairWorkerSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
RepairWorker updateObj = BeanUtils.toBean(updateReqVO, RepairWorker.class);
|
||||
workerMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteWorker(String id) {
|
||||
// 删除
|
||||
workerMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RepairWorker getWorker(String id) {
|
||||
return workerMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pageReqVO RepairWorkerPageReqVO实体
|
||||
* @param page 分页参数
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO>
|
||||
* @author PQZ
|
||||
* @date 14:12 2024/10/9
|
||||
**/
|
||||
@Override
|
||||
public IPage<RepairWorkerRespVO> queryListPage(RepairWorkerPageReqVO pageReqVO, Page<RepairWorkerRespVO> page) {
|
||||
return workerMapper.queryListPage(pageReqVO,page);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.base.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "接受维修记录的分页查询参数")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class RepairRecordsPageReqVO extends RepairRecords {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cn.iocoder.yudao.module.base.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 维修记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RepairRecordsRespVO extends RepairRecords {
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package cn.iocoder.yudao.module.base.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 维修记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class RepairRecordsSaveReqVO extends RepairRecords {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.base.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "接受页数查询参数")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class RepairWorkerPageReqVO extends RepairWorker {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.base.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 维修工人 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RepairWorkerRespVO extends RepairWorker {
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cn.iocoder.yudao.module.base.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 维修工人新增/修改 Request VO")
|
||||
@Data
|
||||
public class RepairWorkerSaveReqVO extends RepairWorker {
|
||||
|
||||
|
||||
|
||||
}
|
@ -44,7 +44,6 @@ public class RepairProjectController {
|
||||
**/
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建维修项目")
|
||||
// @PreAuthorize("@ss.hasPermission('repair:project:create')")
|
||||
public CommonResult<RepairProject> createRepairProject(@Valid @RequestBody RepairProjectSaveReqVO createReqVO) {
|
||||
RepairProject repairProject = repairProjectService.saveRepairProject(createReqVO);
|
||||
return success(repairProject);
|
||||
@ -60,7 +59,6 @@ public class RepairProjectController {
|
||||
**/
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新维修项目")
|
||||
// @PreAuthorize("@ss.hasPermission('repair:project:update')")
|
||||
public CommonResult<Boolean> updateRepairProject(@Valid @RequestBody RepairProjectSaveReqVO updateReqVO) {
|
||||
repairProjectService.saveRepairProject(updateReqVO);
|
||||
return success(true);
|
||||
@ -77,7 +75,6 @@ public class RepairProjectController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除维修项目")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
// @PreAuthorize("@ss.hasPermission('repair:project:delete')")
|
||||
public CommonResult<Boolean> deleteRepairProject(@RequestParam("id") String id) {
|
||||
repairProjectService.deleteRepairProject(id);
|
||||
return success(true);
|
||||
@ -94,7 +91,6 @@ public class RepairProjectController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得维修项目")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
// @PreAuthorize("@ss.hasPermission('repair:project:query')")
|
||||
public CommonResult<RepairProjectRespVO> getRepairProject(@RequestParam("id") String id) {
|
||||
RepairProject repairProject = repairProjectService.getRepairProject(id);
|
||||
return success(BeanUtils.toBean(repairProject, RepairProjectRespVO.class));
|
||||
@ -113,7 +109,6 @@ public class RepairProjectController {
|
||||
**/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得维修项目分页")
|
||||
// @PreAuthorize("@ss.hasPermission('repair:project:query')")
|
||||
public CommonResult<IPage<?>> getRepairProjectPage(RepairProjectPageReqVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
|
@ -0,0 +1,23 @@
|
||||
<?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="cn.iocoder.yudao.module.base.mapper.RepairRecordsMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="queryAllRepairRecords" resultType="cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO">
|
||||
SELECT *
|
||||
FROM dl_repair_records
|
||||
<where>
|
||||
<if test="entity.someField != null">
|
||||
AND some_column = #{entity.someField}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,27 @@
|
||||
<?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="cn.iocoder.yudao.module.base.mapper.RepairWorkerMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="queryListPage" resultType="cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO">
|
||||
SELECT
|
||||
main.*
|
||||
FROM
|
||||
dl_repair_worker main
|
||||
LEFT JOIN system_users su ON main.user_id = su.id
|
||||
AND su.deleted = 0
|
||||
<where>
|
||||
main.deleted = 0
|
||||
<if test="entity.userName != null and entity.userName != ''">
|
||||
and main.user_name = #{entity.userName}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user