zss
2023-08-24 51f607b893f35976627a071d529f7a7681a4291e
chart-server/src/main/resources/mapper/WorkMapper.xml
@@ -3,8 +3,8 @@
<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
@@ -20,7 +20,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) finsh
              from lims_laboratory.inspection_product
                       left join lims_laboratory.user on inspection_product.user_pro_id = user.id
              where state = 1
@@ -41,8 +41,8 @@
    <!--执行人项目数统计-->
    <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
@@ -58,7 +58,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) finsh
              from lims_laboratory.inspection_product
                       left join lims_laboratory.user on inspection_product.user_id = user.id
              where state = 1
@@ -79,8 +79,8 @@
    <!--责任人执行率-->
    <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
@@ -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,8 +122,8 @@
    <!--执行人及时率-->
    <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
@@ -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