| | |
| | | return Result.success(inspectionService.selectAllInspection(pageSize, countSize, state)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æ£éªåéé¢çç©æä¿¡æ¯") |
| | | @ApiOperation("æ¥è¯¢æ£éªåéé¢çæ ·åä¿¡æ¯") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionId", value = "æ¥æ£åID", dataTypeClass = String.class, required = true), |
| | | }) |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterialList; |
| | | import com.yuanchu.limslaboratory.service.InspectionMaterialListService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | InspectionMaterialListService inspectionMaterialListService; |
| | | |
| | | @Resource |
| | | InspectionMapper inspectionMapper; |
| | | |
| | | @ApiOperation("æ·»å æ£éªåä¸çæ£éªæ ·å") |
| | | @PostMapping("/addInspectionMaterialList") |
| | | public Result addInspectionMaterialList(@RequestHeader("X-Token") String token, @RequestBody InspectionMaterialList inspectionMaterialList) throws Exception { |
| | | //妿æ£éªåå·²ä½åº,ç¶æä¸º0,åæ æ³æ·»å æ ·å |
| | | Inspection inspection = inspectionMapper.selectById(inspectionMaterialList.getInspectionId()); |
| | | if (inspection.getState()==0) { |
| | | return Result.fail("æ£éªåå·²ä½åºæ æ³æ·»å æ£éªæ ·å"); |
| | | } |
| | | else { |
| | | inspectionMaterialList.setState(1); |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | return Result.success(inspectionMaterialListService.addInspectionMaterialList(inspectionMaterialList, "" + unmarshal.get("id"))); |
| | | inspectionMaterialListService.addInspectionMaterialList(inspectionMaterialList, "" + unmarshal.get("id")); |
| | | return Result.success(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("å 餿 ·å") |
| | |
| | | }) |
| | | @PostMapping("/delInspectionMaterialList") |
| | | public Result delInspectionMaterialList(int inspectionMaterialListId) { |
| | | return Result.success(inspectionMaterialListService.delInspectionMaterialListByInsId(inspectionMaterialListId)); |
| | | inspectionMaterialListService.delInspectionMaterialListByInsId(inspectionMaterialListId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®Idæ¥è¯¢æ ·åä¿¡æ¯") |
| | | @ApiOperation("æ ¹æ®æ ·åIdæ¥è¯¢æ ·åä¿¡æ¯") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "inspectionMaterialListId", value = "æ ·åID", dataTypeClass = Integer.class, required = true), |
| | | }) |
| | |
| | | }) |
| | | @PutMapping("/updateInspectionMaterialList/{inspectionMaterialListId}") |
| | | public Result updateInspectionMaterialList(@PathVariable Integer inspectionMaterialListId, @RequestBody InspectionMaterialList inspectionMaterialList) { |
| | | return Result.success(inspectionMaterialListService.updateInspectionMaterialList(inspectionMaterialListId, inspectionMaterialList)); |
| | | inspectionMaterialListService.updateInspectionMaterialList(inspectionMaterialListId, inspectionMaterialList); |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.User; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductListService; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | */ |
| | | @Api(tags = "æ£éªæ¨¡å-->åé
计å-->æ£éªé¡¹ç®") |
| | | @Api(tags = "æ£éªæ¨¡å-->æ£éªæ ·å-->æ£éªé¡¹ç®") |
| | | @RestController |
| | | @RequestMapping("/inspection-product-list") |
| | | public class InspectionProductListController { |
| | | |
| | | @Resource |
| | | UserService userService; |
| | | |
| | | @Resource |
| | | InspectionProductListService inspectionProductListService; |
| | | |
| | | @ApiOperation("æ¥è¯¢è¯éªåä¿¡æ¯") |
| | | @GetMapping("/selectUser") |
| | |
| | | public Result selectUserById(Integer id) { |
| | | return Result.success(userService.selectByUserId(id)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®æ£éªè®¡åæ ·åidæ¥è¯¢æ£éªé¡¹ç®") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ ·åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectProductById/{id}") |
| | | public Result selectProductById(@PathVariable Integer id) { |
| | | return Result.success(inspectionProductListService.selectProductById(id)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | return Result.success(planService.selectAllPlan(pageSize, countSize, state)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æ£éªè®¡åéé¢çæ£éªé¡¹ç®") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ ·åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectProductById/{id}") |
| | | public Result selectProductById(@PathVariable Integer id) { |
| | | return Result.success(planService.selectProductById(id)); |
| | | } |
| | | |
| | | @ApiOperation("åé
æ£éªè®¡åä¸åé
项ç®") |
| | | @PostMapping("/upPlan") |
| | | public Result upPlan(@RequestBody InspectionProductList inspectionProductList) { |
| | | planService.upPlan(inspectionProductList); |
| | | public Result upPlan(@RequestBody InspectionProductListDto inspectionProductListDto) { |
| | | planService.upPlan(inspectionProductListDto); |
| | | return Result.success(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("ä½åºæ£éªè®¡å") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "æ£éªè®¡åID", dataTypeClass = Integer.class, required = true), |
| | |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductListService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | |
| | | */ |
| | | public interface InspectionProductListMapper extends BaseMapper<InspectionProductList> { |
| | | |
| | | //æ·»å æ£éªé¡¹ç® |
| | | int addInspectionProductList(List<InspectionProductList> list); |
| | | |
| | | //æ ¹æ®æ ·åidæ¥è¯¢æ£éªé¡¹ç® |
| | | List<InspectionProductList> selectByMaterId(Integer id); |
| | | //æ ¹æ®æ ·åidæ¥è¯¢æ£éªè®¡åæ ·åéé¢çæ£éªé¡¹ç® |
| | | List<InspectionProductListDto> selectByMaterId(Integer id); |
| | | } |
| | |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.yuanchu.limslaboratory.pojo.dto.PlanDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.PlanVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public interface PlanMapper extends BaseMapper<Plan> { |
| | | |
| | | //æ¥è¯¢æææ£éªè®¡ååé
|
| | | Map selectAllPlan(int pageSize, int countSize, Integer state); |
| | | List<PlanVo> selectAllPlan(int pageSize, int countSize, Integer state); |
| | | |
| | | //æ¥è¯¢æåæ£éª |
| | | List<PlanDto> selectInspection(int pageSize, int countSize, Integer state); |
| | |
| | | |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty(value = "å
³è æ¥æ£id") |
| | | @ApiModelProperty(value = "å
³è æ¥æ£ç©æid") |
| | | private int inspectionMaterialListId; |
| | | |
| | | @ApiModelProperty(value = "å
³è ç¨æ·id è¯éªå") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "å
³è 设å¤id") |
| | | private Integer instrument_id; |
| | | private Integer instrumentId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "å
³è ç¨æ·id(è´è´£äººid)") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty(value = "å
³è 设å¤id") |
| | | private Integer deviceId; |
| | | |
| | | } |
| | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class InspectionDto extends Inspection implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-17 |
| | | */ |
| | | //åé
计å |
| | | @Data |
| | | public class InspectionProductListDto implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "æ¥æ£æ ·åid") |
| | | @JsonSerialize |
| | | private int inspectionMaterialListId; |
| | | |
| | | @ApiModelProperty(value = "é¡¹ç®æ£éªå¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "é¡¹ç®æ£éªç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "项ç®åç§°") |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "è¯éªæ¹æ³") |
| | | @JsonSerialize |
| | | private String method; |
| | | |
| | | @ApiModelProperty(value = "è¯éªè¦æ±") |
| | | @JsonSerialize |
| | | private String ask; |
| | | |
| | | @ApiModelProperty(value = "åä½") |
| | | @JsonSerialize |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "ææ äººè¦æ±å¼") |
| | | @JsonSerialize |
| | | private String required; |
| | | |
| | | @ApiModelProperty(value = "å
æ§å¼") |
| | | @JsonSerialize |
| | | private String internal; |
| | | |
| | | @ApiModelProperty(value = "è¯éªåè¯éªå¼å§æ¥æ", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date inspectStartTime; |
| | | |
| | | @ApiModelProperty(value = "è¯éªåè¯éªç»ææ¥æ", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date inspectEndTime; |
| | | |
| | | @ApiModelProperty(value = "æ£éªé¡¹ç®è¯éªå") |
| | | @JsonSerialize |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "å
³è 设å¤å") |
| | | @JsonSerialize |
| | | private String instrumentName; |
| | | } |
| | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class InspectionRecordsDto implements Serializable { |
| | | |
| | | //æ£æµé¡¹ç® |
| | | |
| | | @ApiModelProperty(value = "æ£æµé¡¹ç®") |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | //è¯éªå |
| | | @ApiModelProperty(value = "è¯éªå") |
| | | @JsonSerialize |
| | | private String userName; |
| | | |
| | | //è¯éªå¼å§æ¥æ |
| | | @ApiModelProperty(value = "è¯éªå¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime startTime; |
| | | |
| | | //è¯éªç»ææ¥æ |
| | | @ApiModelProperty(value = "è¯éªç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime endTime; |
| | | |
| | | //è¯éªæ¹æ³ |
| | | @ApiModelProperty(value = "è¯éªæ¹æ³") |
| | | @JsonSerialize |
| | | private String method; |
| | | |
| | | //è¯éªè¦æ± |
| | | @ApiModelProperty(value = "è¯éªè¦æ±") |
| | | @JsonSerialize |
| | | private String ask; |
| | | |
| | | //æ ·åç¼å· |
| | | @ApiModelProperty(value = "æ ·åç¼å·") |
| | | @JsonSerialize |
| | | private int mid; |
| | | |
| | | //æ ·ååç§° |
| | | @ApiModelProperty(value = "æ ·ååç§°") |
| | | @JsonSerialize |
| | | private String materialName; |
| | | |
| | | //è§æ ¼åå· |
| | | @ApiModelProperty(value = "è§æ ¼åå·") |
| | | @JsonSerialize |
| | | private String specificationsSerialNumber; |
| | | |
| | | //æ ·åæ°é |
| | | @ApiModelProperty(value = "æ ·åæ°é") |
| | | @JsonSerialize |
| | | private Integer materialNum; |
| | | } |
| | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | //æåæ£éª |
| | | @Data |
| | | public class PlanDto implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "计åç¼å·") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | //æ£éªè®¡ååé
|
| | | @Data |
| | | public class PlanVo implements Serializable { |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ ·åç¼å·") |
| | | @JsonSerialize |
| | | private Integer mid; |
| | | |
| | | @ApiModelProperty(value = "æ¥æ£åç¼å·") |
| | | @JsonSerialize |
| | | private String inspectionId; |
| | | |
| | | @ApiModelProperty(value = "宿æ
åµ 1ï¼å¾
认é¢ï¼2ï¼å¾
åé
ï¼3ï¼å·²åé
ï¼4ï¼è¶
æå¾
åé
ï¼5ï¼å·²å®æï¼0ï¼å·²ä½åº") |
| | | @JsonSerialize |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "ç»è®°æ¥æ", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "è¯éªè´è´£äºº") |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "æ ·ååç§°") |
| | | @JsonSerialize |
| | | private String materialName; |
| | | |
| | | @ApiModelProperty(value = "è§æ ¼åå·") |
| | | @JsonSerialize |
| | | private String specificationsSerialNumber; |
| | | |
| | | @ApiModelProperty(value = "ç©æç¼å·") |
| | | @JsonSerialize |
| | | private String materialId; |
| | | |
| | | @ApiModelProperty(value = "æ¥æº") |
| | | @JsonSerialize |
| | | private String materialSupplier; |
| | | |
| | | @ApiModelProperty(value = "项ç®è¯éªå¼å§æ¥æ", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | |
| | | @ApiModelProperty(value = "项ç®è¯éªç»ææ¥æ", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | |
| | | @ApiModelProperty(value = "è¯éªç»è®º") |
| | | @JsonSerialize |
| | | private String results; |
| | | |
| | | @ApiModelProperty(value = "对象ä½ç½®") |
| | | @JsonSerialize |
| | | private String materialLocation; |
| | | |
| | | @ApiModelProperty(value = "æ£æµçç¥") |
| | | @JsonSerialize |
| | | private String method; |
| | | |
| | | @ApiModelProperty(value = "æ¹æ¬¡") |
| | | @JsonSerialize |
| | | private String materialBatch; |
| | | |
| | | @ApiModelProperty(value = "çå·") |
| | | @JsonSerialize |
| | | private String materialReelNumber; |
| | | |
| | | @ApiModelProperty(value = "æ ·åæ°é") |
| | | @JsonSerialize |
| | | private String materialNum; |
| | | |
| | | } |
| | |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | InspectionMaterialList addInspectionMaterialList(InspectionMaterialList inspectionMaterialList,String userId); |
| | | void addInspectionMaterialList(InspectionMaterialList inspectionMaterialList,String userId); |
| | | |
| | | /** |
| | | * æ ¹æ®æ£éªæ ·åidå 餿 ·åä¿¡æ¯ |
| | | * @param inspectionMaterialListId |
| | | * @return |
| | | */ |
| | | boolean delInspectionMaterialListByInsId(int inspectionMaterialListId); |
| | | void delInspectionMaterialListByInsId(int inspectionMaterialListId); |
| | | |
| | | /** |
| | | *æ ¹æ®æ ·åidä¿®æ¹æ ·åä¿¡æ¯ |
| | |
| | | * @param inspectionMaterialList |
| | | * @return |
| | | */ |
| | | boolean updateInspectionMaterialList( Integer inspectionMaterialListId,InspectionMaterialList inspectionMaterialList); |
| | | void updateInspectionMaterialList( Integer inspectionMaterialListId,InspectionMaterialList inspectionMaterialList); |
| | | } |
| | |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface InspectionProductListService extends IService<InspectionProductList> { |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®æ£éªæ ·åidå 餿 ·åéçæ£éªé¡¹ç® |
| | | * @param inspectionMaterialListId |
| | | * æ ¹æ®æ ·åidæ¥è¯¢æ£éªè®¡åæ ·åéé¢çæ£éªé¡¹ç® |
| | | * @param id |
| | | * @return |
| | | */ |
| | | int delInspectionProductList(int inspectionMaterialListId); |
| | | List<InspectionProductListDto> selectProductById(Integer id); |
| | | |
| | | |
| | | } |
| | |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.PlanDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.PlanVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | * @param state |
| | | * @return |
| | | */ |
| | | Map selectAllPlan(int pageSize, int countSize, Integer state); |
| | | List<PlanVo> selectAllPlan(int pageSize, int countSize, Integer state); |
| | | |
| | | /** |
| | | * æ ¹æ®è®¡åidä½åºæ£éªè®¡å |
| | |
| | | */ |
| | | boolean delPlan(Integer id); |
| | | |
| | | /** |
| | | * æ ¹æ®æ ·åidæ¥è¯¢æ£éªè®¡åé颿£éªé¡¹ç® |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<InspectionProductList> selectProductById(Integer id); |
| | | |
| | | |
| | | /** |
| | | * ç»æ£éªè®¡åä¸çæ£éªé¡¹ç®åé
è¯éªå,设å¤,以忥æ |
| | | * @param inspectionProductList |
| | | */ |
| | | void upPlan(InspectionProductList inspectionProductList); |
| | | void upPlan(InspectionProductListDto inspectionProductListDto); |
| | | |
| | | /** |
| | | * æ¥è¯¢æåæ£éª |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMaterialListMapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductListMapper; |
| | | import com.yuanchu.limslaboratory.mapper.PlanMapper; |
| | | import com.yuanchu.limslaboratory.mapper.ProductMapper; |
| | | import com.yuanchu.limslaboratory.mapper.*; |
| | | import com.yuanchu.limslaboratory.pojo.*; |
| | | import com.yuanchu.limslaboratory.service.InspectionMaterialListService; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductListService; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Resource |
| | | InspectionProductListService inspectionProductListService; |
| | | |
| | | @Resource |
| | | InspectionProductListMapper inspectionProductListMapper; |
| | | |
| | | //æ¥è¯¢æ£éªåéé¢çç©æä¿¡æ¯ |
| | | @Override |
| | |
| | | //æ·»å æ£éªåä¸çæ£éªæ ·å |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public InspectionMaterialList addInspectionMaterialList(InspectionMaterialList inspectionMaterialList,String userId) { |
| | | int judge = inspectionMaterialListMapper.insert(inspectionMaterialList); |
| | | public void addInspectionMaterialList(InspectionMaterialList inspectionMaterialList, String userId) { |
| | | inspectionMaterialListMapper.insert(inspectionMaterialList); |
| | | List<Product> list = productMapper.selectProductByMaterialId(inspectionMaterialList.getMaterialId()); |
| | | List<InspectionProductList> list1 = new ArrayList<>(); |
| | | list.forEach(a-> { |
| | |
| | | list1.add(inspectionProductList); |
| | | }); |
| | | //æ·»å æ£éªé¡¹ç® |
| | | int judge2 = inspectionProductListMapper.addInspectionProductList(list1); |
| | | return judge>0&&judge2>0?inspectionMaterialList:null; |
| | | inspectionProductListService.saveBatch(list1); |
| | | } |
| | | |
| | | //æ ¹æ®æ ·åidå 餿£éªæ ·å |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean delInspectionMaterialListByInsId(int inspectionMaterialListId) { |
| | | public void delInspectionMaterialListByInsId(int inspectionMaterialListId) { |
| | | //å 餿£éªæ ·å |
| | | InspectionMaterialList list = new InspectionMaterialList(); |
| | | list.setState(0); |
| | | list.setId(inspectionMaterialListId); |
| | | int judge1 = inspectionMaterialListMapper.updateById(list); |
| | | inspectionMaterialListMapper.updateById(list); |
| | | //æ ¹æ®æ ·åidå 餿£éªæ ·åä¸çæ£éªé¡¹ç® |
| | | int judge2 = inspectionProductListService.delInspectionProductList(inspectionMaterialListId); |
| | | return judge1>0&&judge2>0; |
| | | UpdateWrapper<InspectionProductList> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("inspection_material_list_id", inspectionMaterialListId).set("state", 0); |
| | | inspectionProductListService.update(new InspectionProductList(), wrapper); |
| | | } |
| | | |
| | | //æ ¹æ®æ ·åidä¿®æ¹æ ·åä¿¡æ¯ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateInspectionMaterialList( Integer inspectionMaterialListId,InspectionMaterialList inspectionMaterialList) { |
| | | public void updateInspectionMaterialList(Integer inspectionMaterialListId, InspectionMaterialList inspectionMaterialList) { |
| | | LambdaUpdateWrapper<InspectionMaterialList> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(InspectionMaterialList::getId,inspectionMaterialListId); |
| | | int judge = inspectionMaterialListMapper.update(inspectionMaterialList, updateWrapper); |
| | | return judge>0; |
| | | inspectionMaterialListMapper.update(inspectionMaterialList, updateWrapper); |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductListMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductListService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | |
| | | |
| | | //æ ¹æ®æ£éªæ ·åidå 餿 ·åéçæ£éªé¡¹ç® |
| | | //æ ¹æ®æ ·åidæ¥è¯¢æ£éªè®¡åæ ·åéé¢çæ£éªé¡¹ç® |
| | | @Override |
| | | public int delInspectionProductList(int inspectionMaterialListId) { |
| | | UpdateWrapper<InspectionProductList> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("inspectionMaterialListId", inspectionMaterialListId).set("state", 0); |
| | | return inspectionProductListMapper.update(new InspectionProductList(),wrapper); |
| | | public List<InspectionProductListDto> selectProductById(Integer id) { |
| | | return inspectionProductListMapper.selectByMaterId(id); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMaterialListMapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductListMapper; |
| | | import com.yuanchu.limslaboratory.mapper.PlanMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterialList; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionDto; |
| | | import com.yuanchu.limslaboratory.service.InspectionProductListService; |
| | | import com.yuanchu.limslaboratory.service.InspectionService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | @Resource |
| | | InspectionMaterialListMapper inspectionMaterialListMapper; |
| | | |
| | | @Resource |
| | | InspectionProductListMapper inspectionProductListMapper; |
| | | |
| | | //æ·»å æ£éªç³è¯·å |
| | | @Override |
| | | public Inspection addInspection(String userName,int type) { |
| | |
| | | Inspection inspection = inspectionMapper.selectById(inspectionId); |
| | | inspection.setState(0); |
| | | int judge1 = inspectionMapper.updateById(inspection); |
| | | //æ£éªè®¡åä½åº |
| | | UpdateWrapper<Plan> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("inspection_id", inspectionId).set("state", 0); |
| | | planMapper.update(new Plan(),updateWrapper ); |
| | | //æ£éªæ ·åä½åº(æ ¹æ®æ¥æ£åidå 餿 ·åä¿¡æ¯) |
| | | UpdateWrapper<InspectionMaterialList> wrapper = new UpdateWrapper<>(); |
| | | wrapper.eq("inspection_id", inspectionId).set("state", 0); |
| | | int judge2 = inspectionMaterialListMapper.update(new InspectionMaterialList(),wrapper); |
| | | UpdateWrapper<InspectionMaterialList> wrapper1 = new UpdateWrapper<>(); |
| | | wrapper1.eq("inspection_id", inspectionId).set("state", 0); |
| | | int judge2 = inspectionMaterialListMapper.update(new InspectionMaterialList(), wrapper1); |
| | | return judge1>0&&judge2>0; |
| | | //æ£éªæ ·åä¸çæ£éªé¡¹ç®ä½åº |
| | | //æ¥åºæ£éªæ ·åid |
| | | |
| | | } |
| | | |
| | | //æäº¤ç³è¯·æ£éªå |
| | |
| | | inspection.setState(2); |
| | | int judge = inspectionMapper.updateById(inspection); |
| | | //计å表æ°å¢ |
| | | Plan plan = Plan.builder().inspectionId(inspectionId).state(1).build(); |
| | | Plan plan = Plan.builder().inspectionId(inspectionId).state(1).userId(inspection.getInspectUserId()).createTime(new Date()).build(); |
| | | planMapper.insert(plan); |
| | | return judge>0; |
| | | } |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionMaterialListMapper; |
| | | import com.yuanchu.limslaboratory.mapper.InspectionProductListMapper; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionMaterialList; |
| | | import com.yuanchu.limslaboratory.pojo.InspectionProductList; |
| | | import com.yuanchu.limslaboratory.pojo.Plan; |
| | | import com.yuanchu.limslaboratory.mapper.PlanMapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.limslaboratory.mapper.*; |
| | | import com.yuanchu.limslaboratory.pojo.*; |
| | | import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.PlanDto; |
| | | import com.yuanchu.limslaboratory.pojo.vo.PlanVo; |
| | | import com.yuanchu.limslaboratory.service.PlanService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | InspectionProductListMapper inspectionProductListMapper; |
| | | |
| | | @Resource |
| | | InspectionMaterialListMapper inspectionMaterialListMapper; |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Resource |
| | | InstrumentMapper instrumentMapper; |
| | | |
| | | //æ¥è¯¢æææ£éªè®¡ååé
|
| | | @Override |
| | | public Map selectAllPlan(int pageSize, int countSize, Integer state) { |
| | | public List<PlanVo> selectAllPlan(int pageSize, int countSize, Integer state) { |
| | | if (state == null) { |
| | | state = 2; |
| | | } |
| | |
| | | return judge > 0; |
| | | } |
| | | |
| | | //æ ¹æ®æ ·åidæ¥è¯¢æ£éªè®¡åéé¢çæ£éªé¡¹ç® |
| | | //ä¿®æ¹(åé
)æ£éªè®¡åéåé
计åçä¿¡æ¯ |
| | | @Override |
| | | public List<InspectionProductList> selectProductById(Integer id) { |
| | | return inspectionProductListMapper.selectByMaterId(id); |
| | | } |
| | | public void upPlan(InspectionProductListDto inspectionProductListDto) { |
| | | /*æ´æ°è®¡å表ä¸çç¶æ(3:å·²åé
),æ´æ°æ¶é´*/ |
| | | //æ¥è¯¢æ¥æ£åid |
| | | InspectionMaterialList inspectionMaterialList = inspectionMaterialListMapper.selectById(inspectionProductListDto.getInspectionMaterialListId()); |
| | | LambdaQueryWrapper<Plan> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Plan::getInspectionId, inspectionMaterialList.getInspectionId()); |
| | | Plan plan = planMapper.selectOne(queryWrapper); |
| | | plan.setState(3).setUpdateTime(new Date()); |
| | | //æ ¹æ®æ¥æ£åidè¿è¡æ´æ°è®¡å表 |
| | | LambdaUpdateWrapper<Plan> updateWrapper1 = new LambdaUpdateWrapper<>(); |
| | | updateWrapper1.eq(Plan::getInspectionId, plan.getInspectionId()); |
| | | planMapper.update(plan, updateWrapper1); |
| | | |
| | | //ä¿®æ¹æ£éªè®¡åéåé
计åçä¿¡æ¯ |
| | | @Override |
| | | public void upPlan(InspectionProductList inspectionProductList) { |
| | | LambdaUpdateWrapper<InspectionProductList> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(InspectionProductList::getInspectionMaterialListId, inspectionProductList.getInspectionMaterialListId()) |
| | | .eq(InspectionProductList::getMethod, inspectionProductList.getMethod()); |
| | | inspectionProductListMapper.update(inspectionProductList, updateWrapper); |
| | | /*æ´æ°æ£éªé¡¹ç®è¡¨ä¸çé¡¹ç®æ£éªå¼å§æ¥æ,é¡¹ç®æ£éªç»ææ¥æ,项ç®è¯éªå,è¯éªè¦æ±,æ´æ°æ¶é´,设å¤id*/ |
| | | InspectionProductList inspectionProductList = new InspectionProductList(); |
| | | //å¤å¶ä¹å,inspectionProductListéé¢æé¡¹ç®æ£éªå¼å§ãç»ææ¥æ,项ç®åç§°,è¯éªæ¹æ³,è¯éªè¦æ±,åä½, |
| | | BeanUtils.copyProperties(inspectionProductListDto, inspectionProductList); |
| | | //æ ¹æ®è®¾å¤åè·å设å¤id |
| | | LambdaQueryWrapper<Instrument> wrapper1 = new LambdaQueryWrapper<>(); |
| | | wrapper1.eq(Instrument::getEquipmentName, inspectionProductListDto.getInstrumentName()); |
| | | Instrument instrument = instrumentMapper.selectOne(wrapper1); |
| | | //æ ¹æ®ç¨æ·åè·åç¨æ·id |
| | | LambdaQueryWrapper<User> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(User::getName, inspectionProductListDto.getUserName()); |
| | | User user = userMapper.selectOne(wrapper2); |
| | | inspectionProductList.setUpdateTime(new Date()).setUserId(user.getId()).setInstrumentId(instrument.getId()); |
| | | //æ ¹æ®æ¥æ£æ ·åidå项ç®åç§°è¿è¡æ´æ°æ£éªé¡¹ç®è¡¨ |
| | | LambdaUpdateWrapper<InspectionProductList> updateWrapper2 = new LambdaUpdateWrapper<>(); |
| | | updateWrapper2.eq(InspectionProductList::getInspectionMaterialListId, inspectionProductList.getInspectionMaterialListId()) |
| | | .eq(InspectionProductList::getName, inspectionProductList.getName()); |
| | | inspectionProductListMapper.update(inspectionProductList, updateWrapper2); |
| | | } |
| | | |
| | | //æ¥è¯¢æåæ£éª |
| | |
| | | <?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.limslaboratory.mapper.InspectionProductListMapper"> |
| | | <insert id="addInspectionProductList"> |
| | | INSERT INTO inspection_product_list (name, method, ask, unit, required, internal, create_time, |
| | | update_time,inspection_material_list_id, user_id) VALUES |
| | | <foreach collection="list" separator="," item="i"> |
| | | (#{i.name}, #{i.method}, #{i.ask}, #{i.unit}, #{i.required}, #{i.internal}, #{i.createTime}, |
| | | #{i.updateTime}, #{i.inspectionMaterialListId}, |
| | | #{i.userId}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <select id="selectByMaterId" resultType="com.yuanchu.limslaboratory.pojo.InspectionProductList"> |
| | | select id, |
| | | name, |
| | | <select id="selectByMaterId" resultType="com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto"> |
| | | select inspection_material_list_id, |
| | | inspect_start_time inspectStartTime, |
| | | inspect_end_time inspectEndTime, |
| | | ipl.name, |
| | | method, |
| | | ask, |
| | | unit, |
| | |
| | | internal, |
| | | start_time, |
| | | end_time, |
| | | state, |
| | | create_time, |
| | | update_time, |
| | | version, |
| | | inspection_material_list_id, |
| | | user_id, |
| | | instrument_id |
| | | from lims_laboratory.inspection_product_list |
| | | user.name userName, |
| | | equipment_name instrumentName |
| | | from lims_laboratory.inspection_product_list ipl |
| | | join lims_laboratory.inspection_material_list iml on iml.id = ipl.inspection_material_list_id |
| | | join lims_laboratory.inspection i on i.id = iml.inspection_id |
| | | join lims_laboratory.user on ipl.user_id = user.id |
| | | join lims_laboratory.instrument on ipl.instrument_id = instrument.id |
| | | where inspection_material_list_id = #{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | <?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.limslaboratory.mapper.PlanMapper"> |
| | | <select id="selectAllPlan" resultType="Map"> |
| | | select p.id,results,p.state,p.create_time,p.inspection_id,user_id,results,type,user_name |
| | | from lims_laboratory.plan p left join lims_laboratory.inspection i |
| | | on i.id=p.inspection_id |
| | | <select id="selectAllPlan" resultType="com.yuanchu.limslaboratory.pojo.vo.PlanVo"> |
| | | select mid , |
| | | p.inspection_id , |
| | | state , |
| | | create_time , |
| | | name , |
| | | material_name , |
| | | specifications_serial_number , |
| | | material_id , |
| | | material_supplier , |
| | | start_time , |
| | | end_time , |
| | | results , |
| | | material_location , |
| | | method , |
| | | material_batch , |
| | | material_reel_number , |
| | | material_num |
| | | from (select plan.user_id, plan.state, plan.create_time, plan.results, plan.inspection_id, name |
| | | from lims_laboratory.plan |
| | | join lims_laboratory.user u on plan.user_id = u.id) p |
| | | left join (select iml.id mid, |
| | | iml.specifications_serial_number, |
| | | iml.material_id, |
| | | iml.material_supplier, |
| | | ipl.start_time, |
| | | ipl.end_time, |
| | | iml.material_location, |
| | | iml.material_name, |
| | | ipl.method, |
| | | iml.material_batch, |
| | | iml.material_reel_number, |
| | | iml.material_num, |
| | | iml.inspection_id |
| | | from lims_laboratory.inspection_material_list iml |
| | | left join lims_laboratory.inspection_product_list ipl on iml.id = ipl.inspection_material_list_id) il |
| | | on p.inspection_id = il.inspection_id |
| | | <if test="state!=null"> |
| | | where p.state = #{state} |
| | | where state = #{state} |
| | | </if> |
| | | order by p.create_time desc |
| | | limit #{pageSize},#{countSize} |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.Instrument; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-20 |
| | | */ |
| | | @Mapper |
| | | public interface InstrumentMapper extends BaseMapper<Instrument> { |
| | | |
| | | IPage<Map<String, Object>> getListInstrumentInformation(Integer conditions,Boolean whetherWhether, String numberOrNameOrSpecifications, Integer classifyId, Page<Objects> page); |
| | |
| | | public interface MaterialMapper extends BaseMapper<Material> { |
| | | |
| | | //æ¥è¯¢ç©æä¿¡æ¯ |
| | | List<Material> selectMaterialLimit(int num1,int num2); |
| | | List<Map> selectMaterialLimit(int num1,int num2); |
| | | |
| | | //æ ¹æ®ç©æidæ¥è¯¢ç©æä¿¡æ¯ |
| | | Map selectMaterialById(String materialId); |
| | |
| | | * @param countSize |
| | | * @return |
| | | */ |
| | | List<Material> selectMaterialLimit(int pageSize,int countSize); |
| | | List<Map> selectMaterialLimit(int pageSize,int countSize); |
| | | |
| | | Integer addMaterialInformation(Material material); |
| | | |
| | |
| | | List<String> specificationsIdDeleteMaterial(List<Integer> deleteSpecificationsId); |
| | | |
| | | /** |
| | | * æ ¹æ®ç©æidæ¥è¯¢ç©æµ |
| | | * æ ¹æ®ç©æidæ¥è¯¢ç©æ |
| | | * @param materialId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | //æ¥è¯¢ç©æä¿¡æ¯ |
| | | @Override |
| | | public List<Material> selectMaterialLimit(int pageSize, int countSize) { |
| | | public List<Map> selectMaterialLimit(int pageSize, int countSize) { |
| | | return materialMapper.selectMaterialLimit((pageSize - 1) * countSize,pageSize * countSize); |
| | | } |
| | | |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.limslaboratory.mapper.MaterialMapper"> |
| | | |
| | | <select id="selectMaterialLimit" resultType="com.yuanchu.limslaboratory.pojo.Material"> |
| | | <select id="selectMaterialLimit" resultType="Map"> |
| | | select id, name |
| | | from material |
| | | from lims_laboratory.material |
| | | where state = 1 |
| | | order by create_time desc |
| | | limit #{num1},#{num2} |
| | | </select> |
| | | <select id="selectMaterialById" resultType="java.util.Map"> |
| | | <select id="selectMaterialById" resultType="Map"> |
| | | select m.id, |
| | | m.num, |
| | | m.supplier, |
| | |
| | | s.cross_section crossSection, |
| | | s.number_of_cores numberOfCores, |
| | | s.instruct |
| | | from material m, |
| | | specifications s, |
| | | serial_number sn |
| | | from lims_laboratory.material m, |
| | | lims_laboratory.specifications s, |
| | | lims_laboratory.serial_number sn |
| | | where m.specifications_id = s.id |
| | | and s.serial_id = sn.id |
| | | and m.id=#{materialId} |
| | | </select> |
| | | </mapper> |