@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace= "com.ruoyi.business.mapper.HwDeviceModeMapper" >
<resultMap type= "HwDeviceMode" id= "HwDeviceModeResult" >
<result property= "deviceModeId" column= "device_mode_id" />
<result property= "deviceModeName" column= "device_mode_name" />
@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property= "deviceModeStatus" column= "device_mode_status" />
<result property= "commonFlag" column= "common_flag" />
<result property= "modeClassfication" column= "mode_classfication" />
<result property= "modeType" column= "mode_type" />
<result property= "deviceModePic" column= "device_mode_pic" />
<result property= "dataVerifyLevel" column= "data_verify_level" />
<result property= "remark" column= "remark" />
@ -69,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id= "selectHwDeviceModeVo" >
select device_mode_id, device_mode_name, tenant_id, scene_id, language_code, gps_flag, device_mode_status, common_flag, mode_classfication, device_mode_pic, data_verify_level, remark, create_by, create_time, update_by, update_time, device_mode_field from hw_device_mode hdm
select device_mode_id, device_mode_name, tenant_id, scene_id, language_code, gps_flag, device_mode_status, common_flag, mode_classfication,mode_type, device_mode_pic, data_verify_level, remark, create_by, create_time, update_by, update_time, device_mode_field from hw_device_mode hdm
</sql>
<sql id= "selectHwDeviceModeParameterVo" >
@ -78,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id= "selectHwDeviceModeList" parameterType= "HwDeviceMode" resultMap= "HwDeviceModeResult" >
<include refid= "selectHwDeviceModeVo" />
<where >
<where >
<if test= "deviceModeName != null and deviceModeName != ''" > and device_mode_name like concat('%', #{deviceModeName}, '%')</if>
<if test= "tenantId != null " > and tenant_id = #{tenantId}</if>
<if test= "sceneId != null " > and scene_id = #{sceneId}</if>
@ -86,7 +87,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "gpsFlag != null and gpsFlag != ''" > and gps_flag = #{gpsFlag}</if>
<if test= "deviceModeStatus != null and deviceModeStatus != ''" > and device_mode_status = #{deviceModeStatus}</if>
<if test= "commonFlag != null and commonFlag != ''" > and common_flag = #{commonFlag}</if>
<if test= "modeClassfication != null " > and mode_classfication = #{modeClassfication}</if>
<if test= "modeClassfication != null and modeClassfication != ''" > and mode_classfication = #{modeClassfication}</if>
<if test= "modeType != null and modeType != ''" > and mode_type = #{modeType}</if>
<if test= "deviceModePic != null and deviceModePic != ''" > and device_mode_pic = #{deviceModePic}</if>
<if test= "dataVerifyLevel != null and dataVerifyLevel != ''" > and data_verify_level = #{dataVerifyLevel}</if>
<if test= "deviceModeField != null and deviceModeField != ''" > and device_mode_field = #{deviceModeField}</if>
@ -95,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by device_mode_id desc
</select>
<select id= "selectHwDeviceModeByDeviceModeId" parameterType= "Long" resultMap= "HwDeviceModeHwDeviceModeFunctionResult" >
select a.device_mode_id, a.device_mode_name, a.tenant_id, a.scene_id, a.language_code, a.gps_flag, a.device_mode_status, a.common_flag, a.mode_classfication, a.device_mode_pic, a.data_verify_level, a.remark, a.create_by, a.create_time, a.update_by, a.update_time, a.device_mode_field,
b.mode_function_id as sub_mode_function_id, b.device_mode_id as sub_device_mode_id, b.function_mode as sub_function_mode, b.coordinate as sub_coordinate, b.function_name as sub_function_name, b.function_identifier as sub_function_identifier, b.function_type as sub_function_type, b.data_type as sub_data_type, b.data_definition as sub_data_definition, b.function_formula as sub_function_formula, b.property_unit as sub_property_unit, b.display_flag as sub_display_flag, b.rw_flag as sub_rw_flag, b.invoke_method as sub_invoke_method, b.event_type as sub_event_type, b.remark as sub_remark, b.acquisition_formula as sub_acquisition_formula, b.order_flag as sub_order_flag, b.device_register as sub_device_register, b.property_step as sub_property_step, b.property_field as sub_property_field
@ -103,7 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join hw_device_mode_function b on b.device_mode_id = a.device_mode_id
where a.device_mode_id = #{deviceModeId}
</select>
<insert id= "insertHwDeviceMode" parameterType= "HwDeviceMode" useGeneratedKeys= "true" keyProperty= "deviceModeId" >
insert into hw_device_mode
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
@ -114,7 +116,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "gpsFlag != null and gpsFlag != ''" > gps_flag,</if>
<if test= "deviceModeStatus != null and deviceModeStatus != ''" > device_mode_status,</if>
<if test= "commonFlag != null and commonFlag != ''" > common_flag,</if>
<if test= "modeClassfication != null" > mode_classfication,</if>
<if test= "modeType != null and modeType != ''" > mode_type,</if>
<if test= "modeClassfication != null and modeClassfication != ''" > mode_classfication,</if>
<if test= "deviceModePic != null" > device_mode_pic,</if>
<if test= "dataVerifyLevel != null" > data_verify_level,</if>
<if test= "remark != null" > remark,</if>
@ -132,7 +135,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "gpsFlag != null and gpsFlag != ''" > #{gpsFlag},</if>
<if test= "deviceModeStatus != null and deviceModeStatus != ''" > #{deviceModeStatus},</if>
<if test= "commonFlag != null and commonFlag != ''" > #{commonFlag},</if>
<if test= "modeClassfication != null" > #{modeClassfication},</if>
<if test= "modeType != null and modeType != ''" > #{modeType},</if>
<if test= "modeClassfication != null and modeClassfication != ''" > #{modeClassfication},</if>
<if test= "deviceModePic != null" > #{deviceModePic},</if>
<if test= "dataVerifyLevel != null" > #{dataVerifyLevel},</if>
<if test= "remark != null" > #{remark},</if>
@ -154,7 +158,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "gpsFlag != null and gpsFlag != ''" > gps_flag = #{gpsFlag},</if>
<if test= "deviceModeStatus != null and deviceModeStatus != ''" > device_mode_status = #{deviceModeStatus},</if>
<if test= "commonFlag != null and commonFlag != ''" > common_flag = #{commonFlag},</if>
<if test= "modeClassfication != null" > mode_classfication = #{modeClassfication},</if>
<if test= "modeType != null and modeType != ''" > mode_type = #{modeType},</if>
<if test= "modeClassfication != null and modeClassfication != ''" > mode_classfication = #{modeClassfication},</if>
<if test= "deviceModePic != null" > device_mode_pic = #{deviceModePic},</if>
<if test= "dataVerifyLevel != null" > data_verify_level = #{dataVerifyLevel},</if>
<if test= "remark != null" > remark = #{remark},</if>
@ -172,14 +177,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id= "deleteHwDeviceModeByDeviceModeIds" parameterType= "String" >
delete from hw_device_mode where device_mode_id in
delete from hw_device_mode where device_mode_id in
<foreach item= "deviceModeId" collection= "array" open= "(" separator= "," close= ")" >
#{deviceModeId}
</foreach>
</delete>
<delete id= "deleteHwDeviceModeFunctionByDeviceModeIds" parameterType= "String" >
delete from hw_device_mode_function where device_mode_id in
delete from hw_device_mode_function where device_mode_id in
<foreach item= "deviceModeId" collection= "array" open= "(" separator= "," close= ")" >
#{deviceModeId}
</foreach>
@ -307,7 +312,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "gpsFlag != null and gpsFlag != ''" > and hdm.gps_flag = #{gpsFlag}</if>
<if test= "deviceModeStatus != null and deviceModeStatus != ''" > and hdm.device_mode_status = #{deviceModeStatus}</if>
<if test= "commonFlag != null and commonFlag != ''" > and hdm.common_flag = #{commonFlag}</if>
<if test= "modeClassfication != null "> and hdm.mode_classfication = #{modeClassfication}</if>
<if test= "modeClassfication != null and modeClassfication != '' "> and hdm.mode_classfication = #{modeClassfication}</if>
<if test= "deviceModePic != null and deviceModePic != ''" > and hdm.device_mode_pic = #{deviceModePic}</if>
<if test= "dataVerifyLevel != null and dataVerifyLevel != ''" > and hdm.data_verify_level = #{dataVerifyLevel}</if>
<if test= "deviceModeField != null and deviceModeField != ''" > and hdm.device_mode_field = #{deviceModeField}</if>
@ -318,4 +323,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
</mapper>
</mapper>