| | |
| | | <mapper namespace="com.yuanchu.limslaboratory.mapper.WorkMapper"> |
| | | <!--è´£ä»»äººé¡¹ç®æ°ç»è®¡--> |
| | | <select id="dutyMater" resultType="java.util.Map"> |
| | | select n.name, æªå®æ, 已宿 |
| | | from (select distinct user.name, count(inspection_product.id) 'æªå®æ' |
| | | select n.name, unfinish, finsh |
| | | from (select distinct user.name, count(inspection_product.id) unfinish |
| | | from lims_laboratory.inspection_product |
| | | left join lims_laboratory.user on inspection_product.user_pro_id = user.id |
| | | where state = 1 |
| | |
| | | and type = #{type} |
| | | and start_time between #{startTime} and #{endTime})) |
| | | group by user.name) n, |
| | | (select distinct user.name, count(inspection_product.id) '已宿' |
| | | (select distinct user.name, count(inspection_product.id) finsh |
| | | from lims_laboratory.inspection_product |
| | | left join lims_laboratory.user on inspection_product.user_pro_id = user.id |
| | | where state = 1 |
| | |
| | | |
| | | <!--æ§è¡äººé¡¹ç®æ°ç»è®¡--> |
| | | <select id="executeMater" resultType="java.util.Map"> |
| | | select n.name, æªå®æ, 已宿 |
| | | from (select distinct user.name, count(inspection_product.id) 'æªå®æ' |
| | | select n.name, unfinsh, finsh |
| | | from (select distinct user.name, count(inspection_product.id) unfinsh |
| | | from lims_laboratory.inspection_product |
| | | left join lims_laboratory.user on inspection_product.user_id = user.id |
| | | where state = 1 |
| | |
| | | and type = #{type} |
| | | and start_time between #{startTime} and #{endTime})) |
| | | group by user.name) n, |
| | | (select distinct user.name, count(inspection_product.id) '已宿' |
| | | (select distinct user.name, count(inspection_product.id) finsh |
| | | from lims_laboratory.inspection_product |
| | | left join lims_laboratory.user on inspection_product.user_id = user.id |
| | | where state = 1 |
| | |
| | | |
| | | <!--责任人æ§è¡ç--> |
| | | <select id="dutytimely" resultType="java.util.Map"> |
| | | select n.name, é¡¹ç®æ»æ°, åæ¶å®ææ° / é¡¹ç®æ»æ° * 100 'åæ¶ç' |
| | | from (select distinct user.name, count(inspection_product.id) 'é¡¹ç®æ»æ°' |
| | | select n.name, total, finshByTime / total * 100 timely |
| | | from (select distinct user.name, count(inspection_product.id) total |
| | | from lims_laboratory.inspection_product |
| | | left join lims_laboratory.user on inspection_product.user_pro_id = user.id |
| | | where state = 1 |
| | |
| | | and type = #{type} |
| | | and start_time between #{startTime} and #{endTime})) |
| | | group by user.name) n, |
| | | (select distinct user.name, count(inspection_product.id) '忶宿æ°' |
| | | (select distinct user.name, count(inspection_product.id) finshByTime |
| | | from lims_laboratory.inspection_product |
| | | left join lims_laboratory.user |
| | | on inspection_product.user_pro_id = user.id |
| | |
| | | |
| | | <!--æ§è¡äººåæ¶ç--> |
| | | <select id="executetimely" resultType="java.util.Map"> |
| | | select n.name, é¡¹ç®æ»æ°, åæ¶å®ææ° / é¡¹ç®æ»æ° * 100 'åæ¶ç' |
| | | from (select distinct user.name, count(inspection_product.id) 'é¡¹ç®æ»æ°' |
| | | select n.name, total, finshByTime / total * 100 timely |
| | | from (select distinct user.name, count(inspection_product.id) total |
| | | from lims_laboratory.inspection_product |
| | | left join lims_laboratory.user on inspection_product.user_id = user.id |
| | | where state = 1 |
| | |
| | | and type = #{type} |
| | | and start_time between #{startTime} and #{endTime})) |
| | | group by user.name) n, |
| | | (select distinct user.name, count(inspection_product.id) '忶宿æ°' |
| | | (select distinct user.name, count(inspection_product.id) finshByTime |
| | | from lims_laboratory.inspection_product |
| | | left join lims_laboratory.user |
| | | on inspection_product.user_id = user.id |
| | |
| | | <?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.InspectionProductMapper"> |
| | | |
| | | |
| | | <!--æ ¹æ®æ£éªåidæ¥è¯¢æ£éªé¡¹ç®çæ£éªç»æ--> |
| | | <select id="getresult" resultType="java.lang.Integer"> |
| | | select test_state |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.limslaboratory.service.WaitInformationService; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * æçå¾
å表(WaitInformation)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-24 10:00:21 |
| | | */ |
| | | @Api(tags = "æ¶æ¯å¾
å-->æçå¾
å") |
| | | @RestController |
| | | @RequestMapping("/waitInformation") |
| | | public class WaitInformationController { |
| | | |
| | | @Autowired |
| | | private WaitInformationService waitInformationService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢å¾
å表å表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "countSize", value = "æ¡æ°/页", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "title", value = "æ é¢", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "text", value = "å
容", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "type", value = "ç¶æ(为空=å
¨é¨)", dataTypeClass = Integer.class) |
| | | }) |
| | | @GetMapping("/selectWaitInforList") |
| | | public Result selectWaitInforList(@RequestHeader("token") String token,int pageSize, int countSize, String title, String text, Integer type) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | IPage<Map<String, Object>> waitInformationPage = waitInformationService.selectWaitInforList(new Page<Object>(pageSize, countSize),unmarshal.get("name").toString(), title, text, type); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", waitInformationPage.getTotal()); |
| | | map.put("row", waitInformationPage.getRecords()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "å¾
åid", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @GetMapping("/delAllWaitInfor") |
| | | public Result delAllWaitInfor(@RequestHeader("token") String token,String ids) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | waitInformationService.delAllWaitInfor(unmarshal.get("name").toString(),ids); |
| | | return Result.success("å 餿å!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éæ 为已读") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "å¾
åid", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @GetMapping("/writeAllWaitInfor") |
| | | public Result writeAllWaitInfor(@RequestHeader("token") String token,String ids) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | waitInformationService.writeAllWaitInfor(unmarshal.get("name").toString(),ids); |
| | | return Result.success("已读æå"); |
| | | } |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.WaitInformation; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æçå¾
å表(WaitInformation)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-24 10:00:21 |
| | | */ |
| | | public interface WaitInformationMapper extends BaseMapper<WaitInformation> { |
| | | |
| | | //æ¥è¯¢å¾
å表å表 |
| | | IPage<Map<String, Object>> selectWaitInforList(Page<Object> page,String rename, String title, String text,Integer type); |
| | | |
| | | //æ¹éå é¤ |
| | | void delAllWaitInfor(String rename,String ids); |
| | | |
| | | //æ¹é已读 |
| | | void writeAllWaitInfor(String rename,String ids); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * æçå¾
å表(WaitInformation)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-24 10:00:22 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Builder |
| | | @TableName("wait_information") |
| | | public class WaitInformation implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * å件人 |
| | | **/ |
| | | private String name; |
| | | |
| | | /** |
| | | * å件人 |
| | | **/ |
| | | private String rename; |
| | | |
| | | /** |
| | | * æ é¢ |
| | | **/ |
| | | private String title; |
| | | |
| | | /** |
| | | * å¾
åå
容 |
| | | **/ |
| | | private String text; |
| | | |
| | | /** |
| | | * ç¶æ 0:æªè¯»;1:已读 |
| | | **/ |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.WaitInformation; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æçå¾
å表(WaitInformation)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-24 10:00:22 |
| | | */ |
| | | public interface WaitInformationService extends IService<WaitInformation> { |
| | | |
| | | |
| | | /** |
| | | * æ·»å å¾
å |
| | | * @param name |
| | | * @param title |
| | | * @param text |
| | | */ |
| | | //todo:æ·»å å¾
åæ¶æ¯ |
| | | void addWaitInfor(String name,String title,String text,String rename); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢å¾
å表å表 |
| | | * @param page |
| | | * @param title |
| | | * @param text |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectWaitInforList(Page<Object> page,String rename, String title, String text,Integer type); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllWaitInfor(String rename,String ids); |
| | | |
| | | |
| | | /** |
| | | * æ¹é已读 |
| | | * @param ids |
| | | */ |
| | | void writeAllWaitInfor(String rename,String ids); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.mapper.WaitInformationMapper; |
| | | import com.yuanchu.limslaboratory.pojo.WaitInformation; |
| | | import com.yuanchu.limslaboratory.service.WaitInformationService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æçå¾
å表(WaitInformation)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-24 10:00:22 |
| | | */ |
| | | @Service |
| | | public class WaitInformationServiceImpl extends ServiceImpl<WaitInformationMapper, WaitInformation> implements WaitInformationService { |
| | | |
| | | @Resource |
| | | WaitInformationMapper waitInformationMapper; |
| | | |
| | | |
| | | //æ·»å å¾
å |
| | | @Override |
| | | public void addWaitInfor(String name, String title, String text, String rename) { |
| | | WaitInformation waitInformation = WaitInformation.builder() |
| | | .name(name) |
| | | .title(title) |
| | | .text(text) |
| | | .rename(rename) |
| | | .build(); |
| | | waitInformationMapper.insert(waitInformation); |
| | | } |
| | | |
| | | //æ¥è¯¢å¾
å表å表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectWaitInforList(Page<Object> page, String rename, String title, String text, Integer type) { |
| | | return waitInformationMapper.selectWaitInforList(page, rename, title, text, type); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | public void delAllWaitInfor(String rename, String ids) { |
| | | waitInformationMapper.delAllWaitInfor(rename, ids); |
| | | } |
| | | |
| | | //æ¹é已读 |
| | | @Override |
| | | public void writeAllWaitInfor(String rename, String ids) { |
| | | waitInformationMapper.writeAllWaitInfor(rename, ids); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.WaitInformationMapper"> |
| | | <!--æ¥è¯¢å¾
å表å表--> |
| | | <select id="selectWaitInforList" resultType="java.util.Map"> |
| | | select id, |
| | | name, |
| | | title, |
| | | text, |
| | | DATE_FORMAT(create_time,'%Y-%m-%d') creatTime, |
| | | type |
| | | from lims_laboratory.wait_information |
| | | where state=1 |
| | | and `rename`=#{rename} |
| | | <if test="title!=null and title!=''"> |
| | | and title like concat('%',#{title},'%') |
| | | </if> |
| | | <if test="text!=null and text!=''"> |
| | | and text like concat('%',#{text},'%') |
| | | </if> |
| | | <if test="type!=null "> |
| | | and type =#{type} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--æ¹éå é¤--> |
| | | <update id="delAllWaitInfor"> |
| | | update lims_laboratory.wait_information |
| | | set state=0 |
| | | where `rename`=#{rename} |
| | | and id in (${ids}) |
| | | </update> |
| | | |
| | | <!--æ¹é已读--> |
| | | <update id="writeAllWaitInfor"> |
| | | update lims_laboratory.wait_information |
| | | set type=1 |
| | | where wait_information.state = 1 |
| | | and `rename`=#{rename} |
| | | and id in (${ids}) |
| | | </update> |
| | | </mapper> |