|
|
@@ -424,14 +424,61 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
- <select id="listByExperimentId"
|
|
|
- resultType="com.railway.business.safetool.domain.BaseSafetyTool">
|
|
|
+ <select id="listByExperimentId" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM base_safety_tool t
|
|
|
+ left join sec_experiment_tool t1 on t.tool_id = t1.tool_id
|
|
|
+ where t1.exp_id=#{experimentId}
|
|
|
+ </select>
|
|
|
|
|
|
+ <select id="listByScheduledId" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ FROM base_safety_tool t
|
|
|
+ left join sec_scheduled_tool t1 on t.tool_id = t1.tool_id
|
|
|
+ where t1.scheduled_id=#{scheduledId}
|
|
|
</select>
|
|
|
|
|
|
- <select id="listByScheduledId"
|
|
|
- resultType="com.railway.business.safetool.domain.BaseSafetyTool">
|
|
|
+ <resultMap id="ExpResultMap" type="com.railway.business.safetool.domain.vo.ExpToolVo">
|
|
|
+ <result column="tool_id" property="toolId"/>
|
|
|
+ <result column="dept_id" property="deptId"/>
|
|
|
+ <result column="dept_name" property="deptName"/>
|
|
|
+ <result column="store_place" property="storePlace"/>
|
|
|
+ <result column="tool_name" property="toolName"/>
|
|
|
+ <result column="tool_type" property="toolType"/>
|
|
|
+ <result column="tool_code" property="toolCode"/>
|
|
|
+ <result column="last_test_date" property="lastTestDate"/>
|
|
|
+ <result column="isok" property="isok"/>
|
|
|
+ </resultMap>
|
|
|
|
|
|
+ <select id="listExperimentTool" resultMap="ExpResultMap">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List"/>, t1.isok
|
|
|
+ FROM base_safety_tool t
|
|
|
+ left join sec_experiment_tool t1 on t.tool_id = t1.tool_id
|
|
|
+ where t1.exp_id=#{expId}
|
|
|
+ <where>
|
|
|
+ t.del_flag='0'
|
|
|
+ <if test="deptId!=null and deptId!=''">
|
|
|
+ and t.dept_id=#{deptId}
|
|
|
+ </if>
|
|
|
+ <if test="storePlace!=null and storePlace!=''">
|
|
|
+ and t.store_place like concat(#{storePlace}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="toolName!=null and toolName!=''">
|
|
|
+ and t.tool_name like concat(#{toolName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="toolCode!=null and toolCode!=''">
|
|
|
+ and t.tool_code=#{toolCode}
|
|
|
+ </if>
|
|
|
+ <if test="lastTestDateStart!=null">
|
|
|
+ and t.last_test_date <![CDATA[ >= ]]> #{lastTestDateStart}
|
|
|
+ </if>
|
|
|
+ <if test="lastTestDateEnd!=null">
|
|
|
+ and t.last_test_date <![CDATA[ <= ]]> #{lastTestDateEnd}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|