lmstack il y a 3 ans
Parent
commit
23e8bbd7f4

+ 6 - 5
src/main/java/cn/fastfun/controller/api/ApiAssetProfitController.java

@@ -10,7 +10,7 @@ import cn.fastfun.service.entity.AppAssetConf;
 import cn.fastfun.service.entity.AppDevice;
 import cn.fastfun.service.impl.AppAssetConfServiceImpl;
 import cn.fastfun.service.impl.AppAssetProfitServiceImpl;
-import cn.fastfun.service.mapper.AppAssetConfMapper;
+//import cn.fastfun.service.mapper.AppAssetConfMapper;
 import cn.fastfun.util.IrrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -52,8 +52,8 @@ public class ApiAssetProfitController {
     @Autowired
     AppDeviceService appDeviceService;
 
-    @Autowired
-    AppAssetConfMapper appAssetConfMapper;
+//    @Autowired
+//    AppAssetConfMapper appAssetConfMapper;
 
 
     @ApiOperation(value = "基础信息")
@@ -786,8 +786,9 @@ public class ApiAssetProfitController {
                 }
 
                 Page<AppAssetConf> appAssetConfPage = appAssetConfService.page(page, appAssetConfQueryWrapper);
-                appAssetConfMapper.getAssetConf(param.getSn(), param.getTableOrder(), param.getType().split(","),
-                        new SimpleDateFormat("yyyy-MM-dd").format(param.getTimeStart()), new SimpleDateFormat("yyyy-MM-dd").format(param.getTimeEnd()));
+//                appAssetConfMapper.getAssetConf(param.getSn(), param.getTableOrder(), param.getType().split(","),
+//                        new SimpleDateFormat("yyyy-MM-dd").format(param.getTimeStart()), new SimpleDateFormat("yyyy-MM-dd").format(param.getTimeEnd()),
+//                        (param.getIndex()-1)*param.getLength(), param.getLength());
                 List<Map<String, Object>> data = new ArrayList<>();
                 if (appAssetConfPage.getTotal() > 0) {
                     appAssetConfPage.getRecords().forEach(p -> {

+ 54 - 53
src/main/java/cn/fastfun/service/mapper/AppAssetConfMapper.java

@@ -17,58 +17,59 @@ import java.util.List;
  */
 public interface AppAssetConfMapper extends BaseMapper<AppAssetConf> {
 
-    @Select("<script>" +
-            "SELECT\n" +
-            "\td.sn,\n" +
-            "\td.amount,\n" +
-            "CASE\n" +
-            "\t\tCONCAT( d.table_order, d.type ) \n" +
-            "\t\tWHEN ( 21 ) THEN\n" +
-            "\t\t'故障花费' \n" +
-            "\t\tWHEN ( 22 ) THEN\n" +
-            "\t\t'平台服务费' \n" +
-            "\t\tWHEN ( 31 ) THEN\n" +
-            "\t\t'赔偿花费' \n" +
-            "\t\tWHEN ( 51 ) THEN\n" +
-            "\t\t'仓储费用' \n" +
-            "\t\tWHEN ( 52 ) THEN\n" +
-            "\t\t'运输费用' \n" +
-            "\t\tWHEN ( 53 ) THEN\n" +
-            "\t\t'销售费用' \n" +
-            "\t\tWHEN ( 54 ) THEN\n" +
-            "\t\t'平台费用' \n" +
-            "\t\tWHEN ( 61 ) THEN\n" +
-            "\t\t'已支付金融成本' \n" +
-            "\t\tWHEN ( 62 ) THEN\n" +
-            "\t\t'未支付金融成本' \n" +
-            "\t\tWHEN ( 71 ) THEN\n" +
-            "\t\t'翻新金额-支' \n" +
-            "\t\tWHEN ( 72 ) THEN\n" +
-            "\t\t'处置支出' \n" +
-            "\t\tWHEN ( 73 ) THEN\n" +
-            "\t\t'处置收益' \n" +
-            "\t\tWHEN ( 81 ) THEN\n" +
-            "\t\t'其他支出项目' \n" +
-            "\t\tWHEN ( 82 ) THEN\n" +
-            "\t\t'其他收入项目' ELSE '其他' \n" +
-            "\tEND AS type \n" +
-            "FROM\n" +
-            "\tapp_asset_conf d " +
-            "where sn = #{sn} " +
-            "and table_order = #{tableOrder} " +
-            "<when test='type!=null'>" +
-            "and type in " +
-            "<foreach  item=\"item\" collection=\"array\" index=\"index\"  open=\"(\" separator=\",\" close=\")\">#{type}</foreach>" +
-            "</when>" +
-            "<when test='timeStart!=null'>" +
-            "and time > #{timeStart} " +
-            "</when>" +
-            "<when test='timeEnd!=null'>" +
-            "and time < #{timeEnd} " +
-            "</when>" +
-            "limit #{length}, #{index}" +
-            "</script")
-    List<AppAssetConf> getAssetConf(@Param("sn") String sn, @Param("tableOrder") Integer tableOrder, @Param("type") String[] type,
-                                    @Param("timeStart") String timeStart,@Param("timeEnd") String timeEnd);
+//    @Select("<script>" +
+//            "SELECT" +
+//            "d.sn," +
+//            "d.amount," +
+//            "CASE" +
+//            "CONCAT( d.table_order, d.type ) " +
+//            "WHEN ( 21 ) THEN" +
+//            "'故障花费' " +
+//            "WHEN ( 22 ) THEN" +
+//            "'平台服务费' " +
+//            "WHEN ( 31 ) THEN" +
+//            "'赔偿花费' " +
+//            "WHEN ( 51 ) THEN" +
+//            "'仓储费用' " +
+//            "WHEN ( 52 ) THEN" +
+//            "'运输费用' " +
+//            "WHEN ( 53 ) THEN" +
+//            "'销售费用' " +
+//            "WHEN ( 54 ) THEN" +
+//            "'平台费用' " +
+//            "WHEN ( 61 ) THEN" +
+//            "'已支付金融成本' " +
+//            "WHEN ( 62 ) THEN" +
+//            "'未支付金融成本' " +
+//            "WHEN ( 71 ) THEN" +
+//            "'翻新金额-支' " +
+//            "WHEN ( 72 ) THEN" +
+//            "'处置支出' " +
+//            "WHEN ( 73 ) THEN" +
+//            "'处置收益' " +
+//            "WHEN ( 81 ) THEN" +
+//            "'其他支出项目' " +
+//            "WHEN ( 82 ) THEN" +
+//            "'其他收入项目' ELSE '其他' " +
+//            "END AS type " +
+//            "FROM" +
+//            "app_asset_conf d " +
+//            "where sn = #{sn} " +
+//            "and table_order = #{tableOrder} " +
+//            "<when test='type!=null'>" +
+//            "and type in (" +
+//            "<foreach item='item' collection='type' index='index'  open='(' separator=',' close=')'>#{item}</foreach>" +
+//            ")" +
+//            "</when>" +
+//            "<when test='timeStart!=null'>" +
+//            "and time > #{timeStart} " +
+//            "</when>" +
+//            "<when test='timeEnd!=null'>" +
+//            "and time < #{timeEnd} " +
+//            "</when>" +
+//            "limit #{offset}, #{length}" +
+//            "</script")
+//    List<AppAssetConf> getAssetConf(@Param("sn") String sn, @Param("tableOrder") Integer tableOrder, @Param("type") String[] type,
+//                                    @Param("timeStart") String timeStart,@Param("timeEnd") String timeEnd, @Param("offset") Integer offset, @Param("length") Integer length);
 
 }