forked from xxhjsb/security-knowledge-base
parent
01d12d71dd
commit
2a21bfa0cb
|
@ -8,6 +8,7 @@ import com.hbt.security.knowledge.base.msds.mapper.MsdsMapper;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -37,7 +38,11 @@ public class MsdsDaoImpl implements MsdsDao {
|
|||
*/
|
||||
@Override
|
||||
public Msds selectMsdsByName(String name) {
|
||||
return msdsMapper.selectMsdsByName(name);
|
||||
List<Msds> list = msdsMapper.selectMsdsByName(name);
|
||||
if(CollectionUtils.isEmpty(list)) {
|
||||
return new Msds();
|
||||
}
|
||||
return list.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.util.List;
|
|||
|
||||
import com.hbt.msds.api.domain.Msds;
|
||||
import com.hbt.msds.api.domain.MsdsMaterial;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
@ -28,7 +27,7 @@ public interface MsdsMapper
|
|||
* @param name 化学品名称
|
||||
* @return 化学品安全信息
|
||||
*/
|
||||
Msds selectMsdsByName(String name);
|
||||
List<Msds> selectMsdsByName(String name);
|
||||
|
||||
/**
|
||||
* 查询化学品安全信息列表
|
||||
|
|
|
@ -200,9 +200,9 @@
|
|||
|
||||
|
||||
<select id="selectMsdsByName" parameterType="String" resultMap="MsdsMsdsMaterialResult">
|
||||
select a.id, a.chemical_cn, a.other_chemical_cn, a.chemical_en, a.other_chemical_en, a.cas, a.type, a.detonator_profession1, a.detonator_profession1_concentration, a.detonator_profession1_CAS_No, a.detonator_profession2, a.detonator_profession2_concentration, a.detonator_profession2_CAS_No, a.detonator_profession3, a.detonator_profession3_concentration, a.detonator_profession3_CAS_No, a.detonator_profession4, a.detonator_profession4_concentration, a.detonator_profession4_CAS_No, a.detonator_profession5, a.detonator_profession5_concentration, a.detonator_profession5_CAS_No, a.hazard_category, a.Invasion_route, a.health_hazards, a.environmental_hazards, a.explosion_hazard, a.skin_contact, a.eye_contact, a.inhalation, a.ingestion, a.hazard_characteristics, a.hazardous_combustion_products, a.fire_extinguishing_method, a.fire_fighting, a.emergency_actions, a.operational_considerations, a.storage_precautions, a.MAC, a.PC_TWA, a.PC_STEL, a.TLV_C, a.TLV_TWA, a.TLV_STEL, a.monitoring_methods, a.engineering_control, a.respiratory_protection, a.eye_protection, a.physical_protection, a.hand_protection, a.other_protection, a.appearance_and_shape, a.ph_value, a.melting_point, a.boiling_point, a.relative_density, a.relative_vapor_density, a.saturated_vapor_pressure, a.heat_of_combustion, a.critical, a.critical_pressure, a.octanol_water_partition_coefficient, a.flash_point, a.Ignition_temperature, a.lower_explosion_limit, a.upper_explosion_limit, a.solubility, a.main_uses, a.stability, a.forbidden_mixtures, a.avoid_contact_conditions, a.aggregation_hazards, a.decomposition_products, a.nature_of_waste, a.disposal_methods, a.deprecation_considerations, a.dangerous_goods_number, a.un_number, a.packaging_category, a.packaging_logo, a.packaging_method, a.shipping_precautions, a.regulatory_information, a.critical_value
|
||||
select DISTINCT a.id, a.chemical_cn, a.other_chemical_cn, a.chemical_en, a.other_chemical_en, a.cas, a.type, a.detonator_profession1, a.detonator_profession1_concentration, a.detonator_profession1_CAS_No, a.detonator_profession2, a.detonator_profession2_concentration, a.detonator_profession2_CAS_No, a.detonator_profession3, a.detonator_profession3_concentration, a.detonator_profession3_CAS_No, a.detonator_profession4, a.detonator_profession4_concentration, a.detonator_profession4_CAS_No, a.detonator_profession5, a.detonator_profession5_concentration, a.detonator_profession5_CAS_No, a.hazard_category, a.Invasion_route, a.health_hazards, a.environmental_hazards, a.explosion_hazard, a.skin_contact, a.eye_contact, a.inhalation, a.ingestion, a.hazard_characteristics, a.hazardous_combustion_products, a.fire_extinguishing_method, a.fire_fighting, a.emergency_actions, a.operational_considerations, a.storage_precautions, a.MAC, a.PC_TWA, a.PC_STEL, a.TLV_C, a.TLV_TWA, a.TLV_STEL, a.monitoring_methods, a.engineering_control, a.respiratory_protection, a.eye_protection, a.physical_protection, a.hand_protection, a.other_protection, a.appearance_and_shape, a.ph_value, a.melting_point, a.boiling_point, a.relative_density, a.relative_vapor_density, a.saturated_vapor_pressure, a.heat_of_combustion, a.critical, a.critical_pressure, a.octanol_water_partition_coefficient, a.flash_point, a.Ignition_temperature, a.lower_explosion_limit, a.upper_explosion_limit, a.solubility, a.main_uses, a.stability, a.forbidden_mixtures, a.avoid_contact_conditions, a.aggregation_hazards, a.decomposition_products, a.nature_of_waste, a.disposal_methods, a.deprecation_considerations, a.dangerous_goods_number, a.un_number, a.packaging_category, a.packaging_logo, a.packaging_method, a.shipping_precautions, a.regulatory_information, a.critical_value
|
||||
from msds a
|
||||
where a.chemical_cn = #{name}
|
||||
where a.chemical_cn = #{name} or FIND_IN_SET(#{name} ,REPLACE(a.other_chemical_cn, ';', ',') )
|
||||
</select>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue