Quellcode durchsuchen

新增人员设备关系表逻辑

fllmoyu vor 5 Jahren
Ursprung
Commit
f79dfb5e26

+ 2 - 0
common/src/main/java/com/jpsoft/smart/modules/base/dao/PersonDeviceRelationDAO.java

@@ -25,6 +25,8 @@ public interface PersonDeviceRelationDAO {
 
     List<PersonDeviceRelation> findByIsBoundAndUpdateTime(Date updateTime, Integer limit);
 
+	void updateIsBound(PersonDeviceRelation personDeviceRelation);
+
 //    List<PersonDeviceRelation>  findByPersonId(@Param("personId")Long personId);
 
 

+ 1 - 1
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonDeviceRelationServiceImpl.java

@@ -133,7 +133,7 @@ public class PersonDeviceRelationServiceImpl implements PersonDeviceRelationServ
 		if (personDeviceRelation != null){
 				personDeviceRelation.setIsBound(isBound);
 				personDeviceRelation.setUpdateTime(new Date());
-				personDeviceRelationDAO.update(personDeviceRelation);
+				personDeviceRelationDAO.updateIsBound(personDeviceRelation);
 
 		}
 	}

+ 29 - 0
common/src/main/resources/mapper/base/PersonDeviceRelation.xml

@@ -146,4 +146,33 @@ id_,device_id,person_id,del_flag,create_by,create_time,update_by,update_time		fr
 
 
 </select>
+
+	<update id="updateIsBound" parameterType="com.jpsoft.smart.modules.base.entity.PersonDeviceRelation">
+		update base_person_device_relation
+		<set>
+			<if test="deviceId!=null">
+				device_id=#{deviceId,jdbcType=VARCHAR},
+			</if>
+			<if test="personId!=null">
+				person_id=#{personId,jdbcType=BIGINT},
+			</if>
+			<if test="delFlag!=null">
+				del_flag=#{delFlag,jdbcType= NUMERIC },
+			</if>
+			<if test="createBy!=null">
+				create_by=#{createBy,jdbcType=VARCHAR},
+			</if>
+			<if test="createTime!=null">
+				create_time=#{createTime,jdbcType= TIMESTAMP },
+			</if>
+			<if test="updateBy!=null">
+				update_by=#{updateBy,jdbcType=VARCHAR},
+			</if>
+			<if test="updateTime!=null">
+				update_time=#{updateTime,jdbcType= TIMESTAMP },
+			</if>
+				is_bound=#{isBound,jdbcType= VARCHAR},
+		</set>
+		where id_=#{id}
+	</update>
 </mapper>