| | |
| | | </select> |
| | | |
| | | <select id="getSysLaboratoryContainer" parameterType="java.lang.String" resultMap="SysLaboratoryContainer" > |
| | | select su.*,ss.name as laboratoryName, ss.type as laboratoryType ,su.project_id projectId from sys_laboratory_container as su |
| | | select su.*,ss.name as laboratoryName, ss.type as laboratoryType ,su.project project |
| | | from sys_laboratory_container as su |
| | | left join sys_laboratory as ss on su.laboratory_id = ss.id |
| | | where su.id = #{id} and su.valid_flag = 1 |
| | | where su.id = #{id} |
| | | and su.valid_flag = 1 |
| | | and ss.valid_flag = 1 |
| | | </select> |
| | | |
| | | <select id="getSysLaboratoryContainerByContainerCode" parameterType="java.lang.String" resultMap="SysLaboratoryContainer"> |
| | | select * from sys_laboratory_container |
| | | where container_code = #{containerCode} and valid_flag = 1 |
| | | SELECT |
| | | sys_laboratory_container.* |
| | | FROM |
| | | sys_laboratory_container |
| | | LEFT JOIN sys_laboratory on sys_laboratory.id = sys_laboratory_container.laboratory_id |
| | | WHERE |
| | | sys_laboratory_container.container_code = #{containerCode} |
| | | AND sys_laboratory_container.valid_flag = 1 |
| | | AND sys_laboratory.valid_flag = 1 |
| | | </select> |
| | | |
| | | <select id="updateSysLabContainer" parameterType="java.util.Map" > |
| | |
| | | </select> |
| | | |
| | | <select id="getSysLaboratoryContainerList" parameterType="java.util.Map" resultMap="SysLaboratoryContainer"> |
| | | select su.*,ss.name as laboratoryName, ss.type as laboratoryType,sc.controller_name as controllerName,su.project_id as projectId from sys_laboratory_container as su |
| | | select su.*,ss.name as laboratoryName, ss.type as laboratoryType,sc.controller_name as controllerName,su.project as project from sys_laboratory_container as su |
| | | left join sys_laboratory as ss on su.laboratory_id = ss.id |
| | | left join sys_controller sc on sc.controller_code=su.controller_code |
| | | where su.valid_flag = 1 |
| | |
| | | </select> |
| | | |
| | | <insert id="insertSysLaboratoryContainer" parameterType="com.nanometer.smartlab.entity.SysLaboratoryContainer"> |
| | | insert into sys_laboratory_container(id, laboratory_id, type, container_code, info_code, structure, name, valid_flag, character_left, character_right, create_time, update_time, controller_code,project_id) |
| | | values (#{id}, #{laboratoryId}, #{type}, #{containerCode}, #{infoCode}, #{structure}, #{name}, 1, #{characterLeft}, #{characterRight}, now(), now(), #{controllerCode},#{projectId}) |
| | | insert into sys_laboratory_container(id, laboratory_id, type, container_code, info_code, structure, name, valid_flag, character_left, character_right, create_time, update_time, controller_code,project) |
| | | values (#{id}, #{laboratoryId}, #{type}, #{containerCode}, #{infoCode}, #{structure}, #{name}, 1, #{characterLeft}, #{characterRight}, now(), now(), #{controllerCode},#{project}) |
| | | </insert> |
| | | |
| | | <update id="updateSysLaboratoryContainer" parameterType="com.nanometer.smartlab.entity.SysLaboratoryContainer"> |
| | | update sys_laboratory_container set laboratory_id=#{laboratoryId}, type=#{type}, container_code=#{containerCode}, info_code=#{infoCode}, |
| | | structure=#{structure}, name=#{name}, character_left=#{characterLeft}, character_right=#{characterRight},controller_code=#{controllerCode}, |
| | | update_time=now(),project_id = #{projectId} |
| | | update_time=now(),project = #{project} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | |
| | | |
| | | <select id="getContainerPersonInCharge" parameterType="java.lang.String" resultType="java.util.Map"> |
| | | SELECT slc.container_code containCode,su.name name,su.phone phone, |
| | | CONCAT(sl.location1,"-",sl.location2) location |
| | | |
| | | FROM sys_laboratory_container slc |
| | | LEFT JOIN sys_laboratory sl on sl.id = slc.laboratory_id |
| | | LEFT JOIN sys_user su on su.department = sl.department |
| | | LEFT JOIN base_role br on br.id = su.role_id |
| | | WHERE slc.container_code = #{containerCode} |
| | | and su.valid_flag =1 |
| | | and br.`name` = '实验负责人' |
| | | CONCAT(sl.location1,"-",sl.location2) location |
| | | FROM sys_laboratory_container slc |
| | | LEFT JOIN sys_laboratory sl on sl.id = slc.laboratory_id |
| | | LEFT JOIN sys_user su on su.department = sl.department |
| | | LEFT JOIN base_role br on br.id = su.role_id |
| | | WHERE slc.container_code = #{containerCode} |
| | | and su.valid_flag =1 |
| | | and sl.valid_flag =1 |
| | | and br.`name` = '实验负责人' |
| | | </select> |
| | | |
| | | |
| | |
| | | LEFT JOIN sys_laboratory sl on sl.id = slc.laboratory_id |
| | | WHERE slc.container_code = #{containerCode} |
| | | and slc.valid_flag = 1 |
| | | and sl.valid_flag = 1 |
| | | </select> |
| | | |
| | | <select id="selectProjectsByContainerCode" resultType="java.lang.String"> |
| | | SELECT |
| | | slc.project |
| | | FROM |
| | | sys_laboratory_container AS slc |
| | | LEFT JOIN sys_laboratory sl ON sl.id = slc.laboratory_id |
| | | WHERE |
| | | slc.container_code = #{0} |
| | | AND slc.valid_flag = 1 |
| | | AND sl.valid_flag = 1 |
| | | </select> |
| | | </mapper> |