| | |
| | | |
| | | <!-- 保存设备同步信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveMachineTranslate" parameterType="Map"> |
| | | insert into machine_translate( |
| | | machine_id,machine_code,status_cd,type_cd,machine_translate_id,obj_id,obj_name,state,community_id,b_id |
| | | ) values ( |
| | | #{machineId},#{machineCode},'0',#{typeCd},#{machineTranslateId},#{objId},#{objName},#{state},#{communityId},#{bId} |
| | | ) |
| | | </insert> |
| | | insert into machine_translate( |
| | | machine_id,machine_code,status_cd,type_cd,machine_translate_id,obj_id,obj_name,state,community_id,b_id,machine_cmd,obj_b_id |
| | | ) values ( |
| | | #{machineId},#{machineCode},'0',#{typeCd},#{machineTranslateId},#{objId},#{objName},#{state},#{communityId},#{bId},#{machineCmd}, |
| | | #{objBId} |
| | | ) |
| | | </insert> |
| | | <update id="updateMachineTranslate" parameterType="Map"> |
| | | update machine_translate t set |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | t.status_cd= #{statusCd}, |
| | | t.status_cd= #{statusCd}, |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | t.state= #{state} |
| | | t.state= #{state}, |
| | | </if> |
| | | <if test="updateTime !=null "> |
| | | t.update_time= #{updateTime} |
| | | </if> |
| | | |
| | | where 1=1 |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | |
| | | </update> |
| | | <!-- 保存设备同步信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessMachineTranslateInfo" parameterType="Map"> |
| | | insert into business_machine_translate( |
| | | machine_id,machine_code,operate,type_cd,machine_translate_id,obj_id,obj_name,state,community_id,b_id |
| | | ) values ( |
| | | #{machineId},#{machineCode},#{operate},#{typeCd},#{machineTranslateId},#{objId},#{objName},#{state},#{communityId},#{bId} |
| | | ) |
| | | </insert> |
| | | insert into business_machine_translate( |
| | | machine_id,machine_code,operate,type_cd,machine_translate_id,obj_id,obj_name,state,community_id,b_id,machine_cmd,obj_b_id |
| | | ) values ( |
| | | #{machineId},#{machineCode},#{operate},#{typeCd},#{machineTranslateId},#{objId},#{objName},#{state},#{communityId},#{bId}, |
| | | #{machineCmd}, |
| | | #{objBId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询设备同步信息(Business) add by wuxw 2018-07-03 --> |
| | |
| | | select t.machine_id,t.machine_id machineId,t.machine_code,t.machine_code |
| | | machineCode,t.operate,t.type_cd,t.type_cd typeCd,t.machine_translate_id,t.machine_translate_id |
| | | machineTranslateId,t.obj_id,t.obj_id objId,t.obj_name,t.obj_name objName,t.state,t.community_id,t.community_id |
| | | communityId,t.b_id,t.b_id bId |
| | | communityId,t.b_id,t.b_id bId,t.machine_cmd,t.obj_b_id |
| | | from business_machine_translate t |
| | | where 1 =1 |
| | | <if test="machineId !=null and machineId != ''"> |
| | |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 保存设备同步信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveMachineTranslateInfoInstance" parameterType="Map"> |
| | | insert into machine_translate( |
| | | machine_id,machine_code,type_cd,machine_translate_id,obj_id,status_cd,obj_name,state,community_id,b_id |
| | | machine_id,machine_code,type_cd,machine_translate_id,obj_id,status_cd,obj_name,state,community_id,b_id, |
| | | machine_cmd,obj_b_id |
| | | ) select |
| | | t.machine_id,t.machine_code,t.type_cd,t.machine_translate_id,t.obj_id,'0',t.obj_name,t.state,t.community_id,t.b_id |
| | | t.machine_id,t.machine_code,t.type_cd,t.machine_translate_id,t.obj_id,'0',t.obj_name,t.state,t.community_id,t.b_id, |
| | | t.machine_cmd,t.obj_b_id |
| | | from business_machine_translate t where 1=1 |
| | | <if test="machineId !=null and machineId != ''"> |
| | | and t.machine_id= #{machineId} |
| | |
| | | select t.machine_id,t.machine_id machineId,t.machine_code,t.machine_code machineCode,t.type_cd,t.type_cd |
| | | typeCd,t.machine_translate_id,t.machine_translate_id machineTranslateId,t.obj_id,t.obj_id |
| | | objId,t.status_cd,t.status_cd statusCd,t.obj_name,t.obj_name objName,t.state,t.community_id,t.community_id |
| | | communityId,t.b_id,t.b_id bId,td.name typeCdName,td1.name stateName |
| | | communityId,t.b_id,t.b_id bId,td.name typeCdName,td1.name stateName,t.create_time createTime,t.update_time |
| | | updateTime,t.machine_cmd,t.obj_b_id,t.machine_cmd machineCmd,t.obj_b_id objBId |
| | | from machine_translate t,t_dict td,t_dict td1 |
| | | where 1 =1 |
| | | and t.machine_type_cd=td.status_cd |
| | | and t.type_cd=td.status_cd |
| | | and td.table_name='machine_translate' |
| | | and td.table_columns='type_cd' |
| | | and t.state=td1.status_cd |
| | |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | order by t.update_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | |
| | | select count(1) count |
| | | from machine_translate t,t_dict td,t_dict td1 |
| | | where 1 =1 |
| | | and t.machine_type_cd=td.status_cd |
| | | and t.type_cd=td.status_cd |
| | | and td.table_name='machine_translate' |
| | | and td.table_columns='type_cd' |
| | | and t.state=td1.status_cd |
| | |
| | | </select> |
| | | |
| | | <update id="updateMachineTranslateState" parameterType="Map"> |
| | | update machine_translate t set t.state = #{state} |
| | | update machine_translate t set |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | t.status_cd= #{statusCd}, |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | t.state= #{state}, |
| | | </if> |
| | | <if test="updateTime !=null "> |
| | | t.update_time= #{updateTime} |
| | | </if> |
| | | where |
| | | t.machine_code= #{machineCode} |
| | | <if test="communityId !=null and communityId != ''"> |