Forráskód Böngészése

修改因表结构重构 采用本地数据 导致设备关联水厂的时候,对应的SQL还是查询原来表的bug

王苗苗 3 hete
szülő
commit
59e455cca5

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/business/BusinessController.java

@@ -123,6 +123,7 @@ public class BusinessController extends BaseController {
     /**
      *
      * 接口2:获取水厂列表信息
+     * 2025年03月21日10:08:13 此接口如果使用的话,查询逻辑需要调整,改成t_organization表的数据
      */
     @GetMapping("/waterWorkerList")
     public R<List<BizWaterWork>> waterWorkerList(){

+ 18 - 1
ruoyi-system/src/main/resources/mapper/business/BizDeviceMapper.xml

@@ -201,7 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <!-- 2024年09月27日10:21:37 下面是新增的SQL,不允许覆盖 -->
     <select id="devicePageList" parameterType="com.ruoyi.business.req.DeviceReq" resultType="com.ruoyi.business.res.DeviceRes">
-        SELECT
+        <!-- SELECT
             bd.device_id deviceId,
             bd.device_name deviceName,
             bd.device_no deviceNo,
@@ -217,6 +217,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="worksId != null  and worksId != ''"> and bzw.works_id = #{worksId}</if>
         <if test="deviceNo != null  and deviceNo != ''"> and bd.device_no = #{deviceNo}</if>
         <if test="type != null  and type != ''"> and bd.type = #{type}</if>
+        order by bd.device_id desc -->
+        SELECT
+        bd.device_id deviceId,
+        bd.device_name deviceName,
+        bd.device_no deviceNo,
+        bd.assay_status assayStatus,
+        bzw.name worksName,
+        bd.type type
+        FROM
+        biz_device bd
+        INNER JOIN t_organization bzw
+        on bd.device_works = bzw.id
+        WHERE bd.device_status = '0' AND bzw.del_flag = 0
+        <if test="assayStatus != null  and assayStatus != ''"> and bd.assay_status = #{assayStatus}</if>
+        <if test="worksId != null  and worksId != ''"> and bzw.id = #{worksId}</if>
+        <if test="deviceNo != null  and deviceNo != ''"> and bd.device_no = #{deviceNo}</if>
+        <if test="type != null  and type != ''"> and bd.type = #{type}</if>
         order by bd.device_id desc
     </select>
 </mapper>