@@ -450,14 +450,15 @@
<result column="tool_code" property="toolCode"/>
<result column="last_test_date" property="lastTestDate"/>
<result column="isok" property="isok"/>
+ <result column="exp_id" property="experimentId"/>
</resultMap>
<select id="listExperimentTool" resultMap="ExpResultMap">
SELECT
- <include refid="Base_Column_List"/>, t1.isok
+ <include refid="Base_Column_List"/>, t1.isok, #{experimentId} as exp_id
FROM base_safety_tool t
left join sec_experiment_tool t1 on t.tool_id = t1.tool_id
- where t1.exp_id=#{expId}
+ where t1.exp_id=#{experimentId}
<where>
t.del_flag='0'
<if test="deptId!=null and deptId!=''">
@@ -115,9 +115,10 @@
<select id="getList" resultMap="listResultMap">
- select e.id,e.state,e.scheduled_time,e.end_time,e.exp_date,e.dept_name,e.lab_name,u.real_name
+ select e.id,e.state,e.scheduled_time,e.end_time,e.exp_date,e.dept_name,e.lab_name,u.real_name, t.c
from sec_experiment e
left join sys_user u on e.create_by = u.user_name
+ left join (select exp_id, count(*) as c from sec_experiment_tool where del_flag = '0' group by exp_id) t on t.exp_id = e.id
e.del_flag = '0'