mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 13:42:07 +08:00
新增组织模板分页,组织模板配置接口
This commit is contained in:
+14
@@ -132,5 +132,19 @@ public class MachineTemplateController {
|
|||||||
return success(machineTemplateService.authTemplatePage(page));
|
return success(machineTemplateService.authTemplatePage(page));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("org-auth-template")
|
||||||
|
@Operation(summary = "组织模板授权")
|
||||||
|
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||||
|
public CommonResult<Boolean> auth(@RequestBody MachineOrgAuthReq vo) {
|
||||||
|
return success(machineTemplateService.auth(vo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("organ-template-page")
|
||||||
|
@Operation(summary = "组织模板授权分页列表")
|
||||||
|
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||||
|
public CommonResult<PageResult<OrganTemplateResp>> organTemplatePage(OrganTemplatePage page) {
|
||||||
|
return success(machineTemplateService.organTemplatePage(page));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Beal
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AuthVO {
|
||||||
|
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||||
|
private Boolean showPriorFacing;
|
||||||
|
@Schema(description = "双工位")
|
||||||
|
private Boolean showDualWorkstation;
|
||||||
|
@Schema(description = "自动贴标")
|
||||||
|
private Boolean showAutoNotePrinter;
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Beal
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MachineAuth {
|
||||||
|
@Schema(description = "机台模板id")
|
||||||
|
private Long machineId;
|
||||||
|
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||||
|
private Boolean showPriorFacing;
|
||||||
|
@Schema(description = "双工位")
|
||||||
|
private Boolean showDualWorkstation;
|
||||||
|
@Schema(description = "自动贴标")
|
||||||
|
private Boolean showAutoNotePrinter;
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Beal
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MachineOrgAuthReq {
|
||||||
|
|
||||||
|
@Schema(description = "组织id")
|
||||||
|
private Long organId;
|
||||||
|
@Schema(description = "权限列表")
|
||||||
|
private List<MachineAuth> machineAuthList;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||||
|
|
||||||
|
import com.cf.imes.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Beal
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OrganTemplatePage extends PageParam {
|
||||||
|
@Schema(description = "组织id")
|
||||||
|
private Long organId;
|
||||||
|
@Schema(description = "机台模板名称")
|
||||||
|
private String templateName;
|
||||||
|
|
||||||
|
}
|
||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
import static com.cf.imes.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Beal
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class OrganTemplateResp {
|
||||||
|
@Schema(description = "组织id")
|
||||||
|
private Long organId;
|
||||||
|
@Schema(description = "组织名称")
|
||||||
|
private String organName;
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||||
|
private Date updateTime;
|
||||||
|
@Schema(description = "机台模板列表")
|
||||||
|
private List<OrganTemplateVO> authTemplateList;
|
||||||
|
}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Beal
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OrganTemplateVO {
|
||||||
|
@Schema(description = "机台模板id")
|
||||||
|
private Long templateId;
|
||||||
|
@Schema(description = "机台模板名称")
|
||||||
|
private String templateName;
|
||||||
|
@Schema(description = "机台模板类型")
|
||||||
|
private Integer machineType;
|
||||||
|
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||||
|
private Boolean showPriorFacing;
|
||||||
|
@Schema(description = "双工位")
|
||||||
|
private Boolean showDualWorkstation;
|
||||||
|
@Schema(description = "自动贴标")
|
||||||
|
private Boolean showAutoNotePrinter;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
private Long organId;
|
||||||
|
|
||||||
|
}
|
||||||
+3
-3
@@ -161,10 +161,10 @@ public class CuttingSettingDO extends ESDocument {
|
|||||||
|
|
||||||
|
|
||||||
//高级设置
|
//高级设置
|
||||||
@Schema(description ="默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||||
private Boolean showPriorFacing;
|
private Boolean showPriorFacing;
|
||||||
@Schema(description = "双工位")
|
@Schema(description = "双工位")
|
||||||
private Boolean dualWorkstation;
|
private Boolean showDualWorkstation;
|
||||||
@Schema(description = "自动贴标")
|
@Schema(description = "自动贴标")
|
||||||
private Boolean showAutoNotePrinter;
|
private Boolean showAutoNotePrinter;
|
||||||
@Schema(description = "排版方式")
|
@Schema(description = "排版方式")
|
||||||
@@ -239,7 +239,7 @@ public class CuttingSettingDO extends ESDocument {
|
|||||||
|
|
||||||
|
|
||||||
@Schema(description = "默认false,启用自定义板件编号")
|
@Schema(description = "默认false,启用自定义板件编号")
|
||||||
private Boolean allowBlockNo_Note;
|
private Boolean showAllowBlockNo_Note;
|
||||||
@Schema(description = "默认空,机台备注")
|
@Schema(description = "默认空,机台备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -165,10 +165,10 @@ public class CuttingTemplateMachineDO extends ESDocument {
|
|||||||
|
|
||||||
|
|
||||||
//高级设置
|
//高级设置
|
||||||
@Schema(description ="默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||||
private Boolean showPriorFacing;
|
private Boolean showPriorFacing;
|
||||||
@Schema(description = "双工位")
|
@Schema(description = "双工位")
|
||||||
private Boolean dualWorkstation;
|
private Boolean showDualWorkstation;
|
||||||
@Schema(description = "自动贴标")
|
@Schema(description = "自动贴标")
|
||||||
private Boolean showAutoNotePrinter;
|
private Boolean showAutoNotePrinter;
|
||||||
@Schema(description = "排版方式")
|
@Schema(description = "排版方式")
|
||||||
@@ -243,7 +243,7 @@ public class CuttingTemplateMachineDO extends ESDocument {
|
|||||||
|
|
||||||
|
|
||||||
@Schema(description = "默认false,启用自定义板件编号")
|
@Schema(description = "默认false,启用自定义板件编号")
|
||||||
private Boolean allowBlockNo_Note;
|
private Boolean showAllowBlockNo_Note;
|
||||||
@Schema(description = "默认空,机台备注")
|
@Schema(description = "默认空,机台备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
package com.cf.imes.module.system.dal.dataobject.machinetemplate;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Beal
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("system_organ_machine")
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class OrganMachineDO {
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
private Long organId;
|
||||||
|
private Long machineId;
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
/**
|
||||||
|
* 加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置
|
||||||
|
*/
|
||||||
|
private Boolean showPriorFacing;
|
||||||
|
/**
|
||||||
|
* 双工位
|
||||||
|
*/
|
||||||
|
private Boolean showDualWorkstation;
|
||||||
|
/**
|
||||||
|
* 自动贴标
|
||||||
|
*/
|
||||||
|
private Boolean showAutoNotePrinter;
|
||||||
|
}
|
||||||
+7
-4
@@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.cf.imes.framework.common.pojo.PageResult;
|
import com.cf.imes.framework.common.pojo.PageResult;
|
||||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.cf.imes.module.system.controller.admin.machine.vo.AuthTemplatePage;
|
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||||
import com.cf.imes.module.system.controller.admin.machine.vo.AuthTemplateResp;
|
|
||||||
import com.cf.imes.module.system.controller.admin.machine.vo.AutoTemplateVO;
|
|
||||||
import com.cf.imes.module.system.controller.admin.machine.vo.MachinePageReqVO;
|
|
||||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateDO;
|
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -35,4 +32,10 @@ public interface MachineTemplateMapper extends BaseMapperX<MachineTemplateDO> {
|
|||||||
Page<AuthTemplateResp> selectAuthTemplatePage(@Param("page") IPage<AuthTemplateResp> authTemplateRespPage, @Param("vo") AuthTemplatePage page);
|
Page<AuthTemplateResp> selectAuthTemplatePage(@Param("page") IPage<AuthTemplateResp> authTemplateRespPage, @Param("vo") AuthTemplatePage page);
|
||||||
|
|
||||||
List<AutoTemplateVO> selectAuthTemplateList(Map<String, Object> map);
|
List<AutoTemplateVO> selectAuthTemplateList(Map<String, Object> map);
|
||||||
|
|
||||||
|
Page<OrganTemplateResp> selectOrganTemplatePage(@Param("page") Page<OrganTemplateResp> respPage, @Param("vo") OrganTemplatePage page);
|
||||||
|
|
||||||
|
List<OrganTemplateVO> selectOrganTemplateList(Map<String, Object> map);
|
||||||
|
|
||||||
|
Page<OrganTemplateResp> xxselectOrganTemplatePage(@Param("page") Page<OrganTemplateResp> respPage, @Param("vo") OrganTemplatePage page);
|
||||||
}
|
}
|
||||||
|
|||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package com.cf.imes.module.system.dal.mysql.machinetemplate;
|
||||||
|
|
||||||
|
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.cf.imes.module.system.dal.dataobject.machinetemplate.OrganMachineDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface OrganMachineMapper extends BaseMapperX<OrganMachineDO> {
|
||||||
|
|
||||||
|
}
|
||||||
+4
@@ -46,4 +46,8 @@ public interface MachineTemplateService {
|
|||||||
Map<Integer, List<MachineTemplateDO>> getMachineTemplateTree();
|
Map<Integer, List<MachineTemplateDO>> getMachineTemplateTree();
|
||||||
|
|
||||||
PageResult<AuthTemplateResp> authTemplatePage(AuthTemplatePage page);
|
PageResult<AuthTemplateResp> authTemplatePage(AuthTemplatePage page);
|
||||||
|
|
||||||
|
Boolean auth(MachineOrgAuthReq vo);
|
||||||
|
|
||||||
|
PageResult<OrganTemplateResp> organTemplatePage(OrganTemplatePage page);
|
||||||
}
|
}
|
||||||
|
|||||||
+44
@@ -26,9 +26,11 @@ import com.cf.imes.module.system.dal.dataobject.machine.UserMachineDO;
|
|||||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.CuttingTemplateMachineDO;
|
import com.cf.imes.module.system.dal.dataobject.machinetemplate.CuttingTemplateMachineDO;
|
||||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.DrillTemplateMachineDO;
|
import com.cf.imes.module.system.dal.dataobject.machinetemplate.DrillTemplateMachineDO;
|
||||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateDO;
|
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateDO;
|
||||||
|
import com.cf.imes.module.system.dal.dataobject.machinetemplate.OrganMachineDO;
|
||||||
import com.cf.imes.module.system.dal.dataobject.user.AdminUserDO;
|
import com.cf.imes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import com.cf.imes.module.system.dal.mysql.machine.UserMachineMapper;
|
import com.cf.imes.module.system.dal.mysql.machine.UserMachineMapper;
|
||||||
import com.cf.imes.module.system.dal.mysql.machinetemplate.MachineTemplateMapper;
|
import com.cf.imes.module.system.dal.mysql.machinetemplate.MachineTemplateMapper;
|
||||||
|
import com.cf.imes.module.system.dal.mysql.machinetemplate.OrganMachineMapper;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -36,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -68,6 +71,9 @@ public class MachineTemplateServiceImpl implements MachineTemplateService {
|
|||||||
@Resource
|
@Resource
|
||||||
private MachineTemplateMapper machineTemplateMapper;
|
private MachineTemplateMapper machineTemplateMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OrganMachineMapper organMachineMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Long createDrillTemplate(DrillTemplateSaveReqVO reqVO) {
|
public Long createDrillTemplate(DrillTemplateSaveReqVO reqVO) {
|
||||||
@@ -269,6 +275,14 @@ public class MachineTemplateServiceImpl implements MachineTemplateService {
|
|||||||
return new PageResult<>(pageRes.getRecords(), pageRes.getTotal());
|
return new PageResult<>(pageRes.getRecords(), pageRes.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<OrganTemplateResp> organTemplatePage(OrganTemplatePage page) {
|
||||||
|
Page<OrganTemplateResp> respPage = new Page<>(page.getPageNo(), page.getPageSize());
|
||||||
|
Page<OrganTemplateResp> pageRes = machineTemplateMapper.xxselectOrganTemplatePage(respPage, page);
|
||||||
|
return new PageResult<>(pageRes.getRecords(), pageRes.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteCuttingTemplate(Long id) {
|
public Boolean deleteCuttingTemplate(Long id) {
|
||||||
MachineTemplateDO templateDO = machineTemplateMapper.selectById(id);
|
MachineTemplateDO templateDO = machineTemplateMapper.selectById(id);
|
||||||
@@ -326,6 +340,36 @@ public class MachineTemplateServiceImpl implements MachineTemplateService {
|
|||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean auth(MachineOrgAuthReq vo) {
|
||||||
|
organMachineMapper.delete(new LambdaQueryWrapperX<OrganMachineDO>().eq(OrganMachineDO::getOrganId, vo.getOrganId()));
|
||||||
|
|
||||||
|
List<MachineAuth> machineAuthList = vo.getMachineAuthList();
|
||||||
|
|
||||||
|
if(CollectionUtil.isNotEmpty(machineAuthList)) {
|
||||||
|
List<OrganMachineDO> organMachineDOS = new ArrayList<>();
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
for (MachineAuth machineAuth : machineAuthList) {
|
||||||
|
organMachineDOS.add(
|
||||||
|
OrganMachineDO.builder()
|
||||||
|
.createTime(now)
|
||||||
|
.organId(vo.getOrganId())
|
||||||
|
.machineId(machineAuth.getMachineId())
|
||||||
|
.showDualWorkstation(machineAuth.getShowDualWorkstation())
|
||||||
|
.showAutoNotePrinter(machineAuth.getShowAutoNotePrinter())
|
||||||
|
.showPriorFacing(machineAuth.getShowPriorFacing())
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
organMachineMapper.insertBatch(organMachineDOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* @Override
|
/* @Override
|
||||||
public PageResult<CuttingMachineDO> pageCutting(PageParam pageParam) {
|
public PageResult<CuttingMachineDO> pageCutting(PageParam pageParam) {
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
|||||||
+78
@@ -13,6 +13,28 @@
|
|||||||
</collection>
|
</collection>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="orgMap" type="com.cf.imes.module.system.controller.admin.machine.vo.OrganTemplateResp">
|
||||||
|
<result property="organId" column="organId"/>
|
||||||
|
<result property="organName" column="organName"/>
|
||||||
|
<result property="updateTime" column="updateTime"/>
|
||||||
|
<collection property="authTemplateList" javaType="java.util.List" ofType="com.cf.imes.module.system.controller.admin.machine.vo.OrganTemplateVO"
|
||||||
|
select="selectOrganTemplateList" column="{organId=organId, templateName = templateName}" notNullColumn="templateId" >
|
||||||
|
</collection>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="xxMap" type="com.cf.imes.module.system.controller.admin.machine.vo.OrganTemplateResp">
|
||||||
|
<result property="organId" column="organId"/>
|
||||||
|
<result property="organName" column="organName"/>
|
||||||
|
<result property="updateTime" column="updateTime"/>
|
||||||
|
<collection property="authTemplateList" javaType="java.util.List" ofType="com.cf.imes.module.system.controller.admin.machine.vo.OrganTemplateVO"
|
||||||
|
select="selectOrganTemplateList" column="{organId=organId, templateName = templateName}" notNullColumn="templateId" >
|
||||||
|
</collection>
|
||||||
|
<!--<collection property="authTemplateList" javaType="java.util.List" ofType="com.cf.imes.module.system.controller.admin.machine.vo.OrganTemplateVO">
|
||||||
|
<result property="templateName" column="templateName"/>
|
||||||
|
<result property="templateId" column="templateId"/>
|
||||||
|
</collection>-->
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
<select id="selectAuthTemplatePage" resultMap="map" parameterType="com.cf.imes.module.system.controller.admin.machine.vo.AuthTemplatePage">
|
<select id="selectAuthTemplatePage" resultMap="map" parameterType="com.cf.imes.module.system.controller.admin.machine.vo.AuthTemplatePage">
|
||||||
select a.id AS userId, a.nickname, a.organ_id, max(b.create_time) as updateTime, f.name as organName,
|
select a.id AS userId, a.nickname, a.organ_id, max(b.create_time) as updateTime, f.name as organName,
|
||||||
case when ('${vo.templateName}' != '') then '${vo.templateName}' else '' end as templateName
|
case when ('${vo.templateName}' != '') then '${vo.templateName}' else '' end as templateName
|
||||||
@@ -43,4 +65,60 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrganTemplatePage" resultMap="orgMap">
|
||||||
|
select a.id as organId, a.name as organName, max(b.create_time) as updateTime,
|
||||||
|
case when ('${vo.templateName}' != '') then '${vo.templateName}' else '' end as templateName
|
||||||
|
from system_organization a, system_organ_machine b
|
||||||
|
<where>
|
||||||
|
a.id = b.organ_id
|
||||||
|
<if test="vo.organId != null">
|
||||||
|
and a.id = #{vo.organId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY organId
|
||||||
|
order by updateTime desc
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrganTemplateList"
|
||||||
|
resultType="com.cf.imes.module.system.controller.admin.machine.vo.OrganTemplateVO">
|
||||||
|
select b.organ_id organId, b.show_prior_facing, b.show_dual_workstation, b.show_auto_note_printer,
|
||||||
|
c.name AS templateName, c.id AS templateId, c.machine_type
|
||||||
|
from system_organ_machine b
|
||||||
|
inner join system_machine_template c on b.machine_id = c.id and c.deleted = 0
|
||||||
|
<where>
|
||||||
|
b.organ_id = #{organId}
|
||||||
|
<if test="templateName != null and templateName != ''">
|
||||||
|
and c.name like concat('%',#{templateName},'%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="xxselectOrganTemplatePage" resultMap="xxMap">
|
||||||
|
select * from (
|
||||||
|
select a.id as organId, a.name as organName, max(b.create_time) as updateTime,
|
||||||
|
case when ('${vo.templateName}' != '') then '${vo.templateName}' else '' end as templateName
|
||||||
|
from system_organization a, system_organ_machine b
|
||||||
|
<where>
|
||||||
|
a.id = b.organ_id
|
||||||
|
<if test="vo.organId !=null">
|
||||||
|
and a.id = #{vo.organId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY organId
|
||||||
|
) t1
|
||||||
|
LEFT JOIN (
|
||||||
|
select b.organ_id t2_organId
|
||||||
|
from system_organ_machine b inner join system_machine_template c on b.machine_id = c.id and c.deleted = 0
|
||||||
|
<where>
|
||||||
|
<if test="vo.templateName !=null and vo.templateName !='' " >
|
||||||
|
c.name like concat('%',#{vo.templateName},'%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
) t2 on t1.organId = t2.t2_organId
|
||||||
|
where t2.t2_organId is not null
|
||||||
|
GROUP BY organId
|
||||||
|
order by updateTime desc
|
||||||
|
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user