| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.pojo.StandardTree; |
| | | import com.yuanchu.mom.service.StandardMethodListService; |
| | | import com.yuanchu.mom.service.StandardTreeService; |
| | |
| | | |
| | | @ApiOperation(value = "根据标准树进行标准查询") |
| | | @PostMapping("/selectsStandardMethodByFLSSM") |
| | | public Result selectsStandardMethodByFLSSM(){ |
| | | return Result.success(); |
| | | @ValueAuth |
| | | public Result selectsStandardMethodByFLSSM(String tree){ |
| | | return Result.success(standardMethodListService.selectsStandardMethodByFLSSM(tree)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.yuanchu.mom.pojo.StandardMethodList; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | Map<String, String> selectStandardMethodById(Integer id); |
| | | |
| | | String selectUserById(Integer id); |
| | | |
| | | List<StandardMethodList> selectStandardMethodLists(String data1,String data2,String data3,String data4, String data5); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | @ApiModelProperty("") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | private String createUserName; |
| | | /** |
| | | * |
| | | */ |
| | |
| | | import com.yuanchu.mom.pojo.StandardMethodList; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Administrator |
| | | * @description 针对表【standard_method_list(标准树下的标准列表)】的数据库操作Service |
| | |
| | | |
| | | int addStandardMethodList(Integer standardId, String tree); |
| | | |
| | | List<StandardMethodList> selectsStandardMethodByFLSSM(String tree); |
| | | |
| | | } |
| | |
| | | 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.pojo.StandardMethodList; |
| | | import com.yuanchu.mom.service.StandardMethodListService; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | }catch (Exception e){} |
| | | return standardMethodListMapper.insert(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<StandardMethodList> selectsStandardMethodByFLSSM(String tree) { |
| | | String[] trees = tree.split(" - "); |
| | | List<StandardMethodList> standardMethodLists = null; |
| | | switch (trees.length){ |
| | | case 5: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],trees[3],trees[4]); |
| | | break; |
| | | case 4: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],trees[3],null); |
| | | break; |
| | | case 3: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],null,null); |
| | | break; |
| | | case 2: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],null,null,null); |
| | | break; |
| | | case 1: |
| | | standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],null,null,null,null); |
| | | break; |
| | | } |
| | | return standardMethodLists; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | create_time,update_user,update_time |
| | | </sql> |
| | | <select id="selectStandardMethodById" resultType="java.util.Map"> |
| | | select code,name,remark from standard_method |
| | | select code, name, remark |
| | | from standard_method |
| | | where id = #{id} |
| | | </select> |
| | | <select id="selectUserById" resultType="java.lang.String"> |
| | | select name |
| | | from user |
| | | where id = #{id} |
| | | </select> |
| | | <select id="selectStandardMethodLists" resultType="com.yuanchu.mom.pojo.StandardMethodList"> |
| | | select sml.id, code, sml.name,sml.remark, sml.create_time, u.name create_user_name |
| | | from standard_method_list sml |
| | | left join user u on u.id = sml.create_user |
| | | where factory = #{data1} |
| | | <if test="data2 != null"> |
| | | and laboratory = #{data2} |
| | | </if> |
| | | <if test="data3 != null"> |
| | | and sample_type = #{data3} |
| | | </if> |
| | | <if test="data4 != null"> |
| | | and sample = #{data4} |
| | | </if> |
| | | <if test="data5 != null"> |
| | | and model = #{data5} |
| | | </if> |
| | | </select> |
| | | </mapper> |