|
@@ -5,6 +5,7 @@ import androidx.room.Insert
|
|
|
import androidx.room.OnConflictStrategy
|
|
import androidx.room.OnConflictStrategy
|
|
|
import androidx.room.Query
|
|
import androidx.room.Query
|
|
|
import androidx.room.Update
|
|
import androidx.room.Update
|
|
|
|
|
+import com.grkj.data.config.ISCSConfig
|
|
|
import com.grkj.data.model.dos.IsIsolationPoint
|
|
import com.grkj.data.model.dos.IsIsolationPoint
|
|
|
import com.grkj.data.model.vo.JobPointVo
|
|
import com.grkj.data.model.vo.JobPointVo
|
|
|
import com.grkj.data.model.vo.PointDetailVO
|
|
import com.grkj.data.model.vo.PointDetailVO
|
|
@@ -30,37 +31,30 @@ interface IsolationPointDao {
|
|
|
/**
|
|
/**
|
|
|
* 获取隔离点数据
|
|
* 获取隔离点数据
|
|
|
*/
|
|
*/
|
|
|
- @Query(
|
|
|
|
|
- """
|
|
|
|
|
- select iip.point_id as pointId,
|
|
|
|
|
- iip.point_name as pointName,
|
|
|
|
|
- iip.remark as pointFunction,
|
|
|
|
|
- iw.workstation_name as workstationName,
|
|
|
|
|
- iw.workstation_id as workstationId,
|
|
|
|
|
- irt.rfid as rfidToken,
|
|
|
|
|
- irt.rfid_id as rfidId,
|
|
|
|
|
- iip.power_type as powerType
|
|
|
|
|
|
|
+ @Query("""
|
|
|
|
|
+select iip.point_id as pointId,
|
|
|
|
|
+ iip.point_name as pointName,
|
|
|
|
|
+ iip.remark as pointFunction,
|
|
|
|
|
+ iw.workstation_name as workstationName,
|
|
|
|
|
+ iw.workstation_id as workstationId,
|
|
|
|
|
+ irt.rfid as rfidToken,
|
|
|
|
|
+ irt.rfid_id as rfidId,
|
|
|
|
|
+ iip.power_type as powerType
|
|
|
from is_isolation_point iip
|
|
from is_isolation_point iip
|
|
|
left join is_rfid_token irt on iip.rfid_id = irt.rfid_id
|
|
left join is_rfid_token irt on iip.rfid_id = irt.rfid_id
|
|
|
- left join is_workstation iw on iip.workstation_id=iw.workstation_id
|
|
|
|
|
- WHERE iip.del_flag = 0
|
|
|
|
|
-
|
|
|
|
|
- -- 只有当 nickname 不为 NULL 且非空才做模糊匹配
|
|
|
|
|
- AND (:pointName IS NULL OR trim(:pointName) = '' OR iip.point_name LIKE '%' || :pointName || '%')
|
|
|
|
|
-
|
|
|
|
|
- -- 只有当 cardCode 不为 NULL 且非空才做模糊匹配
|
|
|
|
|
- AND (:pointFunction IS NULL OR trim(:pointFunction) = '' OR iip.remark LIKE '%' || :pointFunction || '%')
|
|
|
|
|
-
|
|
|
|
|
- -- 只有当 workstationName 不为 NULL 且非空才做模糊匹配
|
|
|
|
|
- AND (:powerType IS NULL OR trim(:powerType) = '' OR iip.power_type LIKE '%' || :powerType || '%')
|
|
|
|
|
- AND (:workstation IS NULL OR trim(:workstation) = '' OR iw.workstation_id = :workstation)
|
|
|
|
|
- -- 只有当 workstationName 不为 NULL 且非空才做模糊匹配
|
|
|
|
|
- AND (:rfidTag IS NULL OR trim(:rfidTag) = '' OR irt.rfid LIKE '%' || :rfidTag || '%')
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- LIMIT :size OFFSET :offset
|
|
|
|
|
- """
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ left join is_workstation iw on iip.workstation_id = iw.workstation_id
|
|
|
|
|
+ where iip.del_flag = 0
|
|
|
|
|
+ and (:pointName is null or trim(:pointName) = '' or iip.point_name like '%'||:pointName||'%')
|
|
|
|
|
+ and (:pointFunction is null or trim(:pointFunction) = '' or iip.remark like '%'||:pointFunction||'%')
|
|
|
|
|
+ and (:powerType is null or trim(:powerType) = '' or iip.power_type like '%'||:powerType||'%')
|
|
|
|
|
+ and (
|
|
|
|
|
+ :workstation is null or trim(:workstation) = ''
|
|
|
|
|
+ or iw.workstation_id = :workstation
|
|
|
|
|
+ or (:includeDescendants = 1 and (','||ifnull(iw.ancestors,'')||',') like '%,'||:workstation||',%')
|
|
|
|
|
+ )
|
|
|
|
|
+ and (:rfidTag is null or trim(:rfidTag) = '' or irt.rfid like '%'||:rfidTag||'%')
|
|
|
|
|
+ limit :size offset :offset
|
|
|
|
|
+""")
|
|
|
fun getPointManageData(
|
|
fun getPointManageData(
|
|
|
pointName: String?,
|
|
pointName: String?,
|
|
|
pointFunction: String?,
|
|
pointFunction: String?,
|
|
@@ -68,9 +62,11 @@ interface IsolationPointDao {
|
|
|
workstation: Long?,
|
|
workstation: Long?,
|
|
|
rfidTag: String?,
|
|
rfidTag: String?,
|
|
|
size: Int,
|
|
size: Int,
|
|
|
- offset: Int
|
|
|
|
|
|
|
+ offset: Int,
|
|
|
|
|
+ includeDescendants: Int = ISCSConfig.includeDescendants
|
|
|
): List<PointManageVo>
|
|
): List<PointManageVo>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 根据隔离点id删除隔离点
|
|
* 根据隔离点id删除隔离点
|
|
|
*/
|
|
*/
|
|
@@ -80,24 +76,29 @@ interface IsolationPointDao {
|
|
|
/**
|
|
/**
|
|
|
* 获取所有隔离点数据区域区分
|
|
* 获取所有隔离点数据区域区分
|
|
|
*/
|
|
*/
|
|
|
- @Query(
|
|
|
|
|
- """
|
|
|
|
|
- select iip.point_id as pointId,
|
|
|
|
|
- iip.point_name as pointName,
|
|
|
|
|
- iip.remark as pointFunction,
|
|
|
|
|
- iw.workstation_name as workstationName,
|
|
|
|
|
- iw.workstation_id as workstationId,
|
|
|
|
|
- irt.rfid as rfidToken,
|
|
|
|
|
- irt.rfid_id as rfidId,
|
|
|
|
|
- iip.power_type as powerType
|
|
|
|
|
|
|
+ @Query("""
|
|
|
|
|
+select iip.point_id as pointId,
|
|
|
|
|
+ iip.point_name as pointName,
|
|
|
|
|
+ iip.remark as pointFunction,
|
|
|
|
|
+ iw.workstation_name as workstationName,
|
|
|
|
|
+ iw.workstation_id as workstationId,
|
|
|
|
|
+ irt.rfid as rfidToken,
|
|
|
|
|
+ irt.rfid_id as rfidId,
|
|
|
|
|
+ iip.power_type as powerType
|
|
|
from is_isolation_point iip
|
|
from is_isolation_point iip
|
|
|
left join is_rfid_token irt on iip.rfid_id = irt.rfid_id
|
|
left join is_rfid_token irt on iip.rfid_id = irt.rfid_id
|
|
|
- left join is_workstation iw on iip.workstation_id=iw.workstation_id
|
|
|
|
|
- WHERE iip.del_flag = 0
|
|
|
|
|
- AND iw.workstation_id = :workstationId
|
|
|
|
|
- """
|
|
|
|
|
- )
|
|
|
|
|
- fun getAllPointManageDataWithWorkstationId(workstationId: Long): MutableList<PointManageVo>
|
|
|
|
|
|
|
+ left join is_workstation iw on iip.workstation_id = iw.workstation_id
|
|
|
|
|
+ where iip.del_flag = 0
|
|
|
|
|
+ and (
|
|
|
|
|
+ iw.workstation_id = :workstationId
|
|
|
|
|
+ or (:includeDescendants = 1 and (','||ifnull(iw.ancestors,'')||',') like '%,'||:workstationId||',%')
|
|
|
|
|
+ )
|
|
|
|
|
+""")
|
|
|
|
|
+ fun getAllPointManageDataWithWorkstationId(
|
|
|
|
|
+ workstationId: Long,
|
|
|
|
|
+ includeDescendants: Int = ISCSConfig.includeDescendants
|
|
|
|
|
+ ): MutableList<PointManageVo>
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 根据点位nfc获取点位数据
|
|
* 根据点位nfc获取点位数据
|