Fixiaobai
2023-09-09 e7f7daae5d21ad2988cadd25b6987ca5e7ef8001
chart-server/src/main/resources/mapper/WorkMapper.xml
@@ -3,11 +3,11 @@
<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
              where inspection_product.state = 1
                and test_state is null
                and inspection_product.inspection_material_id in
                    (select id
@@ -20,10 +20,10 @@
                              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
              where inspection_product.state = 1
                and test_state is not null
                and inspection_product.inspection_material_id in
                    (select id
@@ -41,11 +41,11 @@
    <!--执行人项目数统计-->
    <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
              where inspection_product.state = 1
                and test_state is null
                and inspection_product.inspection_material_id in
                    (select id
@@ -58,10 +58,10 @@
                              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
              where inspection_product.state = 1
                and test_state is not null
                and inspection_product.inspection_material_id in
                    (select id
@@ -79,11 +79,11 @@
    <!--责任人执行率-->
    <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
              where inspection_product.state = 1
                and inspection_product.inspection_material_id in
                    (select id
                     from lims_laboratory.inspection_material
@@ -95,7 +95,7 @@
                              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
@@ -122,11 +122,11 @@
    <!--执行人及时率-->
    <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
              where inspection_product.state = 1
                and inspection_product.inspection_material_id in
                    (select id
                     from lims_laboratory.inspection_material
@@ -138,7 +138,7 @@
                              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