Procházet zdrojové kódy

sop分页sql调整

车车 před 4 měsíci
rodič
revize
94fc3cd47e

+ 21 - 22
yudao-module-iscs/src/main/resources/mapper/SopMapper.xml

@@ -12,12 +12,11 @@
     <select id="getSopPage" resultType="cn.iocoder.yudao.module.iscs.controller.admin.sop.vo.SopRespVO">
         SELECT
         s.*,
-        ws.workshop_name,
         wa.workarea_name,
         w.workstation_name,
         d.machinery_name,
         any_value(di.label) as sopTypeName,
-        COUNT( p.record_id ) AS pointCount
+        COUNT( p.id ) AS pointCount
         FROM
         isc_sop s
         LEFT JOIN isc_workarea wa ON wa.id = s.workarea_id
@@ -27,35 +26,35 @@
         LEFT JOIN isc_sop_points p ON p.sop_id = s.id
         LEFT JOIN system_dict_data di ON di.dict_type = "sop_type" and di.value = s.sop_type
         <where>
-            <if test="dto.sopCode != null and dto.sopCode.trim != ''">
-                and s.sop_code like concat('%',#{dto.sopCode},'%')
+            <if test="vo.sopCode != null and vo.sopCode.trim != ''">
+                and s.sop_code like concat('%',#{vo.sopCode},'%')
             </if>
-            <if test="dto.sopName != null and dto.sopName.trim != ''">
-                and s.sop_name like concat('%',#{dto.sopName},'%')
+            <if test="vo.sopName != null and vo.sopName.trim != ''">
+                and s.sop_name like concat('%',#{vo.sopName},'%')
             </if>
-            <if test="dto.sopStatus != null and dto.sopStatus.trim != ''">
-                and s.sop_status = #{dto.sopStatus}
+            <if test="vo.sopStatus != null and vo.sopStatus.trim != ''">
+                and s.sop_status = #{vo.sopStatus}
             </if>
-            <if test="dto.workshopId != null">
-                and s.workshop_id = #{dto.workshopId}
+            <if test="vo.workshopId != null">
+                and s.workshop_id = #{vo.workshopId}
             </if>
-            <if test="dto.workareaId != null">
-                and s.workarea_id = #{dto.workareaId}
+            <if test="vo.workareaId != null">
+                and s.workarea_id = #{vo.workareaId}
             </if>
-            <if test="dto.sopType != null and dto.sopType.trim != ''">
-                and s.sop_type = #{dto.sopType}
+            <if test="vo.sopType != null and vo.sopType.trim != ''">
+                and s.sop_type = #{vo.sopType}
             </if>
-            <if test="dto.startTime != null and dto.startTime.trim != ''">
-                and s.create_time &gt;= #{dto.startTime}
+            <if test="vo.startTime != null and vo.startTime.trim != ''">
+                and s.create_time &gt;= #{vo.startTime}
             </if>
-            <if test="dto.endTime != null and dto.endTime.trim != ''">
-                and s.create_time &lt;= #{dto.endTime}
+            <if test="vo.endTime != null and vo.endTime.trim != ''">
+                and s.create_time &lt;= #{vo.endTime}
             </if>
-            <if test="dto.workstationId != null">
-                and s.workstation_id = #{dto.workstationId}
+            <if test="vo.workstationId != null">
+                and s.workstation_id = #{vo.workstationId}
             </if>
-            <if test="dto.machineryId != null">
-                and s.machinery_id = #{dto.machineryId}
+            <if test="vo.machineryId != null">
+                and s.machinery_id = #{vo.machineryId}
             </if>
         </where>
         GROUP BY s.id