|
|
@@ -138,22 +138,17 @@
|
|
|
|
|
|
<!-- 查询设备同步信息 add by wuxw 2018-07-03 -->
|
|
|
<select id="getMachineTranslateInfo" parameterType="Map" resultType="Map">
|
|
|
- select t.machine_id,t.machine_id machineId,t.machine_code,t.machine_code machineCode,t.type_cd,t.type_cd
|
|
|
+ select t.machine_id,t.machine_id machineId,t.machine_code,t.machine_code machineCode,m.machine_name machineName,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,t.create_time createTime,t.update_time
|
|
|
updateTime,t.machine_cmd,t.obj_b_id,t.machine_cmd machineCmd,td2.`name` machineCmdName,t.obj_b_id objBId,t.remark
|
|
|
- from machine_translate t,t_dict td,t_dict td1,t_dict td2
|
|
|
+ from machine_translate t
|
|
|
+ inner join t_dict td on t.type_cd=td.status_cd and td.table_name='machine_translate' and td.table_columns='type_cd'
|
|
|
+ inner join t_dict td1 on t.state=td1.status_cd and td1.table_name='machine_translate' and td1.table_columns='state'
|
|
|
+ inner join t_dict td2 on t.machine_cmd = td2.status_cd and td2.table_name='machine_translate' and td2.table_columns='machine_cmd'
|
|
|
+ left join machine m on t.machine_id = m.machine_id and m.status_cd = '0' and t.community_id = m.community_id
|
|
|
where 1 =1
|
|
|
- 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
|
|
|
- and td1.table_name='machine_translate'
|
|
|
- and td1.table_columns='state'
|
|
|
- and t.machine_cmd = td2.status_cd
|
|
|
- and td2.table_name='machine_translate'
|
|
|
- and td2.table_columns='machine_cmd'
|
|
|
<if test="machineId !=null and machineId != ''">
|
|
|
and t.machine_id= #{machineId}
|
|
|
</if>
|
|
|
@@ -236,14 +231,12 @@
|
|
|
<!-- 查询设备同步数量 add by wuxw 2018-07-03 -->
|
|
|
<select id="queryMachineTranslatesCount" parameterType="Map" resultType="Map">
|
|
|
select count(1) count
|
|
|
- from machine_translate t,t_dict td,t_dict td1
|
|
|
+ from machine_translate t
|
|
|
+ inner join t_dict td on t.type_cd=td.status_cd and td.table_name='machine_translate' and td.table_columns='type_cd'
|
|
|
+ inner join t_dict td1 on t.state=td1.status_cd and td1.table_name='machine_translate' and td1.table_columns='state'
|
|
|
+ inner join t_dict td2 on t.machine_cmd = td2.status_cd and td2.table_name='machine_translate' and td2.table_columns='machine_cmd'
|
|
|
+ left join machine m on t.machine_id = m.machine_id and m.status_cd = '0' and t.community_id = m.community_id
|
|
|
where 1 =1
|
|
|
- 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
|
|
|
- and td1.table_name='machine_translate'
|
|
|
- and td1.table_columns='state'
|
|
|
<if test="machineId !=null and machineId != ''">
|
|
|
and t.machine_id= #{machineId}
|
|
|
</if>
|