|
|
@@ -1,66 +1,94 @@
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<!DOCTYPE mapper
|
|
|
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.zd.laboratory.mapper.AlgorithmMapper">
|
|
|
|
|
|
<select id="queryList" resultType="com.zd.model.entity.AlgorithmVO" parameterType="com.zd.model.entity.AlgorithmVO">
|
|
|
- select la.*,su.nick_name as userName,ls.`name` as subName from lab_algorithm la
|
|
|
- left join lab_subject_access_record lsar
|
|
|
- ON lsar.id = la.sign_id
|
|
|
- left join sys_user su
|
|
|
- on su.user_id= lsar.join_user_id
|
|
|
- left join lab_subject ls
|
|
|
- on ls.id= lsar.subject_id
|
|
|
+ select la.id,la.algorithm_type,la.algorithm_result,la.parse_result,
|
|
|
+ la.parse_result_msg,la.original_img,la.request_code,
|
|
|
+ la.sign_id,la.sub_id,la.create_time,la.status,la.algorithm_name,
|
|
|
+ la.is_alarm,
|
|
|
+ su.nick_name as userName,ls.`name` as subName from lab_algorithm la
|
|
|
+ left join lab_subject_access_record lsar
|
|
|
+ ON lsar.id = la.sign_id
|
|
|
+ left join sys_user su
|
|
|
+ on su.user_id= lsar.join_user_id
|
|
|
+ left join lab_subject ls
|
|
|
+ on ls.id= lsar.subject_id
|
|
|
<where>
|
|
|
- <if test="algorithmType != null "> and a.hardware_id = #{hardwareId}</if>
|
|
|
- <if test="inTime!=null"> and la.create_time BETWEEN #{inTime} AND #{outTime}</if>
|
|
|
- <if test="status!=-1"> and la.status =#{status}</if>
|
|
|
- <if test="isAlarm!=null"> and la.is_alarm =#{isAlarm}</if>
|
|
|
+ <if test="algorithmType != null ">and a.hardware_id = #{hardwareId}</if>
|
|
|
+ <if test="inTime!=null">and la.create_time BETWEEN #{inTime} AND #{outTime}</if>
|
|
|
+ <if test="status!=-1">and la.status =#{status}</if>
|
|
|
+ <if test="isAlarm!=null">and la.is_alarm =#{isAlarm}</if>
|
|
|
</where>
|
|
|
- ORDER BY la.id desc
|
|
|
+ ORDER BY la.id desc
|
|
|
</select>
|
|
|
|
|
|
- <select id="getId" resultType="com.zd.model.entity.Algorithm">
|
|
|
- select * from lab_algorithm where id=#{id}
|
|
|
+ <select id="getId" resultType="com.zd.model.entity.Algorithm">
|
|
|
+ select *
|
|
|
+ from lab_algorithm
|
|
|
+ where id = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <insert id="insertBatchAlgorithm" parameterType="com.zd.model.entity.Algorithm" >
|
|
|
+ <insert id="insertBatchAlgorithm" parameterType="com.zd.model.entity.Algorithm" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into lab_algorithm
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
algorithm_type,
|
|
|
algorithm_result,
|
|
|
original_img,
|
|
|
+ resp_code,
|
|
|
+ resp_data,
|
|
|
parse_result,
|
|
|
parse_result_msg,
|
|
|
sign_id,
|
|
|
is_alarm,
|
|
|
sub_id,
|
|
|
algorithm_name
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
values
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
#{item.algorithmType},
|
|
|
#{item.algorithmResult},
|
|
|
#{item.originalImg},
|
|
|
+ #{item.respCode},
|
|
|
+ #{item.respData},
|
|
|
#{item.parseResult},
|
|
|
#{item.parseResultMsg},
|
|
|
#{item.signId},
|
|
|
#{item.isAlarm},
|
|
|
#{item.subId},
|
|
|
- #{item.algorithmName}
|
|
|
- </trim>
|
|
|
+ #{item.algorithmName}
|
|
|
+ </trim>
|
|
|
</foreach>
|
|
|
|
|
|
</insert>
|
|
|
|
|
|
<update id="update" parameterType="com.zd.model.entity.Algorithm">
|
|
|
- update lab_algorithm set algorithm_type=#{algorithmType},algorithm_name=#{algorithmName} where id=#{id}
|
|
|
+ update lab_algorithm
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="algorithmType != null">algorithm_type = #{algorithmType},</if>
|
|
|
+ <if test="algorithmResult != null">algorithm_result = #{algorithmResult},</if>
|
|
|
+ <if test="parseResult != null">parse_result = #{parseResult},</if>
|
|
|
+ <if test="parseResultMsg != null">parse_result_msg = #{parseResultMsg},</if>
|
|
|
+ <if test="originalImg != null">original_img = #{originalImg},</if>
|
|
|
+ <if test="respCode != null">resp_code = #{respCode},</if>
|
|
|
+ <if test="respData != null">resp_data = #{respData},</if>
|
|
|
+ <if test="signId != null">sign_id = #{signId},</if>
|
|
|
+ <if test="subId != null">sub_id = #{subId},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="algorithmName != null">algorithm_name = #{algorithmName},</if>
|
|
|
+ <if test="isAlarm != null">is_alarm = #{isAlarm},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
- <delete id="del" >
|
|
|
- delete from lab_algorithm where id=#{id}
|
|
|
+ <delete id="del">
|
|
|
+ delete
|
|
|
+ from lab_algorithm
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
</mapper>
|