Jelajahi Sumber

Merge remote-tracking branch 'origin/dev-mysql' into dev-mysql

# Conflicts:
#	src/main/java/com/uas/platform/b2b/service/impl/VendorsServiceImpl.java
dongbw 8 tahun lalu
induk
melakukan
90ac9128f1

+ 4 - 4
src/main/java/com/uas/platform/b2b/mobile/service/impl/MobileTaskServiceImpl.java

@@ -118,12 +118,12 @@ public class MobileTaskServiceImpl implements MobileTaskService {
 		Integer processcount = commonDao.queryForObject(todo, Integer.class);
 		Integer taskcount = commonDao.queryForObject(doing, Integer.class);
 		List<OfficeTask> lasttask = commonDao.query(
-				"select * from ( select t.ta_taskname taskname, t.ta_startdate startdate from office$task t where t.ta_statuscode = 'start' and t.ta_domancode = '"
-						+ emcode + "' and t.ta_uu = " + enuu + " order by t.ta_id desc ) where rownum < 2",
+				"select t.ta_taskname taskname, t.ta_startdate startdate from office$task t where t.ta_statuscode = 'start' and t.ta_domancode = '"
+						+ emcode + "' and t.ta_uu = " + enuu + " order by t.ta_id desc limit 1",
 				OfficeTask.class);
 		List<AppFlowOperation> nowProcess = commonDao.query(
-				"select * from ( select t.fop_caller caller, t.fop_dealname dealname, t.fop_dealtime dealtime,t.fop_nodelevel nodelevel,t.fop_sourceid sourceid from mobile$flowoperation t where t.fop_statuscode = 'UNAUDIT' and t.fop_nodedealuu = "
-						+ emcode + " and t.fop_nodeenuu = " + enuu + " order by t.fop_id desc ) where rownum < 2",
+				"select t.fop_caller caller, t.fop_dealname dealname, t.fop_dealtime dealtime,t.fop_nodelevel nodelevel,t.fop_sourceid sourceid from mobile$flowoperation t where t.fop_statuscode = 'UNAUDIT' and t.fop_nodedealuu = "
+						+ emcode + " and t.fop_nodeenuu = " + enuu + " order by t.fop_id desc limit 1",
 				AppFlowOperation.class);
 		if (!CollectionUtils.isEmpty(nowProcess)) {
 			List<AppFlowOperation> lastProcess = commonDao

+ 2 - 2
src/main/java/com/uas/platform/b2b/service/impl/EnterpriseServiceImpl.java

@@ -763,11 +763,11 @@ public class EnterpriseServiceImpl implements EnterpriseService {
         int rn = pageSize * (pageNumber -1) + 1;
 	    int rownum = pageNumber * pageSize;
 		String sql = "select * from(" +
-                "select a.*,rownum rn from(select en_name name, en_uu uu, to_char(en_time, 'yyyy-mm-dd') registerdate from sec$enterprises " ;
+                "select en_name name, en_uu uu, to_char(en_time, 'yyyy-mm-dd') registerdate from sec$enterprises " ;
 	    if (!StringUtils.isEmpty(registerdate)) {
 	        sql = sql + "where to_char(en_time, 'yyyy-mm-dd') >= '" + registerdate + "' ";
         }
-        sql = sql + "order by en_time asc) a) where rn >= " + rn + " and rn <= " + rownum;
+        sql = sql + "order by en_time asc) a limit " + rn + " , " + (rownum-rn);
 		return commonDao.query(sql, EnterpriseNameAndUU.class);
 	}
 

+ 2 - 3
src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryServiceImpl.java

@@ -565,10 +565,9 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
         for (; page <= Math.ceil((double)count / (double)size); page++ ) {
 			System.out.println("开始循环:" + page);
 			String sql = "select " + importId + " as pr_import_id, pr_title,pr_code,pr_spec,pr_unit,pr_minpack,pr_minorder,pr_leadtime,pr_ltinstock,pr_brand,pr_cmpcode,'B2B' as pr_sourceapp,id_prid as pr_sourceid,1 as pr_issale,0 aspr_ispurchase,pr_isshow,pr_ispubsale,pr_standard,pr_create_time,id_venduu as pr_enuu,id_venduseruu as pr_useruu from (" +
-					" select P.*,t.*,rownum r from (select id_prid,id_venduu,id_venduseruu,count(1) as nums from purc$inquiryitems left join purc$inquiry on id_inid = in_id " +
+					"select id_prid,id_venduu,id_venduseruu,count(1) as nums from purc$inquiryitems left join purc$inquiry on id_inid = in_id " +
 					" where id_venduseruu is not null and id_status = 201 and in_enuu = " + enUU + " group by id_prid,id_venduseruu,id_venduu order by count(1) desc " +
-					" ) t left join v$products P on id_prid = pr_id where P.pr_title is not null and P.pr_code is not null and rownum <= 10" +
-					") where r > 0";
+					" ) t left join v$products P on id_prid = pr_id where P.pr_title is not null and P.pr_code is not null limit 0,10";
 			System.out.println(sql);
 			List<ProductTemp> productTemps = commonDao.query(sql, ProductTemp.class);
 			System.out.println(enUU + "找到询价单详情" + productTemps.size());

+ 2 - 2
src/main/java/com/uas/platform/b2b/service/impl/PurchaseOrderServiceImpl.java

@@ -1427,10 +1427,10 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
 //			String sql = "select pd_id from (select rownum r,pd_id from purc$orderitems left join purc$orders on pd_puid = pu_id where pu_venduseruu is not null and pu_enuu = "
 //					+ enUU + " and rownum <= " + page * size + " order by pd_id desc) where r > " + size * (page - 1);
 			String sql = "select " + importId + " as pr_import_id, pr_title,pr_code,pr_spec,pr_unit,pr_minpack,pr_minorder,pr_leadtime,pr_ltinstock,pr_brand,pr_cmpcode,'B2B' as pr_sourceapp,pd_prid as pr_sourceid,1 as pr_issale,0 as pr_ispurchase," +
-					"pr_isshow,pr_ispubsale,pr_standard,pr_create_time,pu_venduu as pr_enuu,pu_venduseruu as pr_useruu from (select P.*,t.*,rownum r from (" +
+					"pr_isshow,pr_ispubsale,pr_standard,pr_create_time,pu_venduu as pr_enuu,pu_venduseruu as pr_useruu from (" +
 					" select pd_prid,pu_venduu,pu_venduseruu,count(1) as nums from purc$orderitems left join purc$orders on pd_puid = pu_id " +
 					" where pu_venduseruu is not null and pu_enuu = " + enUU + " group by pd_prid,pu_venduseruu,pu_venduu order by count(1) desc " +
-					" ) t left join v$products P on pd_prid = pr_id where P.pr_title is not null and P.pr_code is not null and rownum <= " + page * size + ") where r > " + size * (page - 1);
+					" ) t left join v$products P on pd_prid = pr_id where P.pr_title is not null and P.pr_code is not null limit "+ size * (page - 1)+ ", "+ (page * size-size * (page - 1)) ;
 			System.out.println(sql);
 			List<ProductTemp> productTemps = commonDao.query(sql, ProductTemp.class);
 			System.out.println(enUU + "找到采购单详情" + productTemps.size());