Browse Source

仓库、摄像头查询接口 增加编辑人名称

tags/v1.2.0^2
wanghaoran 1 year ago
parent
commit
798e4f78cc
4 changed files with 36 additions and 5 deletions
  1. +4
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Camera.java
  2. +4
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Warehouse.java
  3. +8
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/CameraServiceImpl.java
  4. +20
    -5
      tuoheng-admin/src/main/resources/mapper/WarehouseMapper.xml

+ 4
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Camera.java View File

@@ -1,5 +1,6 @@
package com.tuoheng.admin.entity.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity;
import lombok.Data;
@@ -62,4 +63,7 @@ public class Camera extends BaseEntity implements Serializable {
* 备注
*/
private String remark;
@TableField(exist = false)
private String updateUserName;
}

+ 4
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Warehouse.java View File

@@ -1,5 +1,6 @@
package com.tuoheng.admin.entity.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity;
import lombok.Data;
@@ -48,4 +49,7 @@ public class Warehouse extends BaseEntity implements Serializable {
*/
private String location;
@TableField(exist = false)
private String updateUserName;
}

+ 8
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/CameraServiceImpl.java View File

@@ -16,6 +16,7 @@ import com.tuoheng.common.exception.ServiceException;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.common.utils.StringUtils;
import com.tuoheng.system.entity.User;
import com.tuoheng.system.mapper.UserMapper;
import com.tuoheng.system.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -36,6 +37,9 @@ public class CameraServiceImpl extends BaseServiceImpl<CameraMapper, Camera> imp
@Autowired
private CameraMapper cameraMapper;
@Autowired
private UserMapper userMapper;
/**
* 查询摄像头列表
*
@@ -102,7 +106,11 @@ public class CameraServiceImpl extends BaseServiceImpl<CameraMapper, Camera> imp
.eq(Camera::getMark, MarkTypeEnum.VALID.getCode())
.like(StringUtils.isNotEmpty(request.getCameraName()), Camera::getCameraName, request.getCameraName())
.orderByDesc(Camera::getCreateTime));
for (Camera record : pageData.getRecords()) {
User user = userMapper.selectById(record.getUpdateUser());
record.setUpdateUserName(user.getRealname());
}
return JsonResult.success(pageData);
}

+ 20
- 5
tuoheng-admin/src/main/resources/mapper/WarehouseMapper.xml View File

@@ -23,15 +23,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectPageList" parameterType="com.tuoheng.admin.entity.request.warehouse.QueryWarehousePageListRequest" resultMap="WarehouseResult">
<include refid="selectWarehouseVo"/>
SELECT
w.id,
w.tenant_id,
w.warehouse_name,
w.longitude,
w.latitude,
w.location,
w.create_user,
w.create_time,
w.update_user,
w.update_time,
w.mark,
u.realname AS updateUserName
FROM
th_warehouse w
LEFT JOIN sys_user u ON w.update_user = u.id
<where>
<if test="1 == 1"> and mark = 1 </if>
<if test="request.tenantId != null and request.tenantId != 0"> and tenant_id = #{request.tenantId}</if>
<if test="1 == 1"> and w.mark = 1 </if>
<if test="request.tenantId != null and request.tenantId != 0"> and w.tenant_id = #{request.tenantId}</if>
<if test="request.warehouseName != null and request.warehouseName != ''">
and warehouse_name like concat('%',#{request.warehouseName},'%')
and w.warehouse_name like concat('%',#{request.warehouseName},'%')
</if>
</where>
order by create_time desc
order by w.create_time desc
</select>
<select id="getOneById" parameterType="Integer" resultMap="WarehouseResult">

Loading…
Cancel
Save