<?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> 
 |