| | |
| | | <result column="mode_code" property="modeCode"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="device_dept_name" property="deviceDeptName"/> |
| | | <result column="maintenance_state" property="maintenanceState"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectGdManageDevicePage" resultMap="gdManageDeviceResultMap"> |
| | | select |
| | | md.*, |
| | | md.id, |
| | | md.device_sn, |
| | | md.device_name, |
| | | md.nickname, |
| | | md.device_payload, |
| | | md.longitude, |
| | | md.latitude, |
| | | md.mode_code, |
| | | md.create_time, |
| | | md.maintenance_state, |
| | | bd.dept_name as device_dept_name |
| | | from |
| | | ja_gd_manage_device md |
| | |
| | | </if> |
| | | <if test="param2.deviceType != null and param2.deviceType != ''"> |
| | | and md.device_type::text = #{param2.deviceType}::text |
| | | </if> |
| | | <if test="param2.maintenanceState != null"> |
| | | and md.maintenance_state = #{param2.maintenanceState} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | and d2.device_type = '0' |
| | | <where> |
| | | md.is_deleted = 0 |
| | | AND md.child_sn IS NOT NULL |
| | | AND trim(md.child_sn) != '' |
| | | <if test="deviceIds != null and deviceIds.size() > 0"> |
| | | and md.id::text in |
| | | <foreach item="item" collection="deviceIds" index="index" open="(" close=")" separator=","> |
| | |
| | | and md.device_payload like concat('%', #{devicePayload}, '%') |
| | | </if> |
| | | <if test="geom != null and geom != ''"> |
| | | /* 确保这里是第一个条件时,and 能被 MyBatis 正确处理,或者直接去掉这个 and */ |
| | | and ST_Intersects(md.geom, ST_GeometryFromText(#{geom}, 4326)) |
| | | AND public.st_intersects ( md.geom, public.st_geomfromtext(#{geom}::text, 4326)) |
| | | </if> |
| | | <if test="deviceType != null and deviceType != '' "> |
| | | and md.device_type::text = #{deviceType}::text |