| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.pojo.StandardMethod; |
| | | import com.yuanchu.mom.pojo.StructureItemParameter; |
| | | import com.yuanchu.mom.service.StandardMethodService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | |
| | | return Result.success(standardMethodService.selectStandardMethods()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å æ åæ¹æ³") |
| | | @PostMapping("/addStandardMethod") |
| | | public Result addStandardMethod(@RequestBody StandardMethod standardMethod) { |
| | | return Result.success(standardMethodService.addStandardMethod(standardMethod)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å 餿 åæ¹æ³") |
| | | @PostMapping("/delStandardMethod") |
| | | public Result<?> delStandardMethod(Integer id) { |
| | | return Result.success(standardMethodService.delStandardMethod(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿®æ¹æ åæ¹æ³") |
| | | @PostMapping("/upStandardMethod") |
| | | public Result<?> upStandardMethod(@RequestBody StandardMethod standardMethod) { |
| | | return Result.success(standardMethodService.upStandardMethod(standardMethod)); |
| | | } |
| | | } |
| | |
| | | * æ åæ¹æ³ |
| | | */ |
| | | @ValueTableShow(2) |
| | | @ApiModelProperty(value = "æ åæ¹æ³") |
| | | @ApiModelProperty(value = "æ åæè¿°") |
| | | private String name; |
| | | |
| | | private Integer structureTestObjectId; |
| | | |
| | | @ValueTableShow(3) |
| | | @ApiModelProperty("æ£éªå¯¹è±¡") |
| | | private String sampleType; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | |
| | | private String unit; |
| | | |
| | | @ValueTableShow(5) |
| | | @ApiModelProperty(value = "æ åæ¹æ³") |
| | | @ApiModelProperty(value = "è¯éªæ¹æ³") |
| | | private String method; |
| | | |
| | | @ValueTableShow(6) |
| | |
| | | |
| | | @ValueTableShow(5) |
| | | @ApiModelProperty(value = "æ£éªå¯¹è±¡") |
| | | private String sample; |
| | | private Integer sample; |
| | | |
| | | @ValueTableShow(14) |
| | | @ApiModelProperty(value = "åå§è®°å½æ¨¡æ¿") |
| | |
| | | |
| | | List<StandardMethod> selectStandardMethods(); |
| | | |
| | | int addStandardMethod(StandardMethod standardMethod); |
| | | |
| | | int delStandardMethod(Integer id); |
| | | |
| | | int upStandardMethod(StandardMethod standardMethod); |
| | | |
| | | } |
| | |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.dto.PageTestObjectDto; |
| | | import com.yuanchu.mom.exception.ErrorException; |
| | | import com.yuanchu.mom.mapper.StructureItemParameterMapper; |
| | | import com.yuanchu.mom.mapper.StructureTestObjectMapper; |
| | | import com.yuanchu.mom.pojo.StructureItemParameter; |
| | |
| | | |
| | | @Override |
| | | public int addTestObject(StructureTestObject testObject) { |
| | | System.out.println(testObject); |
| | | Long count = structureTestObjectMapper.selectCount(Wrappers.<StructureTestObject>lambdaQuery().eq(StructureTestObject::getSpecimenName, testObject.getSpecimenName())); |
| | | if(count.compareTo(0L) > 0){ |
| | | throw new ErrorException("æ£éªå¯¹è±¡ä¸è½éå¤"); |
| | | } |
| | | return structureTestObjectMapper.insert(testObject); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<StructureTestObject> selectTestObjectByName() { |
| | | return structureTestObjectMapper.selectList(Wrappers.<StructureTestObject>lambdaQuery().select(StructureTestObject::getSpecimenName)); |
| | | return structureTestObjectMapper.selectList(Wrappers.<StructureTestObject>lambdaQuery().select(StructureTestObject::getSpecimenName,StructureTestObject::getId)); |
| | | } |
| | | } |
| | | |
| | |
| | | public List<StandardMethod> selectStandardMethods() { |
| | | return standardMethodMapper.selectList(Wrappers.<StandardMethod>lambdaQuery().select(StandardMethod::getId,StandardMethod::getCode,StandardMethod::getName)); |
| | | } |
| | | |
| | | @Override |
| | | public int addStandardMethod(StandardMethod standardMethod) { |
| | | return standardMethodMapper.insert(standardMethod); |
| | | } |
| | | |
| | | @Override |
| | | public int delStandardMethod(Integer id) { |
| | | return standardMethodMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public int upStandardMethod(StandardMethod standardMethod) { |
| | | return standardMethodMapper.updateById(standardMethod); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | select sm.id, |
| | | sm.code, |
| | | sm.name, |
| | | sm.structure_test_object_id, |
| | | sto.specimen_name sample_type, |
| | | sm.remark, |
| | | u1.name create_user_name, |
| | | sm.create_time, |
| | |
| | | from standard_method sm |
| | | left join user u1 on sm.create_user = u1.id |
| | | left join user u2 on sm.update_user = u2.id |
| | | left join structure_test_object sto on sm.structure_test_object_id = sto.id |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | |
| | | |
| | | @Override |
| | | protected void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(fiferConfig).addPathPatterns("/**"); |
| | | registry.addInterceptor(powerConfig).addPathPatterns("/**"); |
| | | // registry.addInterceptor(fiferConfig).addPathPatterns("/**"); |
| | | // registry.addInterceptor(powerConfig).addPathPatterns("/**"); |
| | | registry.addInterceptor(logConfig).addPathPatterns("/**"); |
| | | super.addInterceptors(registry); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.dto.InsOderDto; |
| | | import com.yuanchu.mom.dto.SampleOrderDto; |
| | | import com.yuanchu.mom.dto.SampleProductDto; |
| | | import com.yuanchu.mom.pojo.InsOrder; |
| | | import com.yuanchu.mom.pojo.InsSample; |
| | | import com.yuanchu.mom.pojo.InsOrderTemplate; |
| | | import com.yuanchu.mom.service.InsOrderService; |
| | | import com.yuanchu.mom.service.InsOrderTemplateService; |
| | | import com.yuanchu.mom.service.InsProductService; |
| | | import com.yuanchu.mom.service.InsSampleService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.*; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/insOrder") |
| | | @Api("æ£éªå模å") |
| | | public class InsOrderController { |
| | | |
| | | private InsOrderService insOrderService; |
| | |
| | | private InsSampleService insSampleService; |
| | | |
| | | private InsProductService insProductService; |
| | | |
| | | private InsOrderTemplateService insOrderTemplateService; |
| | | |
| | | //è·åæ£éªä¸åæ°æ® |
| | | @ApiOperation(value = "æ¥è¯¢æ£éªä¸åæ°æ®") |
| | |
| | | |
| | | @ApiOperation(value = "æ£éªä¸å") |
| | | @PostMapping("/upInsOrder") |
| | | public Result<?> upInsOrder(Integer orderId,Integer sampleId, String appointed, Integer userId) { |
| | | public Result<?> upInsOrder(Integer orderId, Integer sampleId, String appointed, Integer userId) { |
| | | return Result.success(insOrderService.upInsOrder(orderId, sampleId, appointed, userId)); |
| | | } |
| | | |
| | |
| | | return Result.success("æå", LocalDateTime.now().plusDays(day).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢æ£éªä¸åå
容详æ
") |
| | | @PostMapping("/getInsOrder") |
| | | @ValueAuth |
| | | public Result<?> getInsOrder(Integer orderId) { |
| | | return Result.success(insOrderService.getInsOrder(orderId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å®¡æ ¸æ£éªåæºè¿è¡ç¶æä¿®æ¹") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "æ£éªåid"), |
| | | @ApiImplicitParam(name = "state", value = "å®¡æ ¸ç»æ 1:éè¿ 2ï¼ä¸éè¿") |
| | | }) |
| | | @PostMapping("/upInsOrderOfState") |
| | | public Result<?> upInsOrderOfState(@RequestBody InsOrder insOrder) { |
| | | return Result.success(insOrderService.upInsOrderOfState(insOrder)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ·»å æ£éªå模æ¿") |
| | | @PostMapping("/addInsOrderTemplate") |
| | | public Result<?> addInsOrderTemplate(@RequestBody InsOrderTemplate insOrderTemplate) { |
| | | return Result.success(insOrderTemplateService.addInsOrderTemplate(insOrderTemplate)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢æ£éªå模æ¿") |
| | | @GetMapping("/selectInsOrderTemplate") |
| | | @ValueAuth |
| | | public Result<?> selectInsOrderTemplate() { |
| | | return Result.success(insOrderTemplateService.selectInsOrderTemplate()); |
| | | } |
| | | |
| | | @ApiOperation(value = "éè¿æ£éªå模æ¿idè·åæ£éªå模æ¿å
容") |
| | | @PostMapping("/selectInsOrderTemplateById") |
| | | @ValueAuth |
| | | public Result<?> selectInsOrderTemplateById(Integer id) { |
| | | return Result.success("æå", insOrderTemplateService.selectInsOrderTemplateById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "å 餿£éªå模æ¿") |
| | | @PostMapping("/delInsOrderTemplate") |
| | | @ValueAuth |
| | | public Result<?> delInsOrderTemplate(Integer id) { |
| | | return Result.success(insOrderTemplateService.delInsOrderTemplate(id)); |
| | | } |
| | | } |
| | |
| | | return Result.success(standardProductListService.selectStandardProductList(insSample)); |
| | | } |
| | | |
| | | @ApiOperation(value = "éè¿æ£éªæ åæ¥è¯¢æ£éªé¡¹ç®") |
| | | @PostMapping("/selectStandardProductListByMethodId") |
| | | @ValueAuth |
| | | public Result selectStandardProductListByMethodId(Integer id){ |
| | | return Result.success(standardProductListService.selectStandardProductListByMethodId(id)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.yuanchu.mom.dto.SampleOrderDto; |
| | | import com.yuanchu.mom.dto.SampleProductDto; |
| | | import com.yuanchu.mom.pojo.InsOrder; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author gaoaoy |
| | | * @description é对表ãins_order(æ£éªä¸å)ãçæ°æ®åºæä½Mapper |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.yuanchu.mom.pojo.InsOrderTemplate; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãins_order_templateãçæ°æ®åºæä½Mapper |
| | | * @createDate 2024-03-18 14:14:54 |
| | | * @Entity com.yuanchu.mom.pojo.InsOrderTemplate |
| | | */ |
| | | public interface InsOrderTemplateMapper extends BaseMapper<InsOrderTemplate> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.dto.InsOrderPlanDTO; |
| | | import com.yuanchu.mom.dto.SampleProductDto; |
| | | import com.yuanchu.mom.pojo.InsSample; |
| | | import com.yuanchu.mom.vo.InsOrderPlanVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | |
| | | IPage<InsOrderPlanVO> findInsSampleAndOrder(Page page, @Param("ew") InsOrderPlanDTO insOrderPlanDTO); |
| | | |
| | | List<SampleProductDto> selectSampleProductListByOrderId(Integer id); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.yuanchu.mom.dto.FactoryDto; |
| | | import com.yuanchu.mom.pojo.StandardMethodList; |
| | | import com.yuanchu.mom.pojo.StandardProductList; |
| | | import com.yuanchu.mom.pojo.StandardTree; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | |
| | | StandardProductList selectStandardProductById(Integer id); |
| | | |
| | | List<StandardProductList> getStandardProductListBySample(String sample); |
| | | List<StandardProductList> getStandardProductListBySample(String sampleType); |
| | | |
| | | List<StandardMethodList> getStandardMethodListBySample(String sampleType); |
| | | |
| | | } |
| | | |
| | |
| | | * çº¦å®æ¶é´ |
| | | */ |
| | | @ValueTableShow(7) |
| | | @ApiModelProperty("éæ±æ¶é´") |
| | | @ApiModelProperty("çº¦å®æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate appointed; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * |
| | | * @TableName ins_order_template |
| | | */ |
| | | @TableName(value ="ins_order_template") |
| | | @Data |
| | | public class InsOrderTemplate implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 模æ¿åç§° |
| | | */ |
| | | @ApiModelProperty("模æ¿åç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * 模æ¿å
容 |
| | | */ |
| | | @ApiModelProperty("模æ¿å
容") |
| | | private String thing; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | } |
| | |
| | | @ApiModelProperty("è¦æ±å¼") |
| | | private String ask; |
| | | |
| | | @ApiModelProperty("è¦æ±å¼") |
| | | private String tell; |
| | | |
| | | /** |
| | | * å¤é®ï¼æ åæ¹æ³id |
| | | */ |
| | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("1ï¼ææ 0ï¼æ æ") |
| | | private Integer state; |
| | | } |
| | |
| | | |
| | | int addInsOrder(List<SampleProductDto> list, InsOrder insOrder); |
| | | |
| | | Map<String, Object> getInsOrder(Integer id); |
| | | |
| | | int upInsOrderOfState(InsOrder insOrder); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.yuanchu.mom.pojo.InsOrderTemplate; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãins_order_templateãçæ°æ®åºæä½Service |
| | | * @createDate 2024-03-18 14:14:54 |
| | | */ |
| | | public interface InsOrderTemplateService extends IService<InsOrderTemplate> { |
| | | |
| | | int addInsOrderTemplate(InsOrderTemplate insOrderTemplate); |
| | | |
| | | List<InsOrderTemplate> selectInsOrderTemplate(); |
| | | |
| | | String selectInsOrderTemplateById(Integer id); |
| | | |
| | | int delInsOrderTemplate(Integer id); |
| | | |
| | | } |
| | |
| | | |
| | | List<StandardProductList> selectStandardProductList(InsSample insSample); |
| | | |
| | | List<StandardProductList> selectStandardProductListByMethodId(Integer id); |
| | | |
| | | } |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | a.setInsOrderId(insOrder.getId()); |
| | | a.setInsProgress(0); |
| | | insSampleMapper.insert(a); |
| | | for (InsProduct product : a.getInsProduct()) { |
| | | product.setId(null); |
| | | product.setCreateTime(null); |
| | | product.setUpdateTime(null); |
| | | product.setUpdateTime(null); |
| | | product.setUpdateUser(null); |
| | | product.setInsSampleId(a.getId()); |
| | | insProductMapper.insert(product); |
| | | if(ObjectUtil.isNotEmpty(a.getInsProduct())){ |
| | | for (InsProduct product : a.getInsProduct()) { |
| | | product.setId(null); |
| | | product.setCreateTime(null); |
| | | product.setUpdateTime(null); |
| | | product.setUpdateTime(null); |
| | | product.setUpdateUser(null); |
| | | product.setInsSampleId(a.getId()); |
| | | insProductMapper.insert(product); |
| | | } |
| | | } |
| | | }); |
| | | return 1; |
| | | return insOrder.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getInsOrder(Integer id) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<SampleProductDto> list = insSampleMapper.selectSampleProductListByOrderId(id); |
| | | InsOrder insOrder = insOrderMapper.selectById(id); |
| | | map.put("insOrder", insOrder); |
| | | map.put("sampleProduct", list); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public int upInsOrderOfState(InsOrder insOrder) { |
| | | return insOrderMapper.updateById(insOrder); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.pojo.InsOrderTemplate; |
| | | import com.yuanchu.mom.service.InsOrderTemplateService; |
| | | import com.yuanchu.mom.mapper.InsOrderTemplateMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description é对表ãins_order_templateãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2024-03-18 14:14:54 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class InsOrderTemplateServiceImpl extends ServiceImpl<InsOrderTemplateMapper, InsOrderTemplate> |
| | | implements InsOrderTemplateService{ |
| | | |
| | | private InsOrderTemplateMapper insOrderTemplateMapper; |
| | | |
| | | private GetLook getLook; |
| | | |
| | | @Override |
| | | public int addInsOrderTemplate(InsOrderTemplate insOrderTemplate) { |
| | | return insOrderTemplateMapper.insert(insOrderTemplate); |
| | | } |
| | | |
| | | @Override |
| | | public List<InsOrderTemplate> selectInsOrderTemplate() { |
| | | return insOrderTemplateMapper.selectList(Wrappers.<InsOrderTemplate>lambdaQuery().eq(InsOrderTemplate::getCreateUser, getLook.selectPowerByMethodAndUserId(null).get("userId")).select(InsOrderTemplate.class, info->!info.getColumn().equals("thing"))); |
| | | } |
| | | |
| | | @Override |
| | | public String selectInsOrderTemplateById(Integer id) { |
| | | return insOrderTemplateMapper.selectById(id).getThing(); |
| | | } |
| | | |
| | | @Override |
| | | public int delInsOrderTemplate(Integer id) { |
| | | return insOrderTemplateMapper.deleteById(id); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | public Map<String, List<?>> selectsStandardMethodByFLSSM(String tree) { |
| | | String[] trees = tree.split(" - "); |
| | | List<StandardMethodList> standardMethodLists = null; |
| | | List<StandardProductList> standardProductLists = null; |
| | | switch (trees.length){ |
| | | case 5: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],trees[3],trees[4]); |
| | | standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getFactory, trees[0]).eq(StandardProductList::getLaboratory, trees[1]).eq(StandardProductList::getSampleType, trees[2]).eq(StandardProductList::getSample, trees[3]).eq(StandardProductList::getModel, trees[4])); |
| | | // standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getFactory, trees[0]).eq(StandardProductList::getLaboratory, trees[1]).eq(StandardProductList::getSampleType, trees[2]).eq(StandardProductList::getSample, trees[3]).eq(StandardProductList::getModel, trees[4])); |
| | | break; |
| | | case 4: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],trees[3],null); |
| | | standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getFactory, trees[0]).eq(StandardProductList::getLaboratory, trees[1]).eq(StandardProductList::getSampleType, trees[2]).eq(StandardProductList::getSample, trees[3])); |
| | | break; |
| | | case 3: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],null,null); |
| | | standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getFactory, trees[0]).eq(StandardProductList::getLaboratory, trees[1]).eq(StandardProductList::getSampleType, trees[2])); |
| | | break; |
| | | case 2: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],null,null,null); |
| | | standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getFactory, trees[0]).eq(StandardProductList::getLaboratory, trees[1])); |
| | | break; |
| | | case 1: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],null,null,null,null); |
| | | standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getFactory, trees[0])); |
| | | break; |
| | | } |
| | | Map<String, List<?>> map = new HashMap<>(); |
| | | map.put("standardMethodList", standardMethodLists); |
| | | map.put("standardProductList", standardProductLists); |
| | | return map; |
| | | } |
| | | |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public List<StandardProductList> selectStandardProductList(InsSample insSample) { |
| | | List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getFactory, insSample.getFactory()).eq(StandardProductList::getLaboratory, insSample.getLaboratory()).eq(StandardProductList::getSampleType, insSample.getSampleType()).eq(StandardProductList::getSample, insSample.getSample()).eq(StandardProductList::getModel, insSample.getModel())); |
| | | if (list.size() == 0) { |
| | | list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getFactory, insSample.getFactory()).eq(StandardProductList::getLaboratory, insSample.getLaboratory()).eq(StandardProductList::getSampleType, insSample.getSampleType()).eq(StandardProductList::getSample, insSample.getSample())); |
| | | list = list.stream().filter(a -> { |
| | | try { |
| | | list = list.stream().filter(a -> { |
| | | String[] split = a.getSection().split("~"); |
| | | return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(split[0])) > -1 && new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(split[1])) < 1; |
| | | }).collect(Collectors.toList()); |
| | | } catch (Exception e) {} |
| | | } |
| | | if(a.getSection()!=null && !Objects.equals(a.getSection(), "")){ |
| | | if (a.getSection().contains("~")) { |
| | | String[] split = a.getSection().split("~"); |
| | | return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(split[0])) > -1 && new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(split[1])) < 1; |
| | | } else if (a.getSection().contains("â¥") || a.getSection().contains(">=")) { |
| | | String param = a.getSection().replace("â¥", "").replace(">=",""); |
| | | return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(param)) > -1; |
| | | } else if (a.getSection().contains("â¤") || a.getSection().contains("<=")) { |
| | | String param = a.getSection().replace("â¤", "").replace("<=",""); |
| | | return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(param)) < 1; |
| | | } else if (a.getSection().contains(">")) { |
| | | String param = a.getSection().replace(">", ""); |
| | | return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(param)) > 0; |
| | | } else if (a.getSection().contains("<")) { |
| | | String param = a.getSection().replace("<", ""); |
| | | return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(param)) < 0; |
| | | } else if (a.getSection().contains("=")) { |
| | | String param = a.getSection().replace("=", ""); |
| | | return new BigDecimal(insSample.getModel()).compareTo(new BigDecimal(param)) == 0; |
| | | } |
| | | } |
| | | } catch (Exception ignored) { |
| | | return false; |
| | | } |
| | | return true; |
| | | }).collect(Collectors.toList()); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<StandardProductList> selectStandardProductListByMethodId(Integer id) { |
| | | return standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, id)); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.dto.FactoryDto; |
| | |
| | | import com.yuanchu.mom.pojo.StandardProductList; |
| | | import com.yuanchu.mom.pojo.StandardTree; |
| | | import com.yuanchu.mom.service.StandardMethodListService; |
| | | import com.yuanchu.mom.service.StandardProductListService; |
| | | import com.yuanchu.mom.service.StandardTreeService; |
| | | import com.yuanchu.mom.mapper.StandardTreeMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | |
| | | private StandardProductListMapper standardProductListMapper; |
| | | |
| | | private StandardProductListService standardProductListService; |
| | | |
| | | @Override |
| | | public List<FactoryDto> selectStandardTreeList() { |
| | | return standardTreeMapper.selectStandardTreeList(); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int addStandardTree(StandardTree standardTree) { |
| | | if(standardTree.getSample()!=null){ |
| | | List<StandardProductList> list = standardTreeMapper.getStandardProductListBySample(standardTree.getSampleType()); |
| | | for (StandardProductList standardProductList : list) { |
| | | List<StandardProductList> productList = standardTreeMapper.getStandardProductListBySample(standardTree.getSampleType()); |
| | | List<StandardMethodList> methodList = standardTreeMapper.getStandardMethodListBySample(standardTree.getSampleType()); |
| | | for (StandardMethodList standardMethod : methodList) { |
| | | standardMethod.setFactory(standardTree.getFactory()); |
| | | standardMethod.setLaboratory(standardTree.getLaboratory()); |
| | | standardMethod.setSampleType(standardTree.getSampleType()); |
| | | standardMethod.setSample(standardTree.getSample()); |
| | | standardMethod.setModel(standardTree.getModel()); |
| | | standardMethodListMapper.insert(standardMethod); |
| | | for (StandardProductList standardProductList : productList) { |
| | | standardProductList.setFactory(standardTree.getFactory()); |
| | | standardProductList.setLaboratory(standardTree.getLaboratory()); |
| | | standardProductList.setSampleType(standardTree.getSampleType()); |
| | | standardProductList.setSample(standardTree.getSample()); |
| | | standardProductList.setModel(standardTree.getModel()); |
| | | standardProductList.setStandardMethodListId(standardMethod.getId()); |
| | | standardProductList.setState(1); |
| | | standardProductList.setId(null); |
| | | standardProductList.setCreateUser(null); |
| | | standardProductList.setCreateTime(null); |
| | | standardProductList.setUpdateUser(null); |
| | | standardProductList.setUpdateTime(null); |
| | | standardProductListMapper.insert(standardProductList); |
| | | } |
| | | } |
| | |
| | | break; |
| | | } |
| | | Map<String, List<?>> listMap = standardMethodListService.selectsStandardMethodByFLSSM(tree); |
| | | if(listMap.get("standardMethodList").size() != 0){ |
| | | if (listMap.get("standardMethodList").size() != 0) { |
| | | for (Object o : listMap.get("standardMethodList")) { |
| | | JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(o)); |
| | | List<StandardProductList> list = standardProductListService.selectStandardProductListByMethodId((Integer) jsonObject.get("id")); |
| | | if(list.size()!=0){ |
| | | standardProductListMapper.deleteBatchIds(list); |
| | | } |
| | | } |
| | | standardMethodListMapper.deleteBatchIds(listMap.get("standardMethodList")); |
| | | } |
| | | if(listMap.get("standardProductList").size() != 0){ |
| | | standardProductListMapper.deleteBatchIds(listMap.get("standardProductList")); |
| | | } |
| | | return 1; |
| | | } |
| | |
| | | standardProductList.setFactory(trees[0]); |
| | | try { |
| | | standardProductList.setLaboratory(trees[1]); |
| | | }catch (Exception e){} |
| | | } catch (Exception e) { |
| | | } |
| | | try { |
| | | standardProductList.setSampleType(trees[2]); |
| | | }catch (Exception e){} |
| | | } catch (Exception e) { |
| | | } |
| | | try { |
| | | standardProductList.setSample(trees[3]); |
| | | }catch (Exception e){} |
| | | } catch (Exception e) { |
| | | } |
| | | try { |
| | | standardProductList.setModel(trees[4]); |
| | | }catch (Exception e){} |
| | | } catch (Exception e) { |
| | | } |
| | | standardProductListMapper.insert(standardProductList); |
| | | } |
| | | return 1; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.yuanchu.mom.mapper.InsOrderTemplateMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.InsOrderTemplate"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="thing" column="thing" jdbcType="VARCHAR"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,name,thing, |
| | | create_user,update_user,create_time, |
| | | update_time |
| | | </sql> |
| | | </mapper> |
| | |
| | | <mapper namespace="com.yuanchu.mom.mapper.InsProductMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.InsProduct"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="inspectionItem" column="inspection_item" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemClassify" column="inspection_item_classify" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemSubclass" column="inspection_item_subclass" jdbcType="VARCHAR"/> |
| | | <result property="factory" column="factory" jdbcType="VARCHAR"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="sampleType" column="sample_type" jdbcType="VARCHAR"/> |
| | | <result property="sample" column="sample" jdbcType="VARCHAR"/> |
| | | <result property="model" column="model" jdbcType="VARCHAR"/> |
| | | <result property="unit" column="unit" jdbcType="VARCHAR"/> |
| | | <result property="price" column="price" jdbcType="DECIMAL"/> |
| | | <result property="manHour" column="man_hour" jdbcType="INTEGER"/> |
| | | <result property="manHourGroup" column="man_hour_group" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemType" column="inspection_item_type" jdbcType="VARCHAR"/> |
| | | <result property="inspectionValueType" column="inspection_value_type" jdbcType="VARCHAR"/> |
| | | <result property="deviceGroup" column="device_group" jdbcType="VARCHAR"/> |
| | | <result property="checkoutNumber" column="checkout_number" jdbcType="INTEGER"/> |
| | | <result property="section" column="section" jdbcType="VARCHAR"/> |
| | | <result property="valueType" column="value_type" jdbcType="VARCHAR"/> |
| | | <result property="method" column="method" jdbcType="VARCHAR"/> |
| | | <result property="manDay" column="man_day" jdbcType="INTEGER"/> |
| | | <result property="bsm" column="bsm" jdbcType="VARCHAR"/> |
| | | <result property="ask" column="ask" jdbcType="VARCHAR"/> |
| | | <result property="state" column="state" jdbcType="INTEGER"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="inspectionItem" column="inspection_item" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemClassify" column="inspection_item_classify" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemSubclass" column="inspection_item_subclass" jdbcType="VARCHAR"/> |
| | | <result property="factory" column="factory" jdbcType="VARCHAR"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="sampleType" column="sample_type" jdbcType="VARCHAR"/> |
| | | <result property="sample" column="sample" jdbcType="VARCHAR"/> |
| | | <result property="model" column="model" jdbcType="VARCHAR"/> |
| | | <result property="sonLaboratory" column="son_laboratory" jdbcType="VARCHAR"/> |
| | | <result property="unit" column="unit" jdbcType="VARCHAR"/> |
| | | <result property="price" column="price" jdbcType="DECIMAL"/> |
| | | <result property="manHour" column="man_hour" jdbcType="DOUBLE"/> |
| | | <result property="manHourGroup" column="man_hour_group" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemType" column="inspection_item_type" jdbcType="VARCHAR"/> |
| | | <result property="inspectionValueType" column="inspection_value_type" jdbcType="VARCHAR"/> |
| | | <result property="deviceGroup" column="device_group" jdbcType="VARCHAR"/> |
| | | <result property="checkoutNumber" column="checkout_number" jdbcType="INTEGER"/> |
| | | <result property="section" column="section" jdbcType="VARCHAR"/> |
| | | <result property="valueType" column="value_type" jdbcType="VARCHAR"/> |
| | | <result property="method" column="method" jdbcType="VARCHAR"/> |
| | | <result property="manDay" column="man_day" jdbcType="INTEGER"/> |
| | | <result property="bsm" column="bsm" jdbcType="VARCHAR"/> |
| | | <result property="ask" column="ask" jdbcType="VARCHAR"/> |
| | | <result property="lastValue" column="last_value" jdbcType="VARCHAR"/> |
| | | <result property="insResult" column="ins_result" jdbcType="INTEGER"/> |
| | | <result property="state" column="state" jdbcType="INTEGER"/> |
| | | <result property="insSampleId" column="ins_sample_id" jdbcType="INTEGER"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="templateId" column="template_id" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,inspection_item,inspection_item_classify, |
| | | inspection_item_subclass,factory,laboratory, |
| | | sample_type,sample,model, |
| | | unit,price,man_hour, |
| | | man_hour_group,inspection_item_type,inspection_value_type, |
| | | device_group,checkout_number,section, |
| | | value_type,method,man_day, |
| | | bsm,ask,state, |
| | | create_user,update_user,create_time, |
| | | update_time |
| | | </sql> |
| | | <select id="selectOrderManDay" resultType="java.lang.Integer"> |
| | | select coalesce(sum(ip.man_day), 0) from ins_sample i |
| | | select coalesce(max(ip.man_day), 0) from ins_sample i |
| | | left join ins_product ip on i.id = ip.ins_sample_id |
| | | where i.id = #{sampleId} |
| | | </select> |
| | |
| | | <mapper namespace="com.yuanchu.mom.mapper.InsSampleMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.InsSample"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="insResult" column="ins_result" jdbcType="INTEGER"/> |
| | | <result property="insOrderId" column="ins_order_id" jdbcType="INTEGER"/> |
| | | <result property="joinModel" column="join_model" jdbcType="VARCHAR"/> |
| | | <result property="joinName" column="join_name" jdbcType="VARCHAR"/> |
| | | <result property="sampleCode" column="sample_code" jdbcType="VARCHAR"/> |
| | | <result property="factory" column="factory" jdbcType="VARCHAR"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="sampleType" column="sample_type" jdbcType="VARCHAR"/> |
| | | <result property="sample" column="sample" jdbcType="VARCHAR"/> |
| | | <result property="model" column="model" jdbcType="VARCHAR"/> |
| | | <result property="isLeave" column="is_leave" jdbcType="INTEGER"/> |
| | | <result property="leaveNum" column="leave_num" jdbcType="INTEGER"/> |
| | | <result property="insProgress" column="ins_progress" jdbcType="VARCHAR"/> |
| | | <result property="insState" column="ins_state" jdbcType="INTEGER"/> |
| | | <result property="sendTime" column="send_time" jdbcType="TIMESTAMP"/> |
| | | <result property="joinNum" column="join_num" jdbcType="INTEGER"/> |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | <result property="appointed" column="appointed" jdbcType="TIMESTAMP"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="insResult" column="ins_result" jdbcType="INTEGER"/> |
| | | <result property="insOrderId" column="ins_order_id" jdbcType="INTEGER"/> |
| | | <result property="joinModel" column="join_model" jdbcType="VARCHAR"/> |
| | | <result property="joinName" column="join_name" jdbcType="VARCHAR"/> |
| | | <result property="sampleCode" column="sample_code" jdbcType="VARCHAR"/> |
| | | <result property="factory" column="factory" jdbcType="VARCHAR"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="sampleType" column="sample_type" jdbcType="VARCHAR"/> |
| | | <result property="sample" column="sample" jdbcType="VARCHAR"/> |
| | | <result property="model" column="model" jdbcType="VARCHAR"/> |
| | | <result property="isLeave" column="is_leave" jdbcType="INTEGER"/> |
| | | <result property="leaveNum" column="leave_num" jdbcType="INTEGER"/> |
| | | <result property="insProgress" column="ins_progress" jdbcType="VARCHAR"/> |
| | | <result property="insState" column="ins_state" jdbcType="INTEGER"/> |
| | | <result property="sendTime" column="send_time" jdbcType="TIMESTAMP"/> |
| | | <result property="joinNum" column="join_num" jdbcType="INTEGER"/> |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | <result property="appointed" column="appointed" jdbcType="TIMESTAMP"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,ins_result,ins_order_id, |
| | | join_model,join_name,sample_code, |
| | | factory,laboratory,sample_type, |
| | | sample,model,is_leave, |
| | | leave_num,ins_progress,ins_state, |
| | | send_time,join_num,remark, |
| | | appointed,create_user,update_user, |
| | | create_time,update_time |
| | | </sql> |
| | | <select id="findInsSampleAndOrder" resultType="com.yuanchu.mom.vo.InsOrderPlanVO"> |
| | | SELECT DISTINCT |
| | | io.entrust_code, |
| | | io.type, |
| | | tempA.id, |
| | | tempA.sample, |
| | | tempA.sample_code, |
| | | tempA.send_time, |
| | | tempA.appointed, |
| | | tempA.ins_state, |
| | | tempA.ins_result, |
| | | tempA.user_id, |
| | | tempA.ins_order_id, |
| | | tempA.sample_user_id, |
| | | ipr.son_laboratory |
| | | io.entrust_code, |
| | | io.type, |
| | | tempA.id, |
| | | tempA.sample, |
| | | tempA.sample_code, |
| | | tempA.send_time, |
| | | tempA.appointed, |
| | | tempA.ins_state, |
| | | tempA.ins_result, |
| | | tempA.user_id, |
| | | tempA.ins_order_id, |
| | | tempA.sample_user_id, |
| | | ipr.son_laboratory |
| | | FROM |
| | | ( |
| | | SELECT |
| | | temp.* |
| | | FROM |
| | | ( |
| | | SELECT |
| | | isa.id, |
| | | isa.sample, |
| | | isa.sample_code, |
| | | isa.send_time, |
| | | isa.appointed, |
| | | isa.ins_state, |
| | | isa.ins_result, |
| | | isu.user_id, |
| | | isa.ins_order_id, |
| | | isu.id as sample_user_id |
| | | FROM |
| | | ins_sample isa |
| | | LEFT JOIN ins_sample_user isu ON isa.id = isu.ins_sample_id |
| | | ) AS temp |
| | | WHERE |
| | | temp.user_id = #{ew.userId} |
| | | OR ( SELECT COUNT(*) FROM ins_sample_user WHERE ins_sample_id = temp.id ) = 0 |
| | | ) AS tempA |
| | | LEFT JOIN ins_order io ON tempA.ins_order_id = io.id |
| | | LEFT JOIN ins_product ipr ON tempA.id = ipr.ins_sample_id |
| | | ( |
| | | SELECT |
| | | temp.* |
| | | FROM |
| | | ( |
| | | SELECT |
| | | isa.id, |
| | | isa.sample, |
| | | isa.sample_code, |
| | | isa.send_time, |
| | | isa.appointed, |
| | | isa.ins_state, |
| | | isa.ins_result, |
| | | isu.user_id, |
| | | isa.ins_order_id, |
| | | isu.id as sample_user_id |
| | | FROM |
| | | ins_sample isa |
| | | LEFT JOIN ins_sample_user isu ON isa.id = isu.ins_sample_id |
| | | ) AS temp |
| | | WHERE |
| | | io.state = #{ew.state} |
| | | AND ipr.state = 1 |
| | | AND ipr.son_laboratory = #{ew.childrenLaboratory} |
| | | <if test="ew.insState!=null and ew.insState!=''"> |
| | | AND tempA.ins_state = #{ew.insState} |
| | | </if> |
| | | <if test="ew.sampleName!=null and ew.sampleName!=''"> |
| | | AND tempA.sample like concat('%',#{ew.sampleName},'%') |
| | | </if> |
| | | <if test="ew.viewSelf==true"> |
| | | AND tempA.sample_user_id is not null |
| | | </if> |
| | | ORDER BY io.type DESC |
| | | temp.user_id = #{ew.userId} |
| | | OR ( SELECT COUNT(*) FROM ins_sample_user WHERE ins_sample_id = temp.id ) = 0 |
| | | ) AS tempA |
| | | LEFT JOIN ins_order io ON tempA.ins_order_id = io.id |
| | | LEFT JOIN ins_product ipr ON tempA.id = ipr.ins_sample_id |
| | | WHERE |
| | | io.state = #{ew.state} |
| | | AND ipr.state = 1 |
| | | AND ipr.son_laboratory = #{ew.childrenLaboratory} |
| | | <if test="ew.insState!=null and ew.insState!=''"> |
| | | AND tempA.ins_state = #{ew.insState} |
| | | </if> |
| | | <if test="ew.sampleName!=null and ew.sampleName!=''"> |
| | | AND tempA.sample like concat('%',#{ew.sampleName},'%') |
| | | </if> |
| | | <if test="ew.viewSelf==true"> |
| | | AND tempA.sample_user_id is not null |
| | | </if> |
| | | ORDER BY io.type DESC,tempA.id |
| | | </select> |
| | | |
| | | <select id="selectSampleProductListByOrderId" resultMap="sampleDto"> |
| | | select isa.*,ip.id, inspection_item, inspection_item_classify, inspection_item_subclass, ip.factory, ip.laboratory, ip.sample_type, ip.sample, ip.model, son_laboratory, unit, price, man_hour, man_hour_group, inspection_item_type, inspection_value_type, device_group, checkout_number, section, value_type, method, man_day, bsm, ask, `last_value`, ip.ins_result, state, ins_sample_id, ip.create_user, ip.update_user, ip.create_time, ip.update_time, template_id |
| | | from ins_sample isa |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | where ins_order_id = #{id} |
| | | </select> |
| | | |
| | | <resultMap id="sampleDto" type="com.yuanchu.mom.dto.SampleProductDto"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="insResult" column="ins_result" jdbcType="INTEGER"/> |
| | | <result property="insOrderId" column="ins_order_id" jdbcType="INTEGER"/> |
| | | <result property="joinModel" column="join_model" jdbcType="VARCHAR"/> |
| | | <result property="joinName" column="join_name" jdbcType="VARCHAR"/> |
| | | <result property="sampleCode" column="sample_code" jdbcType="VARCHAR"/> |
| | | <result property="factory" column="factory" jdbcType="VARCHAR"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="sampleType" column="sample_type" jdbcType="VARCHAR"/> |
| | | <result property="sample" column="sample" jdbcType="VARCHAR"/> |
| | | <result property="model" column="model" jdbcType="VARCHAR"/> |
| | | <result property="isLeave" column="is_leave" jdbcType="INTEGER"/> |
| | | <result property="leaveNum" column="leave_num" jdbcType="INTEGER"/> |
| | | <result property="insProgress" column="ins_progress" jdbcType="VARCHAR"/> |
| | | <result property="insState" column="ins_state" jdbcType="INTEGER"/> |
| | | <result property="sendTime" column="send_time" jdbcType="TIMESTAMP"/> |
| | | <result property="joinNum" column="join_num" jdbcType="INTEGER"/> |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | <result property="appointed" column="appointed" jdbcType="TIMESTAMP"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <collection property="insProduct" resultMap="product"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="product" type="com.yuanchu.mom.pojo.InsProduct"> |
| | | <id property="id" column="ip.id" jdbcType="INTEGER"/> |
| | | <result property="inspectionItem" column="inspection_item" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemClassify" column="inspection_item_classify" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemSubclass" column="inspection_item_subclass" jdbcType="VARCHAR"/> |
| | | <result property="factory" column="ip.factory" jdbcType="VARCHAR"/> |
| | | <result property="laboratory" column="ip.laboratory" jdbcType="VARCHAR"/> |
| | | <result property="sampleType" column="ip.sample_type" jdbcType="VARCHAR"/> |
| | | <result property="sample" column="ip.sample" jdbcType="VARCHAR"/> |
| | | <result property="model" column="ip.model" jdbcType="VARCHAR"/> |
| | | <result property="sonLaboratory" column="son_laboratory" jdbcType="VARCHAR"/> |
| | | <result property="unit" column="unit" jdbcType="VARCHAR"/> |
| | | <result property="price" column="price" jdbcType="DECIMAL"/> |
| | | <result property="manHour" column="man_hour" jdbcType="DOUBLE"/> |
| | | <result property="manHourGroup" column="man_hour_group" jdbcType="VARCHAR"/> |
| | | <result property="inspectionItemType" column="inspection_item_type" jdbcType="VARCHAR"/> |
| | | <result property="inspectionValueType" column="inspection_value_type" jdbcType="VARCHAR"/> |
| | | <result property="deviceGroup" column="device_group" jdbcType="VARCHAR"/> |
| | | <result property="checkoutNumber" column="checkout_number" jdbcType="INTEGER"/> |
| | | <result property="section" column="section" jdbcType="VARCHAR"/> |
| | | <result property="valueType" column="value_type" jdbcType="VARCHAR"/> |
| | | <result property="method" column="method" jdbcType="VARCHAR"/> |
| | | <result property="manDay" column="man_day" jdbcType="INTEGER"/> |
| | | <result property="bsm" column="bsm" jdbcType="VARCHAR"/> |
| | | <result property="ask" column="ask" jdbcType="VARCHAR"/> |
| | | <result property="lastValue" column="last_value" jdbcType="VARCHAR"/> |
| | | <result property="insResult" column="ip.ins_result" jdbcType="INTEGER"/> |
| | | <result property="state" column="state" jdbcType="INTEGER"/> |
| | | <result property="insSampleId" column="ins_sample_id" jdbcType="INTEGER"/> |
| | | <result property="createUser" column="ip.create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="ip.update_user" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="ip.create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="ip.update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="templateId" column="ip.template_id" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | <if test="data5 != null"> |
| | | and model = #{data5} |
| | | </if> |
| | | <if test="data2 == null"> |
| | | and laboratory is null |
| | | </if> |
| | | <if test="data3 == null"> |
| | | and sample_type is null |
| | | </if> |
| | | <if test="data4 == null"> |
| | | and sample is null |
| | | </if> |
| | | <if test="data5 == null"> |
| | | and model is null |
| | | </if> |
| | | </select> |
| | | <select id="selectParameterList" resultType="standardProductList"> |
| | | select |
| | |
| | | </select> |
| | | <select id="getStandardProductListBySample" resultType="com.yuanchu.mom.pojo.StandardProductList"> |
| | | select inspection_item, |
| | | inspection_item_classify, |
| | | inspection_item_subclass, |
| | | laboratory, |
| | | son_laboratory, |
| | |
| | | sample, |
| | | bsm, |
| | | template_id |
| | | from structure_item_parameter |
| | | where sample = #{sample} |
| | | from structure_item_parameter sp |
| | | left join structure_test_object sto on sto.id = sp.sample |
| | | where sto.specimen_name = #{sampleType} |
| | | </select> |
| | | <select id="getStandardMethodListBySample" resultType="com.yuanchu.mom.pojo.StandardMethodList"> |
| | | select sm.code,sm.name,sm.remark from standard_method sm |
| | | left join structure_test_object sto on sm.structure_test_object_id = sto.id |
| | | where sto.specimen_name = #{sampleType} |
| | | </select> |
| | | </mapper> |