检验下单标签打印+标准库枚举筛选+报告生成修改+检验下单委托编号生成
| | |
| | | insProductService.updateInspected(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ValueClassify("æ£éªä¸å") |
| | | @ApiOperation(value = "æ ç¾æå°") |
| | | @PostMapping("/labelPrinting") |
| | | public Result<?> labelPrinting(String ids) { |
| | | return Result.success(insOrderService.labelPrinting(ids)); |
| | | } |
| | | } |
| | |
| | | public Result selectStandardTreeList(){ |
| | | return Result.success(standardTreeService.selectStandardTreeList()); |
| | | } |
| | | |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "æ·»å æ åæ ") |
| | | @PostMapping("/addStandardTree") |
| | |
| | | public Result selectsStandardMethodByFLSSM(String tree){ |
| | | return Result.success(standardMethodListService.selectsStandardMethodByFLSSM(tree)); |
| | | } |
| | | |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "ä¿®æ¹æ ååºä¸çå
容") |
| | | @PostMapping("/upStandardProductList") |
| | |
| | | StandardProductList list = JSON.parseObject(str, StandardProductList.class); |
| | | return Result.success(standardProductListService.upStandardProductList(list)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "å 餿 åæ ä¸çæ£éªæ å") |
| | |
| | | public Result delStandardMethodByFLSSM(Integer id){ |
| | | return Result.success(standardMethodListService.delStandardMethodByFLSSM(id)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "å 餿 åæ ä¸çæ£éªé¡¹ç®") |
| | |
| | | JSONArray lists = JSON.parseArray(ids); |
| | | return Result.success(standardProductListService.delStandardProduct(lists)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ValueClassify("æ ååº") |
| | | @ApiOperation(value = "æ°å¢æ åæ ä¸çæ£éªé¡¹ç®") |
| | |
| | | @ApiOperation(value = "æ¹éç¼è¾æ¥è¯¢æææ£éªé¡¹ç®åæ£éªå项æä¸¾") |
| | | @PostMapping("/selectStandardProductEnumByMethodId") |
| | | @ValueAuth |
| | | public Result selectStandardProductEnumByMethodId(Integer id, String tree){ |
| | | return Result.success(standardProductListService.selectStandardProductEnumByMethodId(id, tree)); |
| | | public Result selectStandardProductEnumByMethodId(Integer id, String tree, String item) { |
| | | return Result.success(standardProductListService.selectStandardProductEnumByMethodId(id, tree, item)); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åæ åæ ä¸æ åæ¹æ³æä¸¾") |
| | |
| | | standardTreeService.resetTreeOfHour(tree, standardId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation("éç½®æ ååºè¦æ±æè¿°åè¦æ±å¼") |
| | | @PostMapping("/resetTreeOfAsk") |
| | | public Result resetTreeOfAsk(String tree, Integer standardId) { |
| | | standardTreeService.resetTreeOfAsk(tree, standardId); |
| | | return Result.success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.dto; |
| | | |
| | | import com.yuanchu.mom.pojo.InsProduct; |
| | | import com.yuanchu.mom.pojo.InsSample; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SampleProductDto3 extends InsSample { |
| | | |
| | | private List<InsProduct> insProduct; |
| | | |
| | | private List<BushingDto> bushing; |
| | | |
| | | private List<SampleProductDto3> childSampleList; |
| | | |
| | | private InsulatingDto insulating; |
| | | |
| | | private SheathDto sheath; |
| | | private String code; |
| | | private String ioSampleType; |
| | | |
| | | private Integer isLeave; |
| | | |
| | | } |
| | |
| | | String getStandardMethodCode(Integer id); |
| | | |
| | | int updateStatus( Integer id); |
| | | |
| | | String selLaboratoryCode(String laboratory); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.dto.InsOrderPlanDTO; |
| | | import com.yuanchu.mom.dto.SampleProductDto; |
| | | import com.yuanchu.mom.dto.SampleProductDto3; |
| | | import com.yuanchu.mom.pojo.InsProduct; |
| | | import com.yuanchu.mom.pojo.InsSample; |
| | | import com.yuanchu.mom.vo.InsOrderPlanTaskSwitchVo; |
| | |
| | | |
| | | List<SampleProductDto> selectSampleProductListByOrderId2(Integer id); |
| | | |
| | | List<SampleProductDto3> selectSampleProductListByOrderId3(List<Integer> ids); |
| | | |
| | | List<SampleProductDto> getInsOrderAndSample(Integer id, String laboratory); |
| | | |
| | | String getSampleEn(String sample); |
| | |
| | | Map<String, Object> selectSampleDefects(Page page, String inspectionItems, String orderNumber); |
| | | |
| | | int updateStatus(Integer id); |
| | | |
| | | List<SampleProductDto3> labelPrinting(String ids); |
| | | } |
| | |
| | | |
| | | IPage<StandardProductList> selectStandardProductByMethodId(Integer id, String tree, Integer page, String laboratory, String item, String items); |
| | | |
| | | Map<String, List<?>> selectStandardProductEnumByMethodId(Integer id, String tree); |
| | | Map<String, List<?>> selectStandardProductEnumByMethodId(Integer id, String tree, String item); |
| | | |
| | | } |
| | |
| | | |
| | | void resetTreeOfHour(String tree, Integer standardId); |
| | | |
| | | void resetTreeOfAsk(String tree, Integer standardId); |
| | | } |
| | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.lang.Console; |
| | | import cn.hutool.core.lang.UUID; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | |
| | | if (p != null && v.get("ps") != null) { |
| | | String value = JSON.parseObject(JSON.toJSONString(v.get("ps"))).get("value") + ""; |
| | | if (value.equals("è¦æ±å¼")) { |
| | | textRenderData.setText(p.getAsk()); |
| | | textRenderData.setText(ObjectUtils.isNotEmpty(p.getTell()) ? p.getTell() : ""); |
| | | } else if (value.equals("åä½")) { |
| | | textRenderData.setText(p.getUnit()); |
| | | } else if (value.equals("ç»è®º")) { |
| | |
| | | textRenderData.setText(a.getSample()); |
| | | } else if (value.equals("è¯éªæ¹æ³")) { |
| | | textRenderData.setText(p.getMethodS()); |
| | | } else if (value.equals("æ£éªé¡¹")) { |
| | | Console.log(p.getInspectionItem() + "\n" + p.getInspectionItemEn()); |
| | | textRenderData.setText(p.getInspectionItem() + "\n" + p.getInspectionItemEn()); |
| | | } else if (value.equals("æ£éªå项")) { |
| | | Console.log(p.getInspectionItemSubclass() + "\n" + p.getInspectionItemSubclassEn()); |
| | | if (ObjectUtils.isEmpty(p.getInspectionItemSubclassEn())) { |
| | | textRenderData.setText(p.getInspectionItemSubclass()); |
| | | } else { |
| | | textRenderData.setText(p.getInspectionItemSubclass() + "\n" + p.getInspectionItemSubclassEn()); |
| | | } |
| | | } else { |
| | | textRenderData.setText(v.get("v") == null ? "" : v.get("v") + ""); |
| | | } |
| | |
| | | cells.add(cellRenderData); |
| | | } else if (j == 1) { |
| | | //第äºå |
| | | textRenderData.setText("å
çº¤è²æ \tScanning Numberâ101"); |
| | | textRenderData.setText("å
çº¤è²æ \nScanning Numberâ101"); |
| | | renderData.add(textRenderData); |
| | | paragraphRenderData.setContents(renderData); |
| | | paragraphRenderDataList.add(paragraphRenderData); |
| | |
| | | if (insProducts1.get((int) (j - 2)).getInspectionItemSubclass().equals("") || insProducts1.get((int) (j - 2)).getInspectionItemSubclass() == null) { |
| | | textRenderData.setText(insProducts1.get((int) (j - 2)).getInspectionItem() + "\n" + insProducts1.get((int) (j - 2)).getInspectionItemEn() + "â" + (j + 101)); |
| | | } else { |
| | | textRenderData.setText(insProducts1.get((int) (j - 2)).getInspectionItemSubclass() + "\n" + insProducts1.get((int) (j - 2)).getInspectionItemSubclassEn()); |
| | | textRenderData.setText(insProducts1.get((int) (j - 2)).getInspectionItemSubclass() + "\n\n" + insProducts1.get((int) (j - 2)).getInspectionItemSubclassEn()); |
| | | } |
| | | renderData.add(textRenderData); |
| | | paragraphRenderData.setContents(renderData); |
| | |
| | | images.add(image); |
| | | }); |
| | | } |
| | | //å§æäººåçµè¯åæ®µå¤æ |
| | | if (ObjectUtils.isEmpty(insOrder.getPrepareUser())) { |
| | | insOrder.setPrepareUser("/"); |
| | | } |
| | | if (ObjectUtils.isEmpty(insOrder.getPhone())) { |
| | | insOrder.setPhone("/"); |
| | | } |
| | | |
| | | XWPFTemplate template = XWPFTemplate.compile(url, builder.build()).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("order", insOrder); |
| | | put("report", insReport); |
| | | put("user", user); |
| | | //put("user", user); |
| | | put("custom", custom); |
| | | put("sampleSize", samples.size()); |
| | | put("tables", tables); |
| | |
| | | import com.yuanchu.mom.utils.QueryWrappers; |
| | | import com.yuanchu.mom.vo.SampleDefectsFatherVo; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.stream.Collectors; |
| | |
| | | public int addInsOrder(List<SampleProductDto> list, InsOrder insOrder, List<List<Integer>> pairing) { |
| | | insOrder.setState(0); |
| | | String code = customMapper.selectById(insOrder.getCompanyId()).getCode2(); |
| | | insOrder.setEntrustCode(giveCode.giveCode("JCZX-" + code + "-", "ins_order", "", "yyMMdd")); |
| | | //insOrder.setEntrustCode(giveCode.giveCode("JCZX-" + code + "-", "ins_order", "", "yyMMdd")); |
| | | String giveCode = this.giveCode.giveCode("JCZX-" + code + "-", "ins_order", "", "yyMMdd"); |
| | | insOrderMapper.insert(insOrder); |
| | | AtomicInteger count = new AtomicInteger(); |
| | | list.forEach(a -> { |
| | |
| | | a.setId(null); |
| | | a.setInsOrderId(insOrder.getId()); |
| | | if (StrUtil.isEmpty(a.getSampleCode())) { |
| | | a.setSampleCode(insOrder.getEntrustCode().split("-")[2]+"-"+count.get()); |
| | | a.setSampleCode(giveCode.split("-")[2] + "-" + count.get()); |
| | | } |
| | | insSampleMapper.insert(a); |
| | | if (ObjectUtil.isNotEmpty(a.getInsProduct())) { |
| | |
| | | b.setInsOrderId(insOrder.getId()); |
| | | b.setParentId(a.getId()); |
| | | if (StrUtil.isEmpty(b.getSampleCode())) { |
| | | b.setSampleCode(giveCode.giveCode("", "ins_sample", "", "yyMMdd")); |
| | | b.setSampleCode(this.giveCode.giveCode("", "ins_sample", "", "yyMMdd")); |
| | | } |
| | | insSampleMapper.insert(b); |
| | | if (ObjectUtil.isNotEmpty(b.getInsProduct())) { |
| | |
| | | }else{ |
| | | for (FibersDto fibersDto : bushingDto.getFibers()) { |
| | | fibersDto.setInsBushingId(bushingDto.getId()); |
| | | fibersDto.setCode(giveCode.giveCode("", "ins_fibers", "", "yyMMdd")); |
| | | fibersDto.setCode(this.giveCode.giveCode("", "ins_fibers", "", "yyMMdd")); |
| | | insFibersMapper.insert(fibersDto); |
| | | for (FiberDto fiberDto : fibersDto.getFiber()) { |
| | | fiberDto.setInsFibersId(fibersDto.getId()); |
| | |
| | | insProduct.setId(null); |
| | | insProduct.setInsSampleId(sample.getId()); |
| | | insProductMapper.insert(insProduct); |
| | | }catch (Exception e){} |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | return insOrder.getId(); |
| | | } |
| | |
| | | @Override |
| | | public int upInsOrderOfState(InsOrder insOrder) { |
| | | insOrder.setExamineTime(LocalDateTime.now()); |
| | | String code = baseMapper.selLaboratoryCode(insOrder.getLaboratory()); |
| | | if (StringUtils.isEmpty(code)) { |
| | | code = ""; |
| | | } |
| | | insOrder.setEntrustCode(giveCode.giveCode("JC/" + code + "-", "ins_order", "", "yyMMdd")); |
| | | return insOrderMapper.updateById(insOrder); |
| | | } |
| | | |
| | |
| | | public int updateStatus(Integer id) { |
| | | return insOrderMapper.updateStatus(id); |
| | | } |
| | | |
| | | //æ ç¾æå° |
| | | @Override |
| | | public List<SampleProductDto3> labelPrinting(String ids) { |
| | | List<Integer> list = Arrays.stream(ids.split(",")).map(Integer::parseInt).collect(Collectors.toList()); |
| | | List<SampleProductDto3> sampleProductDtos = insSampleMapper.selectSampleProductListByOrderId3(list); |
| | | Set<String> processedCodes = new HashSet<>(); |
| | | //妿æ¯å
纤æè
æ¯å
纤带é»è®¤åªæå°ç¬¬ä¸ä¸ª |
| | | List<SampleProductDto3> sampleProductDto3s = sampleProductDtos.stream().filter(sampleProductDto3 -> { |
| | | if (!"å
纤".equals(sampleProductDto3.getIoSampleType()) && !"å
纤带".equals(sampleProductDto3.getIoSampleType())) { |
| | | return true; |
| | | } |
| | | if (processedCodes.contains(sampleProductDto3.getCode())) { |
| | | return false; |
| | | } else { |
| | | processedCodes.add(sampleProductDto3.getCode()); |
| | | return true; |
| | | } |
| | | }).collect(Collectors.toList()); |
| | | return sampleProductDto3s; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | String field1 = o1.getManHourGroup(); |
| | | String field2 = o2.getManHourGroup(); |
| | | |
| | | boolean isEmpty1 = field1 == null || field1.isEmpty(); |
| | | boolean isEmpty2 = field2 == null || field2.isEmpty(); |
| | | |
| | | if (isEmpty1 && isEmpty2) { |
| | | return 0; |
| | | } else if (isEmpty1) { |
| | | return 1; |
| | | } else if (isEmpty2) { |
| | | return -1; |
| | | } else { |
| | | int num1 = extractNumber(field1); |
| | | int num2 = extractNumber(field2); |
| | | |
| | | return Integer.compare(num1, num2); |
| | | } |
| | | }); |
| | | try { |
| | | map.put("productList", list.subList((page - 1) * 50, page * 50)); |
| | |
| | | |
| | | private int extractNumber(String s) { |
| | | // ä»åç¬¦ä¸²ä¸æåæ°åçé»è¾ï¼è¿éåè®¾åæ®µçæ ¼å¼æ¯ "text<number>" |
| | | String number = s.replaceAll("\\D", ""); |
| | | String number = s; |
| | | if (!s.matches("\\d+")) { |
| | | number = s.replaceAll("\\D", ""); |
| | | } |
| | | return Integer.parseInt(number); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<?>> selectStandardProductEnumByMethodId(Integer id, String tree) { |
| | | public Map<String, List<?>> selectStandardProductEnumByMethodId(Integer id, String tree, String item) { |
| | | HashMap<String, List<?>> map = new HashMap<>(); |
| | | map.put("item", standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() |
| | | .eq(StandardProductList::getStandardMethodListId, id) |
| | | .like(StandardProductList::getTree, tree) |
| | | .select(StandardProductList::getInspectionItem) |
| | | .groupBy(StandardProductList::getInspectionItem))); |
| | | if (ObjectUtils.isNotEmpty(item)) { |
| | | map.put("items", standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() |
| | | .eq(StandardProductList::getStandardMethodListId, id) |
| | | .eq(StandardProductList::getInspectionItem, item) |
| | | .like(StandardProductList::getTree, tree) |
| | | .select(StandardProductList::getInspectionItemSubclass) |
| | | .groupBy(StandardProductList::getInspectionItemSubclass))); |
| | | } else { |
| | | map.put("items", standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() |
| | | .eq(StandardProductList::getStandardMethodListId, id) |
| | | .like(StandardProductList::getTree, tree) |
| | | .select(StandardProductList::getInspectionItemSubclass) |
| | | .groupBy(StandardProductList::getInspectionItemSubclass))); |
| | | } |
| | | return map; |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import cn.hutool.core.lang.Console; |
| | | import cn.hutool.poi.excel.ExcelUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | |
| | | str.setLaboratory(laboratory.get()); |
| | | str.setState(1); |
| | | str.setTree(str.getFactory() + " - " + str.getLaboratory() + " - " + str.getSampleType() + " - " + str.getSample() + " - " + (str.getModel() == null?"":str.getModel())); |
| | | try { |
| | | str.setStructureItemParameterId(standardTreeMapper.getStructureItemParameterId("\""+str.getSampleType()+"\"", str.getInspectionItem(), str.getInspectionItemSubclass())); |
| | | } catch (Exception e) { |
| | | Console.log("\"" + str.getSampleType() + "\",\"" + str.getSample() + "\""); |
| | | str.setStructureItemParameterId(standardTreeMapper.getStructureItemParameterId("\"" + str.getSampleType() + "\",\"" + str.getSample() + "\"", str.getInspectionItem(), str.getInspectionItemSubclass())); |
| | | } |
| | | if(str.getStructureItemParameterId() == null){ |
| | | throw new ErrorException("æ£éªé¡¹ç®ä¸åå¨ï¼" + str.getInspectionItem() + " " + str.getInspectionItemSubclass()); |
| | | } |
| | |
| | | public void resetTreeOfHour(String tree, Integer standardId) { |
| | | standardProductListMapper.update(null, Wrappers.<StandardProductList>lambdaUpdate().like(StandardProductList::getTree, tree).eq(StandardProductList::getStandardMethodListId, standardId).set(StandardProductList::getManHour, null)); |
| | | } |
| | | |
| | | @Override |
| | | public void resetTreeOfAsk(String tree, Integer standardId) { |
| | | standardProductListMapper.update(null, Wrappers.<StandardProductList>lambdaUpdate().like(StandardProductList::getTree, tree).eq(StandardProductList::getStandardMethodListId, standardId) |
| | | .set(StandardProductList::getAsk, null) |
| | | .set(StandardProductList::getTell, null) |
| | | .set(StandardProductList::getSection, null) |
| | | .set(StandardProductList::getPrice, null) |
| | | .set(StandardProductList::getManHour, null)); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | <select id="selectSampleAndProductByOrderId" resultType="com.yuanchu.mom.dto.SampleProductDto2"> |
| | | select * |
| | | from ( |
| | | select i.id,isa.sample_code,isa.sample,isa.model,isa.ins_state,ip.state,ip.unit,ip.inspection_item,ip.inspection_item_subclass, |
| | | select |
| | | i.id,isa.sample_code,isa.sample,isa.model,isa.ins_state,ip.state,ip.unit,ip.inspection_item,ip.inspection_item_subclass, |
| | | ip.son_laboratory,ip.inspection_item_type,ip.inspection_value_type,ip.ask,ip.`last_value`,ip.ins_result,ipr.equip_value |
| | | from ins_sample isa |
| | | left join ins_order i on isa.ins_order_id = i.id |
| | |
| | | </if> |
| | | </select> |
| | | <select id="selectDeviceList" resultType="java.util.Map"> |
| | | select device_name,specification_model,management_number,DATE_ADD(date_format(last_calibration_date, '%Y-%m-%d'),INTERVAL calibration_date month) latest_traceability |
| | | select device_name,specification_model,management_number,DATE_ADD(date_format(last_calibration_date, |
| | | '%Y-%m-%d'),INTERVAL calibration_date month) latest_traceability |
| | | from device |
| | | where device.management_number in |
| | | <foreach collection="names" index="index" open="(" separator="," close=")" item="val"> |
| | |
| | | <update id="upInsOrderParameter" parameterType="com.yuanchu.mom.pojo.InsOrder"> |
| | | UPDATE ins_order |
| | | <set> |
| | | <if test="appointed!=null and appointed!='' ">appointed=#{appointed},</if> |
| | | <if test="userId!=null ">user_id=#{userId},</if> |
| | | <if test="createUser!=null ">create_user=#{createUser}</if> |
| | | <if test="otcCode!=null ">otc_code=#{otcCode}</if> |
| | | <if test="code!=null ">code=#{code}</if> |
| | | <if test="custom!=null ">custom=#{custom}</if> |
| | | <if test="updateUser!=null ">update_user=#{updateUser}</if> |
| | | <if test="updateTime!=null ">update_time=#{updateTime}</if> |
| | | <if test="type!=null ">type=#{type}</if> |
| | | <if test="entrustCode!=null ">entrust_code=#{entrustCode}</if> |
| | | <if test="company!=null ">company=#{company}</if> |
| | | <if test="remark!=null ">remark=#{remark}</if> |
| | | <if test="createTime!=null ">create_time=#{createTime}</if> |
| | | <if test="state!=null ">state=#{state}</if> |
| | | <if test="appointed!=null and appointed!='' "> |
| | | appointed=#{appointed}, |
| | | </if> |
| | | <if test="userId!=null "> |
| | | user_id=#{userId}, |
| | | </if> |
| | | <if test="createUser!=null "> |
| | | create_user=#{createUser} |
| | | </if> |
| | | <if test="otcCode!=null "> |
| | | otc_code=#{otcCode} |
| | | </if> |
| | | <if test="code!=null "> |
| | | code=#{code} |
| | | </if> |
| | | <if test="custom!=null "> |
| | | custom=#{custom} |
| | | </if> |
| | | <if test="updateUser!=null "> |
| | | update_user=#{updateUser} |
| | | </if> |
| | | <if test="updateTime!=null "> |
| | | update_time=#{updateTime} |
| | | </if> |
| | | <if test="type!=null "> |
| | | type=#{type} |
| | | </if> |
| | | <if test="entrustCode!=null "> |
| | | entrust_code=#{entrustCode} |
| | | </if> |
| | | <if test="company!=null "> |
| | | company=#{company} |
| | | </if> |
| | | <if test="remark!=null "> |
| | | remark=#{remark} |
| | | </if> |
| | | <if test="createTime!=null "> |
| | | create_time=#{createTime} |
| | | </if> |
| | | <if test="state!=null "> |
| | | state=#{state} |
| | | </if> |
| | | </set> |
| | | <where> |
| | | id=#{id} |
| | |
| | | ) temp |
| | | </select> |
| | | <select id="getEnumLabelByValue" resultType="java.lang.String"> |
| | | select label from `center-lims`.enums |
| | | select label |
| | | from `center-lims`.enums |
| | | where value = #{value} |
| | | </select> |
| | | <select id="getStandardMethodCode" resultType="java.lang.String"> |
| | | select code from `center-lims`.standard_method |
| | | select code |
| | | from `center-lims`.standard_method |
| | | where id = #{id} |
| | | </select> |
| | | <select id="selLaboratoryCode" resultType="java.lang.String"> |
| | | select laboratory_code |
| | | from laboratory |
| | | where laboratory_name = #{laboratory} |
| | | </select> |
| | | </mapper> |
| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <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"/> |
| | |
| | | io.id |
| | | ) a |
| | | LEFT JOIN ins_order_state ios ON ios.ins_order_id = a.id AND ios.laboratory = a.son_laboratory |
| | | left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM ins_sample_user GROUP BY ins_sample_id) md where td.id = md.id and user_id = #{userId}) isu2 on isu2.ins_sample_id = a.id |
| | | left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM |
| | | ins_sample_user GROUP BY ins_sample_id) md where td.id = md.id and user_id = #{userId}) isu2 on |
| | | isu2.ins_sample_id = a.id |
| | | ORDER BY |
| | | a.user_id DESC, |
| | | a.type DESC, |
| | |
| | | io.id |
| | | ) a |
| | | LEFT JOIN ins_order_state ios ON ios.ins_order_id = a.id AND ios.laboratory = a.son_laboratory |
| | | left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM ins_sample_user GROUP BY ins_sample_id) md where td.id = md.id and user_id = #{userId}) isu2 on isu2.ins_sample_id = a.id |
| | | left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM |
| | | ins_sample_user GROUP BY ins_sample_id) md where td.id = md.id and user_id = #{userId}) isu2 on |
| | | isu2.ins_sample_id = a.id |
| | | ORDER BY |
| | | a.user_id DESC, |
| | | a.type DESC, |
| | |
| | | and ins_fibers_id is null |
| | | </select> |
| | | <select id="getSampleEn" resultType="java.lang.String"> |
| | | select name_en from `center-lims`.product |
| | | select name_en |
| | | from `center-lims`.product |
| | | where name = #{sample} |
| | | </select> |
| | | <select id="selectSampleProductListByOrderId2" resultMap="sampleDto"> |
| | |
| | | where ins_order_id = #{id} |
| | | and state = 1 |
| | | </select> |
| | | |
| | | <select id="selectSampleProductListByOrderId3" resultMap="sampleDto3"> |
| | | select isa.id, |
| | | sample_code, |
| | | entrust_code, |
| | | is_leave, |
| | | isa.model, |
| | | isa.ins_state, |
| | | ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_subclass, |
| | | io.sample_type io_sample_type, |
| | | ip.sample ip_sample, |
| | | ip.model ip_model, |
| | | ip.state, |
| | | ins_sample_id |
| | | from ins_sample isa |
| | | left join ins_product ip on isa.id = ip.ins_sample_id |
| | | left join ins_product_result ipr on ip.id = ipr.ins_product_id |
| | | left join ins_order io on io.id = ins_order_id |
| | | where ip.state = 1 |
| | | and ins_order_id in |
| | | <foreach collection="ids" open="(" close=")" item="id" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="getInsProduct1" resultMap="product"> |
| | | select ip.id ip_id, |
| | | inspection_item, |
| | |
| | | <collection property="insProductResult" resultMap="insProductResult"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="sampleDto3" type="com.yuanchu.mom.dto.SampleProductDto3"> |
| | | <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="ioSampleType" column="io_sample_type" jdbcType="VARCHAR"/> |
| | | <result property="code" column="entrust_code" jdbcType="VARCHAR"/> |
| | | <result property="isLeave" column="is_leave" 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="insState" column="ins_state" jdbcType="INTEGER"/> |
| | | <result property="joinNum" column="join_num" jdbcType="INTEGER"/> |
| | | <result property="remark" column="remark" 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"/> |
| | | <result property="standardMethodListId" column="standard_method_list_id"/> |
| | | <result property="unit" column="unit"/> |
| | | <collection property="insProduct" resultMap="product"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="insProductResult" type="com.yuanchu.mom.pojo.InsProductResult"> |
| | | <result property="insValue" column="ins_value" jdbcType="VARCHAR"/> |
| | | <result property="comValue" column="com_value" jdbcType="VARCHAR"/> |