xyc
2024-11-18 2d6c0d1cffe663b3b37ef7e0575cfe6e11d8fd85
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?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.zt.life.modules.mainPart.basicInfo.dao.StatisticsDao">
 
    <select id="getTaskReliabList" resultType="com.zt.life.modules.mainPart.basicInfo.model.TaskReliabData">
        SELECT
            a.name,
            count(distinct b.id) AS taskNum,
            count(distinct c.id) AS operatConNum,
            count(distinct d.id) AS modelNum,
            count(distinct e.id) AS simulatNum,
            count(distinct f.id) AS testData,
            count(distinct g.id) AS assessNum
        FROM product_model a
                 left join task b on  b.product_id = a.id and b.IS_DELETE=0
                 left join operat_condit c on  c.product_id = a.id and c.IS_DELETE=0
                 left join  model_rbd d on  d.ship_id = a.id and d.IS_DELETE=0
                 left join  simulat_assess e on e.product_id = a.id and e.IS_DELETE=0
                 left join  assess_item f on f.product_id = a.id and f.IS_DELETE=0
                 left join  assess_result g on g.product_id = a.id and g.IS_DELETE=0
        where a.product_type = 2 and a.IS_DELETE =0
        group by a.id,a.name
        order by a.name
    </select>
    <select id="getBaseReliabList" resultType="com.zt.life.modules.mainPart.basicInfo.model.BaseReliabData">
        SELECT
            a.name,
            count(distinct b.id) AS xtNum,
            count(distinct c.id) AS sbNum,
            d.basic_mtbf_regulate AS mtbf,
            d.repair_mttcr AS mttr,
            d.ai AS availability
        FROM product_model a
                 left join (SELECT id,ship_id FROM product_model WHERE product_type=3 and IS_DELETE=0) b on  b.ship_id = a.id
                 left join (SELECT id,ship_id FROM product_model WHERE product_type=5 and IS_DELETE=0) c on  c.ship_id = a.id
                 left join param_data d on d.product_id = a.id and d.is_delete =0
        where a.product_type = 2 and a.IS_DELETE =0
        group by a.id,a.name
        order by a.name
    </select>
    <select id="getPlanMakeNum" resultType="java.lang.Integer">
        SELECT num FROM `test_scheme` WHERE id = 10000
    </select>
    <select id="getLoginNum" resultType="java.lang.Integer">
        SELECT count(*) FROM sys_log_login WHERE operation = 0 and status = 1
    </select>
</mapper>