소스 검색

lrl -2021-11-24

lirl 3 년 전
부모
커밋
6296569e56

+ 14 - 0
src/main/java/com/steerinfo/ems/emsgmpcjh/controller/EmsGmPcJhController.java

@@ -391,6 +391,20 @@ public class EmsGmPcJhController extends BaseRESTfulController {
             }
             parmas.put("workprocType", workprocType);
         }
+        if(parmas.get("grades") != null && !parmas.get("grades").toString().isEmpty()){
+            String grades = parmas.get("grades").toString();
+            if(!grades.startsWith("'")){
+                grades = "'" + grades.replaceAll(",", "','").replaceAll(",", "','") + "'";
+            }
+            parmas.put("grades", grades);
+        }
+        if(parmas.get("specifications") != null && !parmas.get("specifications").toString().isEmpty()){
+            String specifications = parmas.get("specifications").toString();
+            if(!specifications.startsWith("'")){
+                specifications = "'" + specifications.replaceAll(",", "','").replaceAll(",", "','") + "'";
+            }
+            parmas.put("specifications", specifications);
+        }
         PageList<Map<String, Object>> gmPcJhDataForPage = emsGmPcJhService.getGmPcJhDataForPage(parmas, pageNum, pageSize);
         return success(gmPcJhDataForPage);
     }

+ 51 - 26
src/main/java/com/steerinfo/ems/emsgmpcjh/mapper/EmsGmPcJhMapper.xml

@@ -746,35 +746,60 @@
   </update>
   <!--轮次计划页面查询-->
   <select id="getGmPcJhData" parameterType="java.util.HashMap" resultType="Map">
+<!--    select ID as id , to_char(JH_TIME,'yyyy-mm-dd') as jhTime, STATE as state, GRADES as grades, SPECIFICATIONS as specifications, LENGTHS as lengths, CHEMICAL_STANDARD as chemicalstandard, SURFACE_STANDARD as surfacestandard,-->
+<!--    WORKPROC_TYPE as workprocType, IATERAL_AREA as iateralArea,  LENGTH_TIMES_WIDTH as lengthtimeswidth, TRANSPORT_TYPE as transportType , RECEIVE_TIME as receivetime, CREATE_MAN as createman,-->
+<!--    CREATE_TIME as createtime, UPDATE_MAN as updateman, UPDATE_TIME as updatime , MEMO as memo , PURPOSE as purpose, UNITID as unitid, DIMENSION as dimension, PLAN_WEIGHT as planweight,KXF_WEIGHT,YXF_WEIGHT,TO_CHAR(DELIVERY_DATE,'yyyy-mm-dd') as deliveryDate-->
+<!--      from (select *-->
+<!--              from ems_gm_pc_jh t-->
+<!--              <where>-->
+<!--                <if test="startTime != null and startTime != '' and endTime !=null and endTime!='' ">-->
+<!--                  and  JH_TIME between to_date(#{startTime},'yyyy-mm-dd')  and to_date(#{endTime},'yyyy-mm-dd')-->
+<!--                </if>-->
+<!--              </where>-->
+<!--            union-->
+<!--            select *-->
+<!--              from ems_gm_pc_jh-->
+<!--            <where>-->
+<!--              <if test="startTime != null and startTime != '' and endTime !=null and endTime!='' ">-->
+<!--                and  JH_TIME between to_date(substr(#{startTime}, 0, 7) || '-01','yyyy-mm-dd')  and to_date(substr(#{endTime}, 0, 7) || '-01','yyyy-mm-dd')-->
+<!--              </if>-->
+<!--               and ID like 'N%'-->
+<!--            </where>-->
+<!--            order by JH_TIME desc-->
+<!--            ) t1-->
+<!--            <where>-->
+<!--              <if test="workprocType != null and workprocType!= ''">-->
+<!--                and WORKPROC_TYPE in (${workprocType})-->
+<!--              </if>-->
+<!--              <if test="id != null and id != ''">-->
+<!--                and id = #{id}-->
+<!--              </if>-->
+<!--                and state in ('2','3')-->
+<!--            </where>-->
     select ID as id , to_char(JH_TIME,'yyyy-mm-dd') as jhTime, STATE as state, GRADES as grades, SPECIFICATIONS as specifications, LENGTHS as lengths, CHEMICAL_STANDARD as chemicalstandard, SURFACE_STANDARD as surfacestandard,
     WORKPROC_TYPE as workprocType, IATERAL_AREA as iateralArea,  LENGTH_TIMES_WIDTH as lengthtimeswidth, TRANSPORT_TYPE as transportType , RECEIVE_TIME as receivetime, CREATE_MAN as createman,
     CREATE_TIME as createtime, UPDATE_MAN as updateman, UPDATE_TIME as updatime , MEMO as memo , PURPOSE as purpose, UNITID as unitid, DIMENSION as dimension, PLAN_WEIGHT as planweight,KXF_WEIGHT,YXF_WEIGHT,TO_CHAR(DELIVERY_DATE,'yyyy-mm-dd') as deliveryDate
-      from (select *
-              from ems_gm_pc_jh t
-              <where>
-                <if test="startTime != null and startTime != '' and endTime !=null and endTime!='' ">
-                  and  JH_TIME between to_date(#{startTime},'yyyy-mm-dd')  and to_date(#{endTime},'yyyy-mm-dd')
-                </if>
-              </where>
-            union
-            select *
-              from ems_gm_pc_jh
-            <where>
-              <if test="startTime != null and startTime != '' and endTime !=null and endTime!='' ">
-                and  JH_TIME between to_date(substr(#{startTime}, 0, 7) || '-01','yyyy-mm-dd')  and to_date(substr(#{endTime}, 0, 7) || '-01','yyyy-mm-dd')
-              </if>
-               and ID like 'N%'
-            </where>) t1
-            <where>
-              <if test="workprocType != null and workprocType!= ''">
-                and WORKPROC_TYPE in (${workprocType})
-              </if>
-              <if test="id != null and id != ''">
-                and id = #{id}
-              </if>
-                and state in ('2','3')
-            </where>
-        order by t1.JH_TIME desc
+    from ems_gm_pc_jh t
+    <where>
+      <if test="startTime != null and startTime != '' and endTime !=null and endTime!='' ">
+        and  JH_TIME between to_date(#{startTime},'yyyy-mm-dd')  and to_date(#{endTime},'yyyy-mm-dd')
+      </if>
+      <if test="workprocType != null and workprocType!= ''">
+        and WORKPROC_TYPE in (${workprocType})
+      </if>
+      <if test="grades != null and grades!= ''">
+        and GRADES in (${grades})
+      </if>
+      <if test="specifications != null and specifications != ''">
+        and SPECIFICATIONS in (${specifications})
+      </if>
+
+      <if test="id != null and id != ''">
+        and id = #{id}
+      </if>
+      and state in ('2','3')
+    </where>
+    order by JH_TIME desc,ID desc
   </select>
   <!--国贸计划查询-->
 <select id="getXsDdDate" parameterType="java.util.HashMap" resultType="Map">

+ 1 - 0
src/main/java/com/steerinfo/ems/emsprodplanround/mapper/EmsProdplanRoundMapper.xml

@@ -804,5 +804,6 @@
          and PARENTID in (${id})
        </if>
      </where>
+     order by state
    </select>
 </mapper>