| | |
| | | WHEN b.product_type < 5 THEN |
| | | 1 * 1 / basic_mtbf_regulate_tmp |
| | | WHEN a.reliab_distrib_type = 1 THEN |
| | | 1 * a.basic_mtbf_operating_ratio / a.basic_mtbf_regulate_tmp |
| | | a.basic_unit_num * a.basic_mtbf_operating_ratio / |
| | | a.basic_mtbf_regulate_tmp |
| | | WHEN a.reliab_distrib_type = 3 THEN |
| | | 1 * a.basic_mtbf_operating_ratio / a.basic_mtbf_regul_succ_rate |
| | | a.basic_unit_num * a.basic_mtbf_operating_ratio / |
| | | a.basic_mtbf_regul_succ_rate |
| | | ELSE 0 END |
| | | ) AS WeightedFailure, |
| | | sum( |
| | |
| | | WHEN b.product_type < 5 THEN |
| | | 1 * 1 * a.repair_mttcr / a.basic_mtbf_regulate_tmp |
| | | WHEN a.repairable = 1 and a.reliab_distrib_type = 1 THEN |
| | | 1 * a.basic_mtbf_operating_ratio * a.repair_mttcr / |
| | | a.basic_unit_num * a.basic_mtbf_operating_ratio * a.repair_mttcr / |
| | | a.basic_mtbf_regulate_tmp |
| | | WHEN a.repairable = 1 and a.reliab_distrib_type = 3 THEN |
| | | 1 * a.basic_mtbf_operating_ratio * a.repair_mttcr / |
| | | a.basic_unit_num * a.basic_mtbf_operating_ratio * a.repair_mttcr / |
| | | a.basic_mtbf_regul_succ_rate |
| | | ELSE 0 |
| | | END |
| | |
| | | ) c |
| | | ) d |
| | | set f.basic_mtbf_regulate_tmp = d.basic_mtbf_regulate_tmp, |
| | | f.repair_mttcr = d.repair_mttcr |
| | | f.repair_mttcr = d.repair_mttcr |
| | | where f.product_id = d.id; |
| | | </update> |
| | | |
| | | <update id="compute1"> |
| | | UPDATE param_data a, product_model b |
| | | SET repair_mttcr = 0 |
| | | where b.ship_id = ${shipId} and repair_mttcr is null; |
| | | where b.ship_id = ${shipId} |
| | | and repair_mttcr is null; |
| | | UPDATE param_data a, product_model b |
| | | SET basic_mtbf_regulate_tmp = basic_mtbf_regulate |
| | | where b.ship_id = ${shipId}; |
| | | UPDATE param_data a, product_model b |
| | | SET basic_mtbf_regulate_tmp = basic_runs_num /basic_mtbf_regul_succ_rate |
| | | where b.ship_id = ${shipId} and reliab_distrib_type = 3 |
| | | SET basic_mtbf_regulate_tmp = basic_runs_num / basic_mtbf_regul_succ_rate |
| | | where b.ship_id = ${shipId} |
| | | and reliab_distrib_type = 3 |
| | | </update> |
| | | |
| | | <update id="compute2"> |
| | | UPDATE param_data a, product_model b |
| | | SET basic_mtbf_regulate = basic_mtbf_regulate_tmp |
| | | where b.ship_id = ${shipId} and (reliab_distrib_type = 1 or reliab_distrib_type is null); |
| | | SET basic_mtbf_regulate = basic_mtbf_regulate_tmp |
| | | where b.ship_id = ${shipId} |
| | | and (reliab_distrib_type = 1 or reliab_distrib_type is null); |
| | | |
| | | UPDATE param_data a, product_model b |
| | | SET ai = basic_mtbf_regulate_tmp / (basic_mtbf_regulate_tmp + repair_mttcr) |