Merge remote-tracking branch 'origin/master'
8 文件已复制
22个文件已修改
1个文件已删除
1 文件已重命名
11个文件已添加
| | |
| | | import jakarta.annotation.PostConstruct; |
| | | import org.apache.ibatis.session.SqlSessionFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | |
| | | @Autowired |
| | | private List<SqlSessionFactory> sqlSessionFactoryList; |
| | | |
| | | @Value("${mybatis-plus.configuration.print-sql}") |
| | | private boolean printSql; |
| | | /** |
| | | * ä¸¤ä¸ªæ¦æªå¨ï¼èªå¨çæIDï¼å¼å¸¸æ¶è¾åºSQL |
| | | */ |
| | |
| | | for (SqlSessionFactory sqlSessionFactory : sqlSessionFactoryList) { |
| | | sqlSessionFactory.getConfiguration().addInterceptor(new AutoGenerateIdInterceptor()); |
| | | sqlSessionFactory.getConfiguration().addInterceptor(new PrintExceptionSqlInterceptor()); |
| | | if (printSql) { |
| | | sqlSessionFactory.getConfiguration().addInterceptor(new PrintSqlInterceptor()); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | package com.dy.common.mybatis; |
| | | |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.text.DateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.Properties; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.executor.Executor; |
| | | import org.apache.ibatis.mapping.BoundSql; |
| | | import org.apache.ibatis.mapping.MappedStatement; |
| | | import org.apache.ibatis.mapping.ParameterMapping; |
| | | import org.apache.ibatis.plugin.Interceptor; |
| | | import org.apache.ibatis.plugin.Intercepts; |
| | | import org.apache.ibatis.plugin.Invocation; |
| | | import org.apache.ibatis.plugin.Plugin; |
| | | import org.apache.ibatis.plugin.Signature; |
| | | import org.apache.ibatis.reflection.MetaObject; |
| | | import org.apache.ibatis.session.Configuration; |
| | | import org.apache.ibatis.session.ResultHandler; |
| | | import org.apache.ibatis.session.RowBounds; |
| | | import org.apache.ibatis.type.TypeHandlerRegistry; |
| | | |
| | | /** |
| | | * æ¦æªæ§è¡SQLåçå¼å¸¸çåºæ¯ï¼å¹¶å°æ§è¡éè¯¯ï¼æ§è¡SQLååæ°æå°åºæ¥ |
| | |
| | | @Override |
| | | public Object intercept(Invocation invocation) throws Throwable { |
| | | // è·åæ§è¡æ¹æ³çMappedStatementåæ° |
| | | MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0]; |
| | | Object parameter = null; |
| | | if (invocation.getArgs().length > 1) { |
| | | parameter = invocation.getArgs()[1]; |
| | | } |
| | | String sqlId = mappedStatement.getId(); |
| | | BoundSql boundSql = mappedStatement.getBoundSql(parameter); |
| | | Configuration configuration = mappedStatement.getConfiguration(); |
| | | Object response; |
| | | try { |
| | | response = invocation.proceed(); |
| | | } catch (Exception e) { |
| | | // è¾åºSQLå¼å¸¸ä¿¡æ¯ |
| | | log.error("SQL ErrorException:", e); |
| | | log.info("SQL Parameters: {}", boundSql.getParameterObject()); |
| | | log.info("Execute SqlId: {}", sqlId); |
| | | log.info("Completely Execute SQL: {}", getFullSql(configuration, boundSql)); |
| | | // æ ¹æ®æºå¼å¸¸ç±»åè¿è¡è¿å |
| | | if (e instanceof InvocationTargetException) { |
| | | throw new InvocationTargetException(e); |
| | | } else if (e instanceof IllegalAccessException) { |
| | | throw new IllegalAccessException(e.getMessage()); |
| | | } else { |
| | | throw new RuntimeException(e); |
| | | Object[] args = invocation.getArgs(); |
| | | if(args != null && args.length > 1){ |
| | | MappedStatement mappedStatement = (MappedStatement) args[0]; |
| | | Object parameter = args[1]; |
| | | |
| | | String sqlId = mappedStatement.getId(); |
| | | BoundSql boundSql = mappedStatement.getBoundSql(parameter); |
| | | Configuration configuration = mappedStatement.getConfiguration(); |
| | | Object response; |
| | | try { |
| | | response = invocation.proceed(); |
| | | } catch (Exception e) { |
| | | // è¾åºSQLå¼å¸¸ä¿¡æ¯ |
| | | log.error("SQL ErrorException:", e); |
| | | log.error("SQL Id: {}", sqlId); |
| | | log.error("SQL Parameters: {}", boundSql.getParameterObject()); |
| | | log.error("SQL: {}", PrintSqlHelp.getFullSql(configuration, boundSql)); |
| | | // æ ¹æ®æºå¼å¸¸ç±»åè¿è¡è¿å |
| | | if (e instanceof InvocationTargetException) { |
| | | throw new InvocationTargetException(e); |
| | | } else if (e instanceof IllegalAccessException) { |
| | | throw new IllegalAccessException(e.getMessage()); |
| | | } else { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | return response; |
| | | }else{ |
| | | return invocation.proceed(); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | /** |
| | |
| | | public void setProperties(Properties properties) { |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è½¬ä¹æ£åç¹æ®å符 ï¼$()*+.[]?\^{} |
| | | * \\éè¦ç¬¬ä¸ä¸ªæ¿æ¢ï¼å¦åreplaceæ¹æ³æ¿æ¢æ¶ä¼æé»è¾bug |
| | | */ |
| | | private static String makeQueryStringAllRegExp(String str) { |
| | | if (str != null && !"".equals(str)) { |
| | | return str.replace("\\", "\\\\") |
| | | .replace("*", "\\*") |
| | | .replace("+", "\\+") |
| | | .replace("|", "\\|") |
| | | .replace("{", "\\{") |
| | | .replace("}", "\\}") |
| | | .replace("(", "\\(") |
| | | .replace(")", "\\)") |
| | | .replace("^", "\\^") |
| | | .replace("$", "\\$") |
| | | .replace("[", "\\[") |
| | | .replace("]", "\\]") |
| | | .replace("?", "\\?") |
| | | .replace(",", "\\,") |
| | | .replace(".", "\\.") |
| | | .replace("&", "\\&"); |
| | | } |
| | | return str; |
| | | } |
| | | |
| | | /** |
| | | * è·å忰坹åºçstringå¼ |
| | | * |
| | | * @param obj 忰坹åºçå¼ |
| | | * @return string |
| | | */ |
| | | private static String getParameterValue(Object obj) { |
| | | String value; |
| | | if (obj instanceof String) { |
| | | value = "'" + obj + "'"; |
| | | } else if (obj instanceof Date) { |
| | | DateFormat formatter = |
| | | DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.CHINA); |
| | | value = "'" + formatter.format(obj) + "'"; |
| | | } else { |
| | | if (obj != null) { |
| | | value = obj.toString(); |
| | | } else { |
| | | value = ""; |
| | | } |
| | | } |
| | | // å¯¹ç¹æ®å符è¿è¡è½¬ä¹ï¼æ¹ä¾¿ä¹åå¤çæ¿æ¢ |
| | | return value != null ? makeQueryStringAllRegExp(value) : ""; |
| | | } |
| | | |
| | | /** |
| | | * è·å宿´çæ§è¡SQL |
| | | */ |
| | | public static String getFullSql(Configuration configuration, BoundSql boundSql) { |
| | | try { |
| | | return parseAndExtractFullSql(configuration, boundSql); |
| | | } catch (Exception e) { |
| | | // å¦æè§£æå¤±è´¥è¿ååå§SQL |
| | | return boundSql.getSql(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ç»è£
宿´çsqlè¯å¥å¹¶æå¯¹åºçåæ°é½ä»£å
¥å°sqlè¯å¥éé¢ |
| | | * |
| | | * @param configuration Configuration |
| | | * @param boundSql BoundSql |
| | | * @return sql宿´è¯å¥ |
| | | */ |
| | | private static String parseAndExtractFullSql(Configuration configuration, BoundSql boundSql) { |
| | | // è·åmapperé颿¹æ³ä¸çåæ° |
| | | Object sqlParameter = boundSql.getParameterObject(); |
| | | // sqlè¯å¥éé¢éè¦çåæ° |
| | | List<ParameterMapping> parameterMappings = boundSql.getParameterMappings(); |
| | | // sqlåå§è¯å¥(?è¿æ²¡ææ¿æ¢ææä»¬å
·ä½çåæ°) |
| | | String sql = boundSql.getSql().replaceAll("[\\s]+", " "); |
| | | if (!parameterMappings.isEmpty() && sqlParameter != null) { |
| | | // sqlè¯å¥éé¢ç?æ¿æ¢æçå®çåæ° |
| | | TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry(); |
| | | if (typeHandlerRegistry.hasTypeHandler(sqlParameter.getClass())) { |
| | | sql = sql.replaceFirst("\\?", getParameterValue(sqlParameter)); |
| | | } else { |
| | | MetaObject metaObject = configuration.newMetaObject(sqlParameter); |
| | | for (ParameterMapping parameterMapping : parameterMappings) { |
| | | // æé¡ºåºæ?æ¿æ¢æå¯¹åºçå¼ |
| | | String propertyName = parameterMapping.getProperty(); |
| | | if (metaObject.hasGetter(propertyName)) { |
| | | Object obj = metaObject.getValue(propertyName); |
| | | sql = sql.replaceFirst("\\?", getParameterValue(obj)); |
| | | } else if (boundSql.hasAdditionalParameter(propertyName)) { |
| | | Object obj = boundSql.getAdditionalParameter(propertyName); |
| | | sql = sql.replaceFirst("\\?", getParameterValue(obj)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return sql; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.common.mybatis; |
| | | |
| | | import org.apache.ibatis.mapping.BoundSql; |
| | | import org.apache.ibatis.mapping.ParameterMapping; |
| | | import org.apache.ibatis.reflection.MetaObject; |
| | | import org.apache.ibatis.session.Configuration; |
| | | import org.apache.ibatis.type.TypeHandlerRegistry; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/13 10:39 |
| | | * @Description |
| | | */ |
| | | public class PrintSqlHelp { |
| | | |
| | | /** |
| | | * è·å宿´çæ§è¡SQL |
| | | */ |
| | | public static String getFullSql(Configuration configuration, BoundSql boundSql) { |
| | | try { |
| | | return parseAndExtractFullSql(configuration, boundSql); |
| | | } catch (Exception e) { |
| | | // å¦æè§£æå¤±è´¥è¿ååå§SQL |
| | | return boundSql.getSql(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ç»è£
宿´çsqlè¯å¥å¹¶æå¯¹åºçåæ°é½ä»£å
¥å°sqlè¯å¥éé¢ |
| | | * |
| | | * @param configuration Configuration |
| | | * @param boundSql BoundSql |
| | | * @return sql宿´è¯å¥ |
| | | */ |
| | | private static String parseAndExtractFullSql(Configuration configuration, BoundSql boundSql) { |
| | | // è·åmapperé颿¹æ³ä¸çåæ° |
| | | Object sqlParameter = boundSql.getParameterObject(); |
| | | // sqlè¯å¥éé¢éè¦çåæ° |
| | | List<ParameterMapping> parameterMappings = boundSql.getParameterMappings(); |
| | | // sqlåå§è¯å¥(?è¿æ²¡ææ¿æ¢ææä»¬å
·ä½çåæ°) |
| | | String sql = boundSql.getSql().replaceAll("[\\s]+", " "); |
| | | if (!parameterMappings.isEmpty() && sqlParameter != null) { |
| | | // sqlè¯å¥éé¢ç?æ¿æ¢æçå®çåæ° |
| | | TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry(); |
| | | if (typeHandlerRegistry.hasTypeHandler(sqlParameter.getClass())) { |
| | | sql = sql.replaceFirst("\\?", getParameterValue(sqlParameter)); |
| | | } else { |
| | | MetaObject metaObject = configuration.newMetaObject(sqlParameter); |
| | | for (ParameterMapping parameterMapping : parameterMappings) { |
| | | // æé¡ºåºæ?æ¿æ¢æå¯¹åºçå¼ |
| | | String propertyName = parameterMapping.getProperty(); |
| | | if (metaObject.hasGetter(propertyName)) { |
| | | Object obj = metaObject.getValue(propertyName); |
| | | sql = sql.replaceFirst("\\?", getParameterValue(obj)); |
| | | } else if (boundSql.hasAdditionalParameter(propertyName)) { |
| | | Object obj = boundSql.getAdditionalParameter(propertyName); |
| | | sql = sql.replaceFirst("\\?", getParameterValue(obj)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return sql; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·å忰坹åºçstringå¼ |
| | | * |
| | | * @param obj 忰坹åºçå¼ |
| | | * @return string |
| | | */ |
| | | private static String getParameterValue(Object obj) { |
| | | String value; |
| | | if (obj instanceof String) { |
| | | value = "'" + obj + "'"; |
| | | } else if (obj instanceof Date) { |
| | | DateFormat formatter = |
| | | DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.CHINA); |
| | | value = "'" + formatter.format(obj) + "'"; |
| | | } else { |
| | | if (obj != null) { |
| | | value = obj.toString(); |
| | | } else { |
| | | value = ""; |
| | | } |
| | | } |
| | | // å¯¹ç¹æ®å符è¿è¡è½¬ä¹ï¼æ¹ä¾¿ä¹åå¤çæ¿æ¢ |
| | | return value != null ? makeQueryStringAllRegExp(value) : ""; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * è½¬ä¹æ£åç¹æ®å符 ï¼$()*+.[]?\^{} |
| | | * \\éè¦ç¬¬ä¸ä¸ªæ¿æ¢ï¼å¦åreplaceæ¹æ³æ¿æ¢æ¶ä¼æé»è¾bug |
| | | */ |
| | | private static String makeQueryStringAllRegExp(String str) { |
| | | if (str != null && !"".equals(str)) { |
| | | return str.replace("\\", "\\\\") |
| | | .replace("*", "\\*") |
| | | .replace("+", "\\+") |
| | | .replace("|", "\\|") |
| | | .replace("{", "\\{") |
| | | .replace("}", "\\}") |
| | | .replace("(", "\\(") |
| | | .replace(")", "\\)") |
| | | .replace("^", "\\^") |
| | | .replace("$", "\\$") |
| | | .replace("[", "\\[") |
| | | .replace("]", "\\]") |
| | | .replace("?", "\\?") |
| | | .replace(",", "\\,") |
| | | .replace(".", "\\.") |
| | | .replace("&", "\\&"); |
| | | } |
| | | return str; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.common.mybatis; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.executor.Executor; |
| | | import org.apache.ibatis.mapping.BoundSql; |
| | | import org.apache.ibatis.mapping.MappedStatement; |
| | | import org.apache.ibatis.plugin.Interceptor; |
| | | import org.apache.ibatis.plugin.Intercepts; |
| | | import org.apache.ibatis.plugin.Invocation; |
| | | import org.apache.ibatis.plugin.Signature; |
| | | import org.apache.ibatis.session.Configuration; |
| | | import org.apache.ibatis.session.ResultHandler; |
| | | import org.apache.ibatis.session.RowBounds; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/13 9:53 |
| | | * @Description |
| | | */ |
| | | /** |
| | | * æ¦æªæ§è¡SQLæ§è¡åºæ¯ï¼å¹¶å°SQLæå°åºæ¥ |
| | | * æ¦æªExecutoréé¢çqueryåupdateæ¹æ³ |
| | | */ |
| | | @Intercepts({ |
| | | @Signature( |
| | | method = "query", |
| | | type = Executor.class, |
| | | args = { |
| | | MappedStatement.class, |
| | | Object.class, |
| | | RowBounds.class, |
| | | ResultHandler.class |
| | | } |
| | | ), |
| | | @Signature( |
| | | type = Executor.class, |
| | | method = "update", |
| | | args = { |
| | | MappedStatement.class, |
| | | Object.class |
| | | } |
| | | ) |
| | | }) |
| | | @Slf4j |
| | | public class PrintSqlInterceptor implements Interceptor { |
| | | @Override |
| | | public Object intercept(Invocation invocation) throws Throwable { |
| | | Object[] args = invocation.getArgs(); |
| | | |
| | | if (args != null && args.length > 1) { |
| | | MappedStatement mappedStatement = (MappedStatement) args[0]; |
| | | Object parameter = args[1]; |
| | | |
| | | String sqlId = mappedStatement.getId(); |
| | | BoundSql boundSql = mappedStatement.getBoundSql(parameter); |
| | | Configuration configuration = mappedStatement.getConfiguration(); |
| | | log.info("\nSQL Id: " + sqlId + "\nSQL Parameters: " + boundSql.getParameterObject() + "\nSQL: " + PrintSqlHelp.getFullSql(configuration, boundSql) + "\n"); |
| | | } |
| | | |
| | | return invocation.proceed(); |
| | | } |
| | | |
| | | } |
| | |
| | | ////////////////////////////////////////////////////////////////////////// |
| | | |
| | | /** |
| | | * åç¬¦ä¸²åæ¥æ(2024-12)转æå¹´ææ¥æ°ç» |
| | | * @param yyyy_MM å¹´ææ¥ |
| | | * @return å¹´ææ¥æ°ç» |
| | | */ |
| | | public static int[] yyyy_MM_ymdGroup(String yyyy_MM){ |
| | | int y = Integer.parseInt(yyyy_MM.substring(0 , 4)) ; |
| | | int m = Integer.parseInt(yyyy_MM.substring(5 , 7)) ; |
| | | return new int[]{y,m} ; |
| | | } |
| | | |
| | | /** |
| | | * åç¬¦ä¸²åæ¥æ(2009-09-10)转æå¹´ææ¥æ°ç» |
| | | * @param yyyy_MM_DD å¹´ææ¥ |
| | | * @return å¹´ææ¥æ°ç» |
| | |
| | | import com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay; |
| | | import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay; |
| | | import com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount; |
| | | import com.dy.pipIrrGlobal.voSt.VoDayLoss; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics; |
| | | import com.dy.pipIrrGlobal.voSt.VoMonthAmount; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | * @return |
| | | */ |
| | | List<VoMonthAmount> getMonthIntakeAmount(Map<?, ?> params); |
| | | |
| | | //////////////////////////////////////////////// |
| | | // ç»è®¡æ¥è¯¢ |
| | | /////////////////////////////////////////////// |
| | | |
| | | /** |
| | | * 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼ç»è®¡åæ°´å£æ°é |
| | | * @param intakeN |
| | | * @return |
| | | */ |
| | | Long selectIntakeCount4AmountDay(@Param("intakeNum")String intakeN) ; |
| | | |
| | | /** |
| | | * 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼æ¥è¯¢ä¸é¡µåæ°´å£ID |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoDayIntakeAmount> selectIntakes4AmountDay(Map<?, ?> params) ; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æé |
| | | * @param params |
| | | * @return |
| | | */ |
| | | //ä¸é¢1å°31å·åäº6个æ¥è¯¢ï¼åå æ¯å
¥ä¸ä¸ªæ¥è¯¢ä¸ï¼é常æ
¢ï¼ä¸ç¥éä»ä¹åå ï¼ä¹è®¸æ¯åæ¥è¯¢å¤ªå¤çåå |
| | | List<VoDayIntakeAmount> selectIntakeAmountOfDay01_05(Map<?, ?> params); |
| | | List<VoDayIntakeAmount> selectIntakeAmountOfDay06_10(Map<?, ?> params); |
| | | List<VoDayIntakeAmount> selectIntakeAmountOfDay11_15(Map<?, ?> params); |
| | | List<VoDayIntakeAmount> selectIntakeAmountOfDay16_20(Map<?, ?> params); |
| | | List<VoDayIntakeAmount> selectIntakeAmountOfDay21_25(Map<?, ?> params); |
| | | List<VoDayIntakeAmount> selectIntakeAmountOfDay26_31(Map<?, ?> params); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoRm.RmLossDay; |
| | | import com.dy.pipIrrGlobal.voRm.VoLossDay; |
| | | import com.dy.pipIrrGlobal.voSt.VoDayLoss; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | * @return |
| | | */ |
| | | List<VoIntakeLossStatistics> statisticsByIntake(@Param("startId")Long statisticsStartId, @Param("endId")Long statisticsEndId) ; |
| | | |
| | | //////////////////////////////////////////////// |
| | | // ç»è®¡æ¥è¯¢ |
| | | /////////////////////////////////////////////// |
| | | |
| | | /** |
| | | * 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼ç»è®¡åæ°´å£æ°é |
| | | * @param intakeN |
| | | * @return |
| | | */ |
| | | Long selectIntakeCount4LossDay(@Param("intakeNum")String intakeN) ; |
| | | |
| | | /** |
| | | * 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼æ¥è¯¢ä¸é¡µåæ°´å£ID |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoDayLoss> selectIntakes4LossDay(Map<?, ?> params) ; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æé |
| | | * @param params |
| | | * @return |
| | | */ |
| | | //ä¸é¢1å°31å·åäº6个æ¥è¯¢ï¼åå æ¯å
¥ä¸ä¸ªæ¥è¯¢ä¸ï¼é常æ
¢ï¼ä¸ç¥éä»ä¹åå ï¼ä¹è®¸æ¯åæ¥è¯¢å¤ªå¤çåå |
| | | List<VoDayLoss> selectLossAmountOfDay01_05(Map<?, ?> params); |
| | | List<VoDayLoss> selectLossAmountOfDay06_10(Map<?, ?> params); |
| | | List<VoDayLoss> selectLossAmountOfDay11_15(Map<?, ?> params); |
| | | List<VoDayLoss> selectLossAmountOfDay16_20(Map<?, ?> params); |
| | | List<VoDayLoss> selectLossAmountOfDay21_25(Map<?, ?> params); |
| | | List<VoDayLoss> selectLossAmountOfDay26_31(Map<?, ?> params); |
| | | } |
| | |
| | | import com.dy.pipIrrGlobal.pojoSt.StLossMonth; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics; |
| | | import com.dy.pipIrrGlobal.voSt.VoMonthAmount; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | * @param year ç»è®¡å¹´åº¦ |
| | | * @return |
| | | */ |
| | | List<VoIntakeAmountStatistics> statisticsByIntake(Integer year, Integer month, Long startId, Long endId) ; |
| | | List<VoIntakeAmountStatistics> statisticsByIntake(@Param("year")Integer year, @Param("month")Integer month, @Param("startId")Long startId, @Param("endId")Long endId) ; |
| | | /** |
| | | * 以忰´å£ç»´åº¦ç»è®¡åæ°´é |
| | | * @param year ç»è®¡å¹´åº¦ |
| | | * @return |
| | | */ |
| | | List<VoIntakeAmountStatistics> statisticsByIntake(Integer year) ; |
| | | |
| | | |
| | | //////////////////////////////////////////////// |
| | | // ç»è®¡æ¥è¯¢ |
| | | /////////////////////////////////////////////// |
| | | |
| | | /** |
| | | * 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼ç»è®¡åæ°´å£æ°é |
| | | * @param intakeN |
| | | * @return |
| | | */ |
| | | Long selectIntakeCount4AmountMonth(@Param("intakeNum")String intakeN) ; |
| | | |
| | | /** |
| | | * 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼æ¥è¯¢ä¸é¡µåæ°´å£ID |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoMonthAmount> selectIntakes4AmountMonth(Map<?, ?> params) ; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»è®¡åæ°´å£ææ¼æé |
| | | * @param params |
| | | * @return |
| | | */ |
| | | //ä¸é¢1å°12æåäº2个æ¥è¯¢ï¼åå æ¯å¨ä¸ä¸ªæ¥è¯¢ä¸ï¼é常æ
¢ï¼ä¸ç¥éä»ä¹åå ï¼ä¹è®¸æ¯åæ¥è¯¢å¤ªå¤çåå |
| | | List<VoMonthAmount> selectIntakeAmountOfMonth01_06(Map<?, ?> params); |
| | | List<VoMonthAmount> selectIntakeAmountOfMonth07_12(Map<?, ?> params); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.pojoSt.StLossMonth; |
| | | import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics; |
| | | import com.dy.pipIrrGlobal.voSt.VoMonthAmount; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | |
| | | */ |
| | | List<VoIntakeLossStatistics> statisticsByIntake(Integer year) ; |
| | | |
| | | |
| | | //////////////////////////////////////////////// |
| | | // ç»è®¡æ¥è¯¢ |
| | | /////////////////////////////////////////////// |
| | | |
| | | /** |
| | | * 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼ç»è®¡åæ°´å£æ°é |
| | | * @param intakeN |
| | | * @return |
| | | */ |
| | | Long selectIntakeCount4LossMonth(@Param("intakeNum")String intakeN) ; |
| | | |
| | | /** |
| | | * 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼æ¥è¯¢ä¸é¡µåæ°´å£ID |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<VoMonthAmount> selectIntakes4LossMonth(Map<?, ?> params) ; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»è®¡åæ°´å£ææ¼æé |
| | | * @param params |
| | | * @return |
| | | */ |
| | | //ä¸é¢1å°12æåäº2个æ¥è¯¢ï¼åå æ¯å¨ä¸ä¸ªæ¥è¯¢ä¸ï¼é常æ
¢ï¼ä¸ç¥éä»ä¹åå ï¼ä¹è®¸æ¯åæ¥è¯¢å¤ªå¤çåå |
| | | List<VoMonthAmount> selectLossAmountOfMonth01_06(Map<?, ?> params); |
| | | List<VoMonthAmount> selectLossAmountOfMonth07_12(Map<?, ?> params); |
| | | |
| | | } |
| | |
| | | package com.dy.pipIrrGlobal.daoTmp; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dy.pipIrrGlobal.voTmp.VoStLossMonth; |
| | | import com.dy.pipIrrGlobal.voTmp.*; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | |
| | | public interface DeleteMapper extends BaseMapper<Object> { |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨æ¼ææç»è®¡ |
| | | * æ¥è¯¢å
¨é¨æ¼ææ¥ç»è®¡ |
| | | * |
| | | * @return å®ä½éå |
| | | */ |
| | | List<VoStLossMonth> selectAllStLossMonth() ; |
| | | List<VoStLossAmountDay> selectAllStLossDay(); |
| | | |
| | | int deleteByMainKey(Long id) ; |
| | | int deleteStLossDayById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨æ¼ææç»è®¡ |
| | | * |
| | | * @return å®ä½éå |
| | | */ |
| | | List<VoStLossAmountMonth> selectAllStLossMonth(); |
| | | |
| | | int deleteStLossMonthById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨æ¼æå¹´ç»è®¡ |
| | | * |
| | | * @return å®ä½éå |
| | | */ |
| | | List<VoStLossAmountYear> selectAllStLossYear(); |
| | | |
| | | int deleteStLossYearById(Long id); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨åæ°´å£æ¥ç»è®¡ |
| | | * |
| | | * @return å®ä½éå |
| | | */ |
| | | List<VoStIntakeAmountDay> selectAllStIntakeDay(); |
| | | |
| | | int deleteStIntakeDayById(Long id); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨åæ°´å£æç»è®¡ |
| | | * |
| | | * @return å®ä½éå |
| | | */ |
| | | List<VoStIntakeAmountMonth> selectAllStIntakeMonth(); |
| | | |
| | | int deleteStIntakeMonthById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨åæ°´å£å¹´ç»è®¡ |
| | | * |
| | | * @return å®ä½éå |
| | | */ |
| | | List<VoStIntakeAmountYear> selectAllStIntakeYear(); |
| | | |
| | | int deleteStIntakeYearById(Long id); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨åæ·æç»è®¡ |
| | | * |
| | | * @return å®ä½éå |
| | | */ |
| | | List<VoStClientAmountDay> selectAllStClientDay(); |
| | | |
| | | int deleteStClientDayById(Long id); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨åæ·æç»è®¡ |
| | | * |
| | | * @return å®ä½éå |
| | | */ |
| | | List<VoStClientAmountMonth> selectAllStClientMonth(); |
| | | |
| | | int deleteStClientMonthById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨åæ·å¹´ç»è®¡ |
| | | * |
| | | * @return å®ä½éå |
| | | */ |
| | | List<VoStClientAmountYear> selectAllStClientYear(); |
| | | |
| | | int deleteStClientYearById(Long id); |
| | | |
| | | } |
| | |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({ "intakeId", "intakeNum", "amount1" , "amount2" , "amount3" , "amount4" , "amount5" , "amount6" , "amount7" , "amount8" , "amount9" , "amount10" , "amount11" , "amount12" , "amount13" , "amount14" , "amount15" , "amount16" , "amount17" , "amount18" , "amount19" , "amount20" , "amount21" , "amount22" , "amount23" , "amount24" , "amount25" , "amount26" , "amount27" , "amount28" , "amount29" , "amount30" , "amount31" }) |
| | | @JsonPropertyOrder(value = { "intakeId", "intakeNum", "intakeLng", "intakeLat", |
| | | "amount1" , "amount2" , "amount3" , "amount4" , "amount5" , "amount6" , "amount7" , "amount8" , "amount9" , |
| | | "amount10" , "amount11" , "amount12" , "amount13" , "amount14" , "amount15" , "amount16" , "amount17" , "amount18" , "amount19" , |
| | | "amount20" , "amount21" , "amount22" , "amount23" , "amount24" , "amount25" , "amount26" , "amount27" , "amount28" , "amount29" , |
| | | "amount30" , "amount31" }, alphabetic = false) |
| | | public class VoDayIntakeAmount { |
| | | private static final long serialVersionUID = 202408080933001L; |
| | | public static final long serialVersionUID = 202408080933001L; |
| | | |
| | | /** |
| | | * åæ°´å£ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long intakeId; |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * åæ°´å£ç¼å· |
| | | */ |
| | | private String intakeNum; |
| | | public String intakeNum; |
| | | |
| | | /** |
| | | * ç»åº¦ |
| | | */ |
| | | public Double intakeLng; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | public Double intakeLat; |
| | | |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount1; |
| | | public Double amount1; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount2; |
| | | public Double amount2; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount3; |
| | | public Double amount3; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount4; |
| | | public Double amount4; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount5; |
| | | public Double amount5; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount6; |
| | | public Double amount6; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount7; |
| | | public Double amount7; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount8; |
| | | public Double amount8; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount9; |
| | | public Double amount9; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount10; |
| | | public Double amount10; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount11; |
| | | public Double amount11; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount12; |
| | | public Double amount12; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount13; |
| | | public Double amount13; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount14; |
| | | public Double amount14; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount15; |
| | | public Double amount15; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount16; |
| | | public Double amount16; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount17; |
| | | public Double amount17; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount18; |
| | | public Double amount18; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount19; |
| | | public Double amount19; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount20; |
| | | public Double amount20; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount21; |
| | | public Double amount21; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount22; |
| | | public Double amount22; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount23; |
| | | public Double amount23; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount24; |
| | | public Double amount24; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount25; |
| | | public Double amount25; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount26; |
| | | public Double amount26; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount27; |
| | | public Double amount27; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount28; |
| | | public Double amount28; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount29; |
| | | public Double amount29; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount30; |
| | | public Double amount30; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double amount31; |
| | | public Double amount31; |
| | | } |
| | |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({ "intakeId", "intakeNum", "lossAmount1" , "lossAmount2" , "lossAmount3" , "lossAmount4" , "lossAmount5" , "lossAmount6" , "lossAmount7" , "lossAmount8" , "lossAmount9" , "lossAmount10" , "lossAmount11" , "lossAmount12" , "lossAmount13" , "lossAmount14" , "lossAmount15" , "lossAmount16" , "lossAmount17" , "lossAmount18" , "lossAmount19" , "lossAmount20" , "lossAmount21" , "lossAmount22" , "lossAmount23" , "lossAmount24" , "lossAmount25" , "lossAmount26" , "lossAmount27" , "lossAmount28" , "lossAmount29" , "lossAmount30" , "lossAmount31" }) |
| | | @JsonPropertyOrder({ "intakeId", "intakeNum", "intakeLng", "intakeLat", "lossAmount1" , "lossAmount2" , "lossAmount3" , "lossAmount4" , "lossAmount5" , "lossAmount6" , "lossAmount7" , "lossAmount8" , "lossAmount9" , "lossAmount10" , "lossAmount11" , "lossAmount12" , "lossAmount13" , "lossAmount14" , "lossAmount15" , "lossAmount16" , "lossAmount17" , "lossAmount18" , "lossAmount19" , "lossAmount20" , "lossAmount21" , "lossAmount22" , "lossAmount23" , "lossAmount24" , "lossAmount25" , "lossAmount26" , "lossAmount27" , "lossAmount28" , "lossAmount29" , "lossAmount30" , "lossAmount31" }) |
| | | public class VoDayLoss { |
| | | private static final long serialVersionUID = 202408081523001L; |
| | | public static final long serialVersionUID = 202408081523001L; |
| | | |
| | | /** |
| | | * åæ°´å£ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long intakeId; |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * åæ°´å£ç¼å· |
| | | */ |
| | | private String intakeNum; |
| | | public String intakeNum; |
| | | |
| | | /** |
| | | * ç»åº¦ |
| | | */ |
| | | public Double intakeLng; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | public Double intakeLat; |
| | | |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount1; |
| | | public Double lossAmount1; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount2; |
| | | public Double lossAmount2; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount3; |
| | | public Double lossAmount3; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount4; |
| | | public Double lossAmount4; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount5; |
| | | public Double lossAmount5; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount6; |
| | | public Double lossAmount6; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount7; |
| | | public Double lossAmount7; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount8; |
| | | public Double lossAmount8; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount9; |
| | | public Double lossAmount9; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount10; |
| | | public Double lossAmount10; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount11; |
| | | public Double lossAmount11; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount12; |
| | | public Double lossAmount12; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount13; |
| | | public Double lossAmount13; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount14; |
| | | public Double lossAmount14; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount15; |
| | | public Double lossAmount15; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount16; |
| | | public Double lossAmount16; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount17; |
| | | public Double lossAmount17; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount18; |
| | | public Double lossAmount18; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount19; |
| | | public Double lossAmount19; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount20; |
| | | public Double lossAmount20; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount21; |
| | | public Double lossAmount21; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount22; |
| | | public Double lossAmount22; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount23; |
| | | public Double lossAmount23; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount24; |
| | | public Double lossAmount24; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount25; |
| | | public Double lossAmount25; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount26; |
| | | public Double lossAmount26; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount27; |
| | | public Double lossAmount27; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount28; |
| | | public Double lossAmount28; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount29; |
| | | public Double lossAmount29; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount30; |
| | | public Double lossAmount30; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double lossAmount31; |
| | | public Double lossAmount31; |
| | | } |
| | |
| | | */ |
| | | |
| | | @Data |
| | | @JsonPropertyOrder({ "intakeId", "intakeNum", "month1" , "month2" , "month3" , "month4" , "month5" , "month6" , "month7" , "month8" , "month9" , "month10" , "month11" , "month12" }) |
| | | @JsonPropertyOrder({ "intakeId", "intakeNum", "intakeLng", "intakeLat", "month1" , "month2" , "month3" , "month4" , "month5" , "month6" , "month7" , "month8" , "month9" , "month10" , "month11" , "month12" }) |
| | | public class VoMonthAmount { |
| | | private static final long serialVersionUID = 202408081417001L; |
| | | public static final long serialVersionUID = 202408081417001L; |
| | | |
| | | /** |
| | | * åæ°´å£ID |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | private Long intakeId; |
| | | public Long intakeId; |
| | | |
| | | /** |
| | | * åæ°´å£ç¼å· |
| | | */ |
| | | private String intakeNum; |
| | | public String intakeNum; |
| | | |
| | | /** |
| | | * ç»åº¦ |
| | | */ |
| | | public Double intakeLng; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | public Double intakeLat; |
| | | |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double month1; |
| | | public Double month1; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double month2; |
| | | public Double month2; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double month3; |
| | | public Double month3; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double month4; |
| | | public Double month4; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double month5; |
| | | public Double month5; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double month6; |
| | | public Double month6; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double month7; |
| | | public Double month7; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double month8; |
| | | public Double month8; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double month9; |
| | | public Double month9; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double month10; |
| | | public Double month10; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double month11; |
| | | public Double month11; |
| | | @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) |
| | | private Double month12; |
| | | public Double month12; |
| | | } |
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountDay.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/11 11:20 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VoStLossMonth { |
| | | public class VoStClientAmountDay { |
| | | public Long id ; |
| | | public Long intakeId ; |
| | | public Integer year ; |
| | | public Integer month ; |
| | | public Long clientId ; |
| | | public Date dt ; |
| | | public Double amount ; |
| | | } |
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountMonth.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java |
| | |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VoStLossMonth { |
| | | public class VoStClientAmountMonth { |
| | | public Long id ; |
| | | public Long intakeId ; |
| | | public Long clientId ; |
| | | public Integer year ; |
| | | public Integer month ; |
| | | public Double amount ; |
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountYear.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java |
| | |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VoStLossMonth { |
| | | public class VoStClientAmountYear { |
| | | public Long id ; |
| | | public Long intakeId ; |
| | | public Long clientId ; |
| | | public Integer year ; |
| | | public Integer month ; |
| | | public Double amount ; |
| | | } |
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountDay.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/11 11:20 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VoStLossMonth { |
| | | public class VoStIntakeAmountDay { |
| | | public Long id ; |
| | | public Long intakeId ; |
| | | public Integer year ; |
| | | public Integer month ; |
| | | public Date dt ; |
| | | public Double amount ; |
| | | } |
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountMonth.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java |
| | |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VoStLossMonth { |
| | | public class VoStIntakeAmountMonth { |
| | | public Long id ; |
| | | public Long intakeId ; |
| | | public Integer year ; |
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountYear.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java |
| | |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VoStLossMonth { |
| | | public class VoStIntakeAmountYear { |
| | | public Long id ; |
| | | public Long intakeId ; |
| | | public Integer year ; |
| | | public Integer month ; |
| | | public Double amount ; |
| | | } |
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossAmountDay.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/11 11:20 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VoStLossMonth { |
| | | public class VoStLossAmountDay { |
| | | public Long id ; |
| | | public Long intakeId ; |
| | | public Integer year ; |
| | | public Integer month ; |
| | | public Date dt ; |
| | | public Double amount ; |
| | | } |
File was renamed from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java |
| | |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VoStLossMonth { |
| | | public class VoStLossAmountMonth { |
| | | public Long id ; |
| | | public Long intakeId ; |
| | | public Integer year ; |
copy from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java
copy to pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossAmountYear.java
File was copied from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossMonth.java |
| | |
| | | * @Description |
| | | */ |
| | | @Data |
| | | public class VoStLossMonth { |
| | | public class VoStLossAmountYear { |
| | | public Long id ; |
| | | public Long intakeId ; |
| | | public Integer year ; |
| | | public Integer month ; |
| | | public Double amount ; |
| | | } |
| | |
| | | #type-aliases-package: com.dy.pipIrrGlobal.daoBa |
| | | configuration: |
| | | #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #æ¶èè¾åºæ¥å¿ï¼æ¶èä¸è¾åºæ¥å¿ |
| | | log-impl: org.apache.ibatis.logging.log4j2.Log4j2Impl |
| | | #log-impl: org.apache.ibatis.logging.log4j2.Log4j2Impl ä¸ååºç¨ï¼æ¹ä¸ºPrintSqlInterceptoræ¦æªå¨è¾åºsqlæ¥å¿ï¼ä¸é¢print-sql项é
ç½® |
| | | print-sql: true # è¾åºsqlæ¥å¿å¼å
³ï¼æ§å¶PrintSqlInterceptoræ¦æªå¨æ¯å¦å è½½ |
| | | #å¼å¯é©¼å³°uNameèªå¨æ å°å°u_name |
| | | #2023-10-24ç»å®éªï¼ä¸é¢é
ç½®trueæfalseï¼é½è½ä»u_nameæ å°å°uName |
| | | #map-underscore-to-camel-case: true |
| | |
| | | #type-aliases-package: com.dy.pipIrrGlobal.daoBa |
| | | configuration: |
| | | #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #æ¶èè¾åºæ¥å¿ï¼æ¶èä¸è¾åºæ¥å¿ |
| | | log-impl: org.apache.ibatis.logging.log4j2.Log4j2Impl |
| | | #log-impl: org.apache.ibatis.logging.log4j2.Log4j2Impl ä¸ååºç¨ï¼æ¹ä¸ºPrintSqlInterceptoræ¦æªå¨è¾åºsqlæ¥å¿ï¼ä¸é¢print-sql项é
ç½® |
| | | print-sql: true # è¾åºsqlæ¥å¿å¼å
³ï¼æ§å¶PrintSqlInterceptoræ¦æªå¨æ¯å¦å è½½ |
| | | #å¼å¯é©¼å³°uNameèªå¨æ å°å°u_name |
| | | #2023-10-24ç»å®éªï¼ä¸é¢é
ç½®trueæfalseï¼é½è½ä»u_nameæ å°å°uName |
| | | #map-underscore-to-camel-case: true |
| | |
| | | #type-aliases-package: com.dy.pipIrrGlobal.daoBa |
| | | configuration: |
| | | #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #æ¶èè¾åºæ¥å¿ï¼æ¶èä¸è¾åºæ¥å¿ |
| | | log-impl: org.apache.ibatis.logging.log4j2.Log4j2Impl |
| | | #log-impl: org.apache.ibatis.logging.log4j2.Log4j2Impl ä¸ååºç¨ï¼æ¹ä¸ºPrintSqlInterceptoræ¦æªå¨è¾åºsqlæ¥å¿ï¼ä¸é¢print-sql项é
ç½® |
| | | print-sql: true # è¾åºsqlæ¥å¿å¼å
³ï¼æ§å¶PrintSqlInterceptoræ¦æªå¨æ¯å¦å è½½ |
| | | #å¼å¯é©¼å³°uNameèªå¨æ å°å°u_name |
| | | #2023-10-24ç»å®éªï¼ä¸é¢é
ç½®trueæfalseï¼é½è½ä»u_nameæ å°å°uName |
| | | #map-underscore-to-camel-case: true |
| | |
| | | #type-aliases-package: com.dy.pipIrrGlobal.daoBa |
| | | configuration: |
| | | #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #æ¶èè¾åºæ¥å¿ï¼æ¶èä¸è¾åºæ¥å¿ |
| | | log-impl: org.apache.ibatis.logging.log4j2.Log4j2Impl |
| | | #log-impl: org.apache.ibatis.logging.log4j2.Log4j2Impl ä¸ååºç¨ï¼æ¹ä¸ºPrintSqlInterceptoræ¦æªå¨è¾åºsqlæ¥å¿ï¼ä¸é¢print-sql项é
ç½® |
| | | print-sql: true # è¾åºsqlæ¥å¿å¼å
³ï¼æ§å¶PrintSqlInterceptoræ¦æªå¨æ¯å¦å è½½ |
| | | #å¼å¯é©¼å³°uNameèªå¨æ å°å°u_name |
| | | #2023-10-24ç»å®éªï¼ä¸é¢é
ç½®trueæfalseï¼é½è½ä»u_nameæ å°å°uName |
| | | #map-underscore-to-camel-case: true |
| | |
| | | global: |
| | | dev: false #æ¯å¦å¼åé¶æ®µï¼trueæfalse |
| | | dsName: ym #å¼åé¶æ®µï¼è®¾ç½®ä¸´æ¶çæ°æ®åºåç§° |
| | | sql: |
| | | print: true #æ¯å¦æå°SQLè¯å¥ï¼trueæfalse |
| | | nginx: |
| | | webPort: 54321 |
| | | mw: |
| | |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼ç»è®¡åæ°´å£æ°é --> |
| | | <select id="selectIntakeCount4AmountDay" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) |
| | | FROM pr_intake tb |
| | | <where> |
| | | AND tb.deleted != 1 |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND tb.name = #{intakeNum} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!-- 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼æ¥è¯¢ä¸é¡µåæ°´å£ID --> |
| | | <select id="selectIntakes4AmountDay" resultType="com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount"> |
| | | SELECT id as intakeId, |
| | | name as intakeNum, |
| | | lat as intakeLat, |
| | | lng as intakeLng |
| | | FROM pr_intake |
| | | <where> |
| | | AND deleted != 1 |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND name = #{intakeNum} |
| | | </if> |
| | | </where> |
| | | order by id DESC |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start, javaType=Integer, jdbcType=INTEGER}, #{count, javaType=Integer, jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <sql id="selectIntakeAmountOfDay_with"> |
| | | SELECT intaId.intakeId AS intakeId, |
| | | riad.dt AS dt, |
| | | riad.amount AS amount |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId' |
| | | ) |
| | | ) intaId |
| | | INNER JOIN rm_intake_amount_day riad ON riad.intake_id = intaId.intakeId |
| | | <where> |
| | | <if test="startDt != null "> |
| | | AND riad.dt <![CDATA[>=]]> #{startDt, javaType=DATE, jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null "> |
| | | AND riad.dt <![CDATA[<=]]> #{endDt, javaType=DATE, jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | |
| | | <!--ç»è®¡æå®æä»½å天忰´é(1å·å°5å·)--> |
| | | <select id="selectIntakeAmountOfDay01_05" resultType="com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount"> |
| | | WITH intakeAmountDay AS (<include refid="selectIntakeAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb01.amount AS amount1, |
| | | tb02.amount AS amount2, |
| | | tb03.amount AS amount3, |
| | | tb04.amount AS amount4, |
| | | tb05.amount AS amount5 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 1 |
| | | ) as tb01 on tb01.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 2 |
| | | ) as tb02 on tb02.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 3 |
| | | ) as tb03 on tb03.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 4 |
| | | ) as tb04 on tb04.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 5 |
| | | ) as tb05 on tb05.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | |
| | | <!--ç»è®¡æå®æä»½å天忰´é(6å·å°10å·)--> |
| | | <select id="selectIntakeAmountOfDay06_10" resultType="com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount"> |
| | | WITH intakeAmountDay AS (<include refid="selectIntakeAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb06.amount AS amount6, |
| | | tb07.amount AS amount7, |
| | | tb08.amount AS amount8, |
| | | tb09.amount AS amount9, |
| | | tb10.amount AS amount10 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 6 |
| | | ) as tb06 on tb06.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 7 |
| | | ) as tb07 on tb07.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 8 |
| | | ) as tb08 on tb08.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 9 |
| | | ) as tb09 on tb09.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 10 |
| | | ) as tb10 on tb10.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | <!--ç»è®¡æå®æä»½å天忰´é(11å·å°15å·)--> |
| | | <select id="selectIntakeAmountOfDay11_15" resultType="com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount"> |
| | | WITH intakeAmountDay AS (<include refid="selectIntakeAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb11.amount AS amount11, |
| | | tb12.amount AS amount12, |
| | | tb13.amount AS amount13, |
| | | tb14.amount AS amount14, |
| | | tb15.amount AS amount15 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 11 |
| | | ) as tb11 on tb11.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 12 |
| | | ) as tb12 on tb12.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 13 |
| | | ) as tb13 on tb13.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 14 |
| | | ) as tb14 on tb14.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 15 |
| | | ) as tb15 on tb15.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | <!--ç»è®¡æå®æä»½å天忰´é(20å·å°16å·)--> |
| | | <select id="selectIntakeAmountOfDay16_20" resultType="com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount"> |
| | | WITH intakeAmountDay AS (<include refid="selectIntakeAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb16.amount AS amount16, |
| | | tb17.amount AS amount17, |
| | | tb18.amount AS amount18, |
| | | tb19.amount AS amount19, |
| | | tb20.amount AS amount20 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 16 |
| | | ) as tb16 on tb16.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 17 |
| | | ) as tb17 on tb17.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 18 |
| | | ) as tb18 on tb18.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 19 |
| | | ) as tb19 on tb19.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 20 |
| | | ) as tb20 on tb20.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | <!--ç»è®¡æå®æä»½å天忰´é(21å·å°25å·)--> |
| | | <select id="selectIntakeAmountOfDay21_25" resultType="com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount"> |
| | | WITH intakeAmountDay AS (<include refid="selectIntakeAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb21.amount AS amount21, |
| | | tb22.amount AS amount22, |
| | | tb23.amount AS amount23, |
| | | tb24.amount AS amount24, |
| | | tb25.amount AS amount25 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 21 |
| | | ) as tb21 on tb21.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 22 |
| | | ) as tb22 on tb22.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 23 |
| | | ) as tb23 on tb23.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 24 |
| | | ) as tb24 on tb24.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 25 |
| | | ) as tb25 on tb25.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | <!--ç»è®¡æå®æä»½å天忰´é(26å·å°31å·)--> |
| | | <select id="selectIntakeAmountOfDay26_31" resultType="com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount"> |
| | | WITH intakeAmountDay AS (<include refid="selectIntakeAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb26.amount AS amount26, |
| | | tb27.amount AS amount27, |
| | | tb28.amount AS amount28, |
| | | tb29.amount AS amount29, |
| | | tb30.amount AS amount30, |
| | | tb31.amount AS amount31 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 26 |
| | | ) as tb26 on tb26.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 27 |
| | | ) as tb27 on tb27.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 28 |
| | | ) as tb28 on tb28.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 29 |
| | | ) as tb29 on tb29.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 30 |
| | | ) as tb30 on tb30.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 31 |
| | | ) as tb31 on tb31.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | where id <![CDATA[>=]]> #{startId, jdbcType=BIGINT} and id <![CDATA[<]]> #{endId, jdbcType=BIGINT} |
| | | group by intake_id |
| | | </select> |
| | | |
| | | <!-- 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼ç»è®¡åæ°´å£æ°é --> |
| | | <select id="selectIntakeCount4LossDay" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) |
| | | FROM pr_intake tb |
| | | <where> |
| | | AND tb.deleted != 1 |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND tb.name = #{intakeNum} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!-- 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼æ¥è¯¢ä¸é¡µåæ°´å£ID --> |
| | | <select id="selectIntakes4LossDay" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | SELECT id as intakeId, |
| | | name as intakeNum, |
| | | lat as intakeLat, |
| | | lng as intakeLng |
| | | FROM pr_intake |
| | | <where> |
| | | AND deleted != 1 |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND name = #{intakeNum} |
| | | </if> |
| | | </where> |
| | | order by id DESC |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start, javaType=Integer, jdbcType=INTEGER}, #{count, javaType=Integer, jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | |
| | | <!--ç»è®¡æå®æä»½åå¤©æ¼æé ææ¶æªç¨ åæ¶¦ç 2024-12-12--> |
| | | <select id="temp" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | rld.id AS id, |
| | | rld.dt AS dt, |
| | | rld.loss_amount AS lossAmount1 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN |
| | | ( |
| | | select id, intake_id, dt, loss_amount |
| | | from rm_loss_day |
| | | <where> |
| | | <if test="startDt != null "> |
| | | AND dt <![CDATA[>=]]> #{startDt, javaType=DATE, jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null "> |
| | | AND dt <![CDATA[<]]> #{endDt, javaType=DATE, jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | order by intake_id DESC, id ASC |
| | | ) as rld ON rld.intake_id = inta.intakeId |
| | | </select> |
| | | |
| | | |
| | | <sql id="selectLossAmountOfDay_with"> |
| | | SELECT intaId.intakeId AS intakeId, |
| | | rld.dt AS dt, |
| | | rld.loss_amount AS lossAmount |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId' |
| | | ) |
| | | ) intaId |
| | | INNER JOIN rm_loss_day rld ON rld.intake_id = intaId.intakeId |
| | | <where> |
| | | <if test="startDt != null "> |
| | | AND rld.dt <![CDATA[>=]]> #{startDt, javaType=DATE, jdbcType=DATE} |
| | | </if> |
| | | <if test="endDt != null "> |
| | | AND rld.dt <![CDATA[<=]]> #{endDt, javaType=DATE, jdbcType=DATE} |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | |
| | | <!--ç»è®¡æå®æä»½åå¤©æ¼æé(1å·å°5å·)--> |
| | | <select id="selectLossAmountOfDay01_05" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | WITH intakeLossAmountDay AS (<include refid="selectLossAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb01.lossAmount AS lossAmount1, |
| | | tb02.lossAmount AS lossAmount2, |
| | | tb03.lossAmount AS lossAmount3, |
| | | tb04.lossAmount AS lossAmount4, |
| | | tb05.lossAmount AS lossAmount5 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 1 |
| | | ) as tb01 on tb01.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 2 |
| | | ) as tb02 on tb02.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 3 |
| | | ) as tb03 on tb03.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 4 |
| | | ) as tb04 on tb04.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 5 |
| | | ) as tb05 on tb05.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | |
| | | <!--ç»è®¡æå®æä»½åå¤©æ¼æé(6å·å°10å·)--> |
| | | <select id="selectLossAmountOfDay06_10" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | WITH intakeLossAmountDay AS (<include refid="selectLossAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb06.lossAmount AS lossAmount6, |
| | | tb07.lossAmount AS lossAmount7, |
| | | tb08.lossAmount AS lossAmount8, |
| | | tb09.lossAmount AS lossAmount9, |
| | | tb10.lossAmount AS lossAmount10 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 6 |
| | | ) as tb06 on tb06.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 7 |
| | | ) as tb07 on tb07.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 8 |
| | | ) as tb08 on tb08.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 9 |
| | | ) as tb09 on tb09.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 10 |
| | | ) as tb10 on tb10.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | <!--ç»è®¡æå®æä»½åå¤©æ¼æé(11å·å°15å·)--> |
| | | <select id="selectLossAmountOfDay11_15" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | WITH intakeLossAmountDay AS (<include refid="selectLossAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb11.lossAmount AS lossAmount11, |
| | | tb12.lossAmount AS lossAmount12, |
| | | tb13.lossAmount AS lossAmount13, |
| | | tb14.lossAmount AS lossAmount14, |
| | | tb15.lossAmount AS lossAmount15 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 11 |
| | | ) as tb11 on tb11.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 12 |
| | | ) as tb12 on tb12.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 13 |
| | | ) as tb13 on tb13.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 14 |
| | | ) as tb14 on tb14.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 15 |
| | | ) as tb15 on tb15.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | <!--ç»è®¡æå®æä»½åå¤©æ¼æé(20å·å°16å·)--> |
| | | <select id="selectLossAmountOfDay16_20" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | WITH intakeLossAmountDay AS (<include refid="selectLossAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb16.lossAmount AS lossAmount16, |
| | | tb17.lossAmount AS lossAmount17, |
| | | tb18.lossAmount AS lossAmount18, |
| | | tb19.lossAmount AS lossAmount19, |
| | | tb20.lossAmount AS lossAmount20 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 16 |
| | | ) as tb16 on tb16.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 17 |
| | | ) as tb17 on tb17.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 18 |
| | | ) as tb18 on tb18.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 19 |
| | | ) as tb19 on tb19.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 20 |
| | | ) as tb20 on tb20.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | <!--ç»è®¡æå®æä»½åå¤©æ¼æé(21å·å°25å·)--> |
| | | <select id="selectLossAmountOfDay21_25" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | WITH intakeLossAmountDay AS (<include refid="selectLossAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb21.lossAmount AS lossAmount21, |
| | | tb22.lossAmount AS lossAmount22, |
| | | tb23.lossAmount AS lossAmount23, |
| | | tb24.lossAmount AS lossAmount24, |
| | | tb25.lossAmount AS lossAmount25 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 21 |
| | | ) as tb21 on tb21.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 22 |
| | | ) as tb22 on tb22.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 23 |
| | | ) as tb23 on tb23.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 24 |
| | | ) as tb24 on tb24.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 25 |
| | | ) as tb25 on tb25.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | <!--ç»è®¡æå®æä»½åå¤©æ¼æé(26å·å°31å·)--> |
| | | <select id="selectLossAmountOfDay26_31" resultType="com.dy.pipIrrGlobal.voSt.VoDayLoss"> |
| | | WITH intakeLossAmountDay AS (<include refid="selectLossAmountOfDay_with"/>) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb26.lossAmount AS lossAmount26, |
| | | tb27.lossAmount AS lossAmount27, |
| | | tb28.lossAmount AS lossAmount28, |
| | | tb29.lossAmount AS lossAmount29, |
| | | tb30.lossAmount AS lossAmount30, |
| | | tb31.lossAmount AS lossAmount31 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 26 |
| | | ) as tb26 on tb26.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 27 |
| | | ) as tb27 on tb27.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 28 |
| | | ) as tb28 on tb28.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 29 |
| | | ) as tb29 on tb29.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 30 |
| | | ) as tb30 on tb30.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.lossAmount AS lossAmount |
| | | FROM intakeLossAmountDay AS tb |
| | | WHERE YEAR(tb.dt) = #{year} |
| | | AND MONTH(tb.dt) = #{month} |
| | | AND DAY(tb.dt) = 31 |
| | | ) as tb31 on tb31.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | group by intake_id |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 为æ¥è¯¢ç»è®¡åæ°´å£æ¥ç¨æ°´éï¼ç»è®¡åæ°´å£æ°é --> |
| | | <select id="selectIntakeCount4AmountMonth" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) |
| | | FROM pr_intake tb |
| | | <where> |
| | | AND tb.deleted != 1 |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND tb.name = #{intakeNum} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!-- 为æ¥è¯¢ç»è®¡åæ°´å£æ¥ç¨æ°´éï¼æ¥è¯¢ä¸é¡µåæ°´å£ID --> |
| | | <select id="selectIntakes4AmountMonth" resultType="com.dy.pipIrrGlobal.voSt.VoMonthAmount"> |
| | | SELECT id as intakeId, |
| | | name as intakeNum, |
| | | lat as intakeLat, |
| | | lng as intakeLng |
| | | FROM pr_intake |
| | | <where> |
| | | AND deleted != 1 |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND name = #{intakeNum} |
| | | </if> |
| | | </where> |
| | | order by id DESC |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start, javaType=Integer, jdbcType=INTEGER}, #{count, javaType=Integer, jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <sql id="selectIntakeAmountOfMonth_with"> |
| | | SELECT intaId.intakeId AS intakeId, |
| | | siam.year AS `year`, |
| | | siam.month AS `month`, |
| | | siam.amount AS amount |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId' |
| | | ) |
| | | ) intaId |
| | | INNER JOIN st_intake_amount_month siam ON siam.intake_id = intaId.intakeId |
| | | <where> |
| | | <if test="year != null "> |
| | | AND siam.year = #{year, javaType=Integer, jdbcType=INTEGER} |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | |
| | | <!--ç»è®¡æå®æä»½åæç¨æ°´é(1å·å°6æ)--> |
| | | <select id="selectIntakeAmountOfMonth01_06" resultType="com.dy.pipIrrGlobal.voSt.VoMonthAmount"> |
| | | WITH intakeAmountMonth AS (<include refid="selectIntakeAmountOfMonth_with" />) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb01.amount AS month1, |
| | | tb02.amount AS month2, |
| | | tb03.amount AS month3, |
| | | tb04.amount AS month4, |
| | | tb05.amount AS month5, |
| | | tb06.amount AS month6 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 1 |
| | | ) as tb01 on tb01.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 2 |
| | | ) as tb02 on tb02.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 3 |
| | | ) as tb03 on tb03.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 4 |
| | | ) as tb04 on tb04.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 5 |
| | | ) as tb05 on tb05.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 6 |
| | | ) as tb06 on tb06.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | <!--ç»è®¡æå®æä»½åæç¨æ°´é(7å·å°12æ)--> |
| | | <select id="selectIntakeAmountOfMonth07_12" resultType="com.dy.pipIrrGlobal.voSt.VoMonthAmount"> |
| | | WITH intakeAmountMonth AS (<include refid="selectIntakeAmountOfMonth_with" />) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb07.amount AS month7, |
| | | tb08.amount AS month8, |
| | | tb09.amount AS month9, |
| | | tb010.amount AS month10, |
| | | tb011.amount AS month11, |
| | | tb012.amount AS month12 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 7 |
| | | ) as tb07 on tb07.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 8 |
| | | ) as tb08 on tb08.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 9 |
| | | ) as tb09 on tb09.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 10 |
| | | ) as tb010 on tb010.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 11 |
| | | ) as tb011 on tb011.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 12 |
| | | ) as tb012 on tb012.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | group by intake_id |
| | | </select> |
| | | |
| | | |
| | | <!-- 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼ç»è®¡åæ°´å£æ°é --> |
| | | <select id="selectIntakeCount4LossMonth" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) |
| | | FROM pr_intake tb |
| | | <where> |
| | | AND tb.deleted != 1 |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND tb.name = #{intakeNum} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!-- 为æ¥è¯¢ç»è®¡åæ°´å£æ¥æ¼æéï¼æ¥è¯¢ä¸é¡µåæ°´å£ID --> |
| | | <select id="selectIntakes4LossMonth" resultType="com.dy.pipIrrGlobal.voSt.VoMonthAmount"> |
| | | SELECT id as intakeId, |
| | | name as intakeNum, |
| | | lat as intakeLat, |
| | | lng as intakeLng |
| | | FROM pr_intake |
| | | <where> |
| | | AND deleted != 1 |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND name = #{intakeNum} |
| | | </if> |
| | | </where> |
| | | order by id DESC |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start, javaType=Integer, jdbcType=INTEGER}, #{count, javaType=Integer, jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <sql id="selectLossAmountOfMonth_with"> |
| | | SELECT intaId.intakeId AS intakeId, |
| | | sld.year AS `year`, |
| | | sld.month AS `month`, |
| | | sld.amount AS amount |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId' |
| | | ) |
| | | ) intaId |
| | | INNER JOIN st_loss_month sld ON sld.intake_id = intaId.intakeId |
| | | <where> |
| | | <if test="year != null "> |
| | | AND sld.year = #{year, javaType=Integer, jdbcType=INTEGER} |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | |
| | | <!--ç»è®¡æå®æä»½åææ¼æé(1å·å°6æ)--> |
| | | <select id="selectLossAmountOfMonth01_06" resultType="com.dy.pipIrrGlobal.voSt.VoMonthAmount"> |
| | | WITH intakeLossAmountMonth AS (<include refid="selectLossAmountOfMonth_with" />) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb01.amount AS month1, |
| | | tb02.amount AS month2, |
| | | tb03.amount AS month3, |
| | | tb04.amount AS month4, |
| | | tb05.amount AS month5, |
| | | tb06.amount AS month6 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeLossAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 1 |
| | | ) as tb01 on tb01.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeLossAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 2 |
| | | ) as tb02 on tb02.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeLossAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 3 |
| | | ) as tb03 on tb03.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeLossAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 4 |
| | | ) as tb04 on tb04.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeLossAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 5 |
| | | ) as tb05 on tb05.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeLossAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 6 |
| | | ) as tb06 on tb06.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | <!--ç»è®¡æå®æä»½åææ¼æé(7å·å°12æ)--> |
| | | <select id="selectLossAmountOfMonth07_12" resultType="com.dy.pipIrrGlobal.voSt.VoMonthAmount"> |
| | | WITH intakeLossAmountMonth AS (<include refid="selectLossAmountOfMonth_with" />) |
| | | SELECT inta.intakeId AS intakeId, |
| | | inta.intakeNum AS intakeNum, |
| | | inta.intakeLng AS intakeLng, |
| | | inta.intakeLat AS intakeLat, |
| | | tb07.amount AS month7, |
| | | tb08.amount AS month8, |
| | | tb09.amount AS month9, |
| | | tb010.amount AS month10, |
| | | tb011.amount AS month11, |
| | | tb012.amount AS month12 |
| | | FROM JSON_TABLE( |
| | | #{intakesJson}, |
| | | '$[*]' COLUMNS ( |
| | | intakeId BIGINT PATH '$.intakeId', |
| | | intakeNum VARCHAR(100) PATH '$.intakeNum', |
| | | intakeLng DOUBLE PATH '$.intakeLng', |
| | | intakeLat DOUBLE PATH '$.intakeLat' |
| | | ) |
| | | ) inta |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeLossAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 7 |
| | | ) as tb07 on tb07.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeLossAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 8 |
| | | ) as tb08 on tb08.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeLossAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 9 |
| | | ) as tb09 on tb09.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeLossAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 10 |
| | | ) as tb010 on tb010.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeLossAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 11 |
| | | ) as tb011 on tb011.intakeId = inta.intakeId |
| | | LEFT JOIN ( |
| | | SELECT tb.intakeId AS intakeId, |
| | | tb.amount AS amount |
| | | FROM intakeLossAmountMonth AS tb |
| | | WHERE tb.year = #{year} |
| | | AND tb.month = 12 |
| | | ) as tb012 on tb012.intakeId = inta.intakeId |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dy.pipIrrGlobal.daoTmp.DeleteMapper"> |
| | | <select id="selectAllStLossMonth" resultType="com.dy.pipIrrGlobal.voTmp.VoStLossMonth"> |
| | | select id as id, |
| | | intake_id as intakeId , |
| | | year as year, |
| | | month as month, |
| | | amount as amount |
| | | from st_loss_month |
| | | order by id DESC, intake_id DESC, year DESC, month DESC |
| | | </select> |
| | | <!-- æ¼æç»è®¡ç¸å
³ --> |
| | | <select id="selectAllStLossDay" resultType="com.dy.pipIrrGlobal.voTmp.VoStLossAmountDay"> |
| | | select id as id, |
| | | intake_id as intakeId , |
| | | dt as dt, |
| | | loss_amount as amount |
| | | from rm_loss_day |
| | | order by intake_id DESC, id DESC |
| | | </select> |
| | | |
| | | <delete id="deleteByMainKey" parameterType="java.lang.Long"> |
| | | delete from st_loss_year |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <delete id="deleteStLossDayById" parameterType="java.lang.Long"> |
| | | delete from rm_loss_day |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <select id="selectAllStLossMonth" resultType="com.dy.pipIrrGlobal.voTmp.VoStLossAmountMonth"> |
| | | select id as id, |
| | | intake_id as intakeId , |
| | | year as year, |
| | | month as month, |
| | | amount as amount |
| | | from st_loss_month |
| | | order by intake_id DESC, id DESC |
| | | </select> |
| | | |
| | | <delete id="deleteStLossMonthById" parameterType="java.lang.Long"> |
| | | delete from st_loss_month |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <select id="selectAllStLossYear" resultType="com.dy.pipIrrGlobal.voTmp.VoStLossAmountYear"> |
| | | select id as id, |
| | | intake_id as intakeId , |
| | | year as year, |
| | | amount as amount |
| | | from st_loss_year |
| | | order by intake_id DESC, id DESC |
| | | </select> |
| | | |
| | | <delete id="deleteStLossYearById" parameterType="java.lang.Long"> |
| | | delete from st_loss_year |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | |
| | | |
| | | <!-- åæ°´å£ç»è®¡ç¸å
³ --> |
| | | <select id="selectAllStIntakeDay" resultType="com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountDay"> |
| | | select id as id, |
| | | intake_id as intakeId , |
| | | dt as dt, |
| | | amount as amount |
| | | from rm_intake_amount_day |
| | | order by intake_id DESC, id DESC |
| | | </select> |
| | | |
| | | <delete id="deleteStIntakeDayById" parameterType="java.lang.Long"> |
| | | delete from rm_intake_amount_day |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <select id="selectAllStIntakeMonth" resultType="com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountMonth"> |
| | | select id as id, |
| | | intake_id as intakeId , |
| | | year as year, |
| | | month as month, |
| | | amount as amount |
| | | from st_intake_amount_month |
| | | order by intake_id DESC, id DESC |
| | | </select> |
| | | |
| | | <delete id="deleteStIntakeMonthById" parameterType="java.lang.Long"> |
| | | delete from st_intake_amount_month |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <select id="selectAllStIntakeYear" resultType="com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountYear"> |
| | | select id as id, |
| | | intake_id as intakeId , |
| | | year as year, |
| | | amount as amount |
| | | from st_intake_amount_year |
| | | order by intake_id DESC, id DESC |
| | | </select> |
| | | |
| | | <delete id="deleteStIntakeYearById" parameterType="java.lang.Long"> |
| | | delete from st_intake_amount_year |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | |
| | | |
| | | <!-- åæ·ç»è®¡ç¸å
³ --> |
| | | <select id="selectAllStClientDay" resultType="com.dy.pipIrrGlobal.voTmp.VoStClientAmountDay"> |
| | | select id as id, |
| | | client_id as clientId , |
| | | dt as dt, |
| | | amount as amount |
| | | from rm_client_amount_day |
| | | order by client_id DESC, id DESC |
| | | </select> |
| | | |
| | | <delete id="deleteStClientDayById" parameterType="java.lang.Long"> |
| | | delete from rm_client_amount_day |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <select id="selectAllStClientMonth" resultType="com.dy.pipIrrGlobal.voTmp.VoStClientAmountMonth"> |
| | | select id as id, |
| | | client_id as clientId , |
| | | year as year, |
| | | month as month, |
| | | amount as amount |
| | | from st_client_amount_month |
| | | order by client_id DESC, id DESC |
| | | </select> |
| | | |
| | | <delete id="deleteStClientMonthById" parameterType="java.lang.Long"> |
| | | delete from st_client_amount_month |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <select id="selectAllStClientYear" resultType="com.dy.pipIrrGlobal.voTmp.VoStClientAmountYear"> |
| | | select id as id, |
| | | client_id as clientId , |
| | | year as year, |
| | | amount as amount |
| | | from st_client_amount_year |
| | | order by client_id DESC, id DESC |
| | | </select> |
| | | |
| | | <delete id="deleteStClientYearById" parameterType="java.lang.Long"> |
| | | delete from st_client_amount_year |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢RTUå¨éä¿¡ä¸é´ä»¶ä¸çæ¯è¡ç¶æ |
| | | * æ¥è¯¢RTUå¨éä¿¡ä¸é´ä»¶ä¸çå¨çº¿ç¶æ |
| | | * @param rtuAddr |
| | | * @return |
| | | */ |
New file |
| | |
| | | package com.dy.pipIrrStatistics.intaker; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.util.DateTime; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount; |
| | | import com.dy.pipIrrGlobal.voSt.VoMonthAmount; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/12 16:24 |
| | | * @Description æå
³åæ°´å£ç¨æ°´ç»è®¡ |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path="intake") |
| | | @RequiredArgsConstructor |
| | | public class IntakerCtrl { |
| | | |
| | | private IntakerSv sv; |
| | | |
| | | @Autowired |
| | | public void setSv(IntakerSv sv){ |
| | | this.sv = sv ; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æå®æä»½åæ¥ç¨æ°´é |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/amountOfDay") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoDayIntakeAmount>>> amountOfDay(IntakerQo qo) throws Exception { |
| | | String yearMonth = qo.getYearMonth(); |
| | | if(yearMonth == null || yearMonth.trim().equals("")) { |
| | | return BaseResponseUtils.buildErrorMsg("æ¥è¯¢æ¡ä»¶å¹´æä¸è½ä¸ºç©º"); |
| | | } |
| | | qo.startDt = DateTime.dateFrom_yyyy_MM_dd(yearMonth + "-01"); |
| | | qo.endDt = DateTime.dateFrom_yyyy_MM_dd(yearMonth + "-31"); |
| | | |
| | | int[] ymd = DateTime.yyyy_MM_ymdGroup(yearMonth) ; |
| | | qo.year = ymd[0] ; |
| | | qo.month = ymd[1] ; |
| | | |
| | | return BaseResponseUtils.buildSuccess(this.sv.amountOfDay(qo)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æå®æä»½åæ¥ç¨æ°´é |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/amountOfMonth") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoMonthAmount>>> amountOfMonth(IntakerQo qo) throws Exception { |
| | | if(qo.getYear() == null) { |
| | | return BaseResponseUtils.buildErrorMsg("æ¥è¯¢æ¡ä»¶å¹´åº¦ä¸è½ä¸ºç©º"); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(this.sv.amountOfMonth(qo)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.intaker; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/12 16:34 |
| | | * @Description |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class IntakerQo extends QueryConditionVo { |
| | | |
| | | /** |
| | | * ç»è®¡å¹´æ |
| | | */ |
| | | public String yearMonth; |
| | | |
| | | /** |
| | | * æ¥è¯¢å¼å§æ¥æï¼å¹´ææ¥ï¼ |
| | | */ |
| | | public Date startDt ; |
| | | |
| | | /** |
| | | * æ¥è¯¢æªæ¢æ¥æï¼å¹´ææ¥ï¼ |
| | | */ |
| | | public Date endDt ; |
| | | |
| | | |
| | | /** |
| | | * å¹´ |
| | | */ |
| | | public Integer year; |
| | | |
| | | /** |
| | | * æ |
| | | */ |
| | | public Integer month; |
| | | |
| | | /** |
| | | * åæ°´å£ç¼å· |
| | | */ |
| | | public String intakeNum; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.intaker; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoRm.RmIntakeAmountDayMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StIntakeAmountMonthMapper; |
| | | import com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount; |
| | | import com.dy.pipIrrGlobal.voSt.VoMonthAmount; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/12 16:24 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class IntakerSv { |
| | | |
| | | @Autowired |
| | | private RmIntakeAmountDayMapper dayDao ; |
| | | |
| | | @Autowired |
| | | private StIntakeAmountMonthMapper monthDao ; |
| | | |
| | | |
| | | /** |
| | | * ç»è®¡æå®æä»½åå¤©ç¨æ°´é |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoDayIntakeAmount>> amountOfDay(IntakerQo qo) throws ParseException { |
| | | QueryResultVo<List<VoDayIntakeAmount>> rsVo = new QueryResultVo<>() ; |
| | | // çææ¥è¯¢åæ° |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; |
| | | // è·åç¬¦åæ¡ä»¶çè®°å½æ° |
| | | Long itemTotal = dayDao.selectIntakeCount4AmountDay(qo.intakeNum) ; |
| | | |
| | | if(itemTotal != null && itemTotal > 0){ |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | |
| | | List<VoDayIntakeAmount> list = dayDao.selectIntakes4AmountDay(params); |
| | | if(list == null || list.size() == 0){ |
| | | rsVo.obj = list ; |
| | | }else{ |
| | | String json = JSON.toJSONString(list) ; |
| | | params.put("intakesJson", json); |
| | | |
| | | List<VoDayIntakeAmount> list01_05 = dayDao.selectIntakeAmountOfDay01_05(params); |
| | | if(list01_05 != null && list01_05.size() > 0){ |
| | | //ä¸é¢1å°31å·åäº6个æ¥è¯¢ï¼åå æ¯å¨ä¸ä¸ªæ¥è¯¢ä¸ï¼é常æ
¢ï¼ä¸ç¥éä»ä¹åå ï¼ä¹è®¸æ¯åæ¥è¯¢å¤ªå¤çåå |
| | | List<VoDayIntakeAmount> list06_10 = dayDao.selectIntakeAmountOfDay06_10(params); |
| | | List<VoDayIntakeAmount> list11_15 = dayDao.selectIntakeAmountOfDay11_15(params); |
| | | List<VoDayIntakeAmount> list16_20 = dayDao.selectIntakeAmountOfDay16_20(params); |
| | | List<VoDayIntakeAmount> list21_25 = dayDao.selectIntakeAmountOfDay21_25(params); |
| | | List<VoDayIntakeAmount> list26_31 = dayDao.selectIntakeAmountOfDay26_31(params); |
| | | this.merge(list01_05, list06_10, list11_15, list16_20, list21_25, list26_31); |
| | | } |
| | | rsVo.obj = list01_05 ; |
| | | } |
| | | } |
| | | return rsVo ; |
| | | } |
| | | |
| | | private void merge(List<VoDayIntakeAmount> list01_05, |
| | | List<VoDayIntakeAmount> list06_10, |
| | | List<VoDayIntakeAmount> list11_15, |
| | | List<VoDayIntakeAmount> list16_20, |
| | | List<VoDayIntakeAmount> list21_25, |
| | | List<VoDayIntakeAmount> list26_31){ |
| | | for(VoDayIntakeAmount vo01_05 : list01_05){ |
| | | for(VoDayIntakeAmount vo06_10 : list06_10){ |
| | | if(vo01_05.intakeId.longValue() == vo06_10.intakeId.longValue()){ |
| | | vo01_05.amount6 = vo06_10.amount6 ; |
| | | vo01_05.amount7 = vo06_10.amount7 ; |
| | | vo01_05.amount8 = vo06_10.amount8 ; |
| | | vo01_05.amount9 = vo06_10.amount9 ; |
| | | vo01_05.amount10 = vo06_10.amount10 ; |
| | | break ; |
| | | } |
| | | } |
| | | for(VoDayIntakeAmount vo11_15 : list11_15){ |
| | | if(vo01_05.intakeId.longValue() == vo11_15.intakeId.longValue()){ |
| | | vo01_05.amount11 = vo11_15.amount11 ; |
| | | vo01_05.amount12 = vo11_15.amount12 ; |
| | | vo01_05.amount13 = vo11_15.amount13 ; |
| | | vo01_05.amount14 = vo11_15.amount14 ; |
| | | vo01_05.amount15 = vo11_15.amount15 ; |
| | | break ; |
| | | } |
| | | } |
| | | for(VoDayIntakeAmount vo16_20 : list16_20){ |
| | | if(vo01_05.intakeId.longValue() == vo16_20.intakeId.longValue()){ |
| | | vo01_05.amount16 = vo16_20.amount16 ; |
| | | vo01_05.amount17 = vo16_20.amount17 ; |
| | | vo01_05.amount18 = vo16_20.amount18 ; |
| | | vo01_05.amount19 = vo16_20.amount19 ; |
| | | vo01_05.amount20 = vo16_20.amount20 ; |
| | | break ; |
| | | } |
| | | } |
| | | for(VoDayIntakeAmount vo21_25 : list21_25){ |
| | | if(vo01_05.intakeId.longValue() == vo21_25.intakeId.longValue()){ |
| | | vo01_05.amount21 = vo21_25.amount21 ; |
| | | vo01_05.amount22 = vo21_25.amount22 ; |
| | | vo01_05.amount23 = vo21_25.amount23 ; |
| | | vo01_05.amount24 = vo21_25.amount24 ; |
| | | vo01_05.amount25 = vo21_25.amount25 ; |
| | | break ; |
| | | } |
| | | } |
| | | for(VoDayIntakeAmount vo26_31 : list26_31){ |
| | | if(vo01_05.intakeId.longValue() == vo26_31.intakeId.longValue()){ |
| | | vo01_05.amount26 = vo26_31.amount26 ; |
| | | vo01_05.amount27 = vo26_31.amount27 ; |
| | | vo01_05.amount28 = vo26_31.amount28 ; |
| | | vo01_05.amount29 = vo26_31.amount29 ; |
| | | vo01_05.amount30 = vo26_31.amount30 ; |
| | | vo01_05.amount31 = vo26_31.amount31 ; |
| | | break ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç»è®¡æå®æä»½åæç¨æ°´é |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoMonthAmount>> amountOfMonth(IntakerQo qo) throws ParseException { |
| | | QueryResultVo<List<VoMonthAmount>> rsVo = new QueryResultVo<>() ; |
| | | // çææ¥è¯¢åæ° |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; |
| | | // è·åç¬¦åæ¡ä»¶çè®°å½æ° |
| | | Long itemTotal = monthDao.selectIntakeCount4AmountMonth(qo.intakeNum) ; |
| | | |
| | | if(itemTotal != null && itemTotal > 0){ |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | |
| | | List<VoMonthAmount> list = monthDao.selectIntakes4AmountMonth(params); |
| | | if(list == null || list.size() == 0){ |
| | | rsVo.obj = list ; |
| | | }else{ |
| | | String json = JSON.toJSONString(list) ; |
| | | params.put("intakesJson", json); |
| | | |
| | | List<VoMonthAmount> list01_06 = monthDao.selectIntakeAmountOfMonth01_06(params); |
| | | if(list01_06 != null && list01_06.size() > 0){ |
| | | //ä¸é¢1å°12æåäº2个æ¥è¯¢ï¼åå æ¯å¨ä¸ä¸ªæ¥è¯¢ä¸ï¼é常æ
¢ï¼ä¸ç¥éä»ä¹åå ï¼ä¹è®¸æ¯åæ¥è¯¢å¤ªå¤çåå |
| | | List<VoMonthAmount> list07_12 = monthDao.selectIntakeAmountOfMonth07_12(params); |
| | | this.merge(list01_06, list07_12); |
| | | } |
| | | rsVo.obj = list01_06 ; |
| | | } |
| | | } |
| | | return rsVo ; |
| | | } |
| | | |
| | | private void merge(List<VoMonthAmount> list01_06, |
| | | List<VoMonthAmount> list07_12){ |
| | | for(VoMonthAmount vo01_06 : list01_06){ |
| | | for(VoMonthAmount vo07_12 : list07_12){ |
| | | if(vo01_06.intakeId.longValue() == vo07_12.intakeId.longValue()){ |
| | | vo01_06.month7 = vo07_12.month7 ; |
| | | vo01_06.month8 = vo07_12.month8 ; |
| | | vo01_06.month9 = vo07_12.month9 ; |
| | | vo01_06.month10 = vo07_12.month10 ; |
| | | vo01_06.month11 = vo07_12.month11 ; |
| | | vo01_06.month12 = vo07_12.month12 ; |
| | | break ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.loss; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.util.DateTime; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.voSt.VoDayLoss; |
| | | import com.dy.pipIrrGlobal.voSt.VoMonthAmount; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/12 8:33 |
| | | * @Description æå
³æ¼æçç»è®¡ |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path="loss") |
| | | @RequiredArgsConstructor |
| | | public class LossCtrl { |
| | | |
| | | private LossSv sv; |
| | | |
| | | @Autowired |
| | | public void setSv(LossSv sv){ |
| | | this.sv = sv ; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æå®æä»½åæ¥æ¼æé |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/lossAmountOfDay") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoDayLoss>>> lossAmountOfDay(LossQo qo) throws Exception { |
| | | String yearMonth = qo.getYearMonth(); |
| | | if(yearMonth == null || yearMonth.trim().equals("")) { |
| | | return BaseResponseUtils.buildErrorMsg("æ¥è¯¢æ¡ä»¶å¹´æä¸è½ä¸ºç©º"); |
| | | } |
| | | qo.startDt = DateTime.dateFrom_yyyy_MM_dd(yearMonth + "-01"); |
| | | qo.endDt = DateTime.dateFrom_yyyy_MM_dd(yearMonth + "-31"); |
| | | |
| | | int[] ymd = DateTime.yyyy_MM_ymdGroup(yearMonth) ; |
| | | qo.year = ymd[0] ; |
| | | qo.month = ymd[1] ; |
| | | |
| | | return BaseResponseUtils.buildSuccess(this.sv.lossAmountOfDay(qo)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æå®æä»½åæ¥æ¼æé |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "/lossAmountOfMonth") |
| | | @SsoAop() |
| | | public BaseResponse<QueryResultVo<List<VoMonthAmount>>> lossAmountOfMonth(LossQo qo) throws Exception { |
| | | if(qo.getYear() == null) { |
| | | return BaseResponseUtils.buildErrorMsg("æ¥è¯¢æ¡ä»¶å¹´åº¦ä¸è½ä¸ºç©º"); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(this.sv.lossAmountOfMonth(qo)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.loss; |
| | | |
| | | import com.dy.common.webUtil.QueryConditionVo; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/12 8:37 |
| | | * @Description |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class LossQo extends QueryConditionVo { |
| | | |
| | | /** |
| | | * ç»è®¡å¹´æ |
| | | */ |
| | | public String yearMonth; |
| | | |
| | | /** |
| | | * æ¥è¯¢å¼å§æ¥æï¼å¹´ææ¥ï¼ |
| | | */ |
| | | public Date startDt ; |
| | | |
| | | /** |
| | | * æ¥è¯¢æªæ¢æ¥æï¼å¹´ææ¥ï¼ |
| | | */ |
| | | public Date endDt ; |
| | | |
| | | |
| | | /** |
| | | * å¹´ |
| | | */ |
| | | public Integer year; |
| | | |
| | | /** |
| | | * æ |
| | | */ |
| | | public Integer month; |
| | | |
| | | /** |
| | | * åæ°´å£ç¼å· |
| | | */ |
| | | public String intakeNum; |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrStatistics.loss; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoRm.RmLossDayMapper; |
| | | import com.dy.pipIrrGlobal.daoSt.StLossMonthMapper; |
| | | import com.dy.pipIrrGlobal.voSt.VoDayLoss; |
| | | import com.dy.pipIrrGlobal.voSt.VoMonthAmount; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/12 8:33 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class LossSv { |
| | | |
| | | @Autowired |
| | | private RmLossDayMapper dayDao; |
| | | |
| | | @Autowired |
| | | private StLossMonthMapper monthDao; |
| | | |
| | | /** |
| | | * ç»è®¡æå®æä»½åå¤©æ¼æé |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoDayLoss>> lossAmountOfDay(LossQo qo) throws ParseException { |
| | | QueryResultVo<List<VoDayLoss>> rsVo = new QueryResultVo<>() ; |
| | | // çææ¥è¯¢åæ° |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; |
| | | // è·åç¬¦åæ¡ä»¶çè®°å½æ° |
| | | Long itemTotal = dayDao.selectIntakeCount4LossDay(qo.intakeNum) ; |
| | | |
| | | if(itemTotal != null && itemTotal > 0){ |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | |
| | | List<VoDayLoss> list = dayDao.selectIntakes4LossDay(params); |
| | | if(list == null || list.size() == 0){ |
| | | rsVo.obj = list ; |
| | | }else{ |
| | | String json = JSON.toJSONString(list) ; |
| | | params.put("intakesJson", json); |
| | | |
| | | List<VoDayLoss> list01_05 = dayDao.selectLossAmountOfDay01_05(params); |
| | | if(list01_05 != null && list01_05.size() > 0){ |
| | | //ä¸é¢1å°31å·åäº6个æ¥è¯¢ï¼åå æ¯å¨ä¸ä¸ªæ¥è¯¢ä¸ï¼é常æ
¢ï¼ä¸ç¥éä»ä¹åå ï¼ä¹è®¸æ¯åæ¥è¯¢å¤ªå¤çåå |
| | | List<VoDayLoss> list06_10 = dayDao.selectLossAmountOfDay06_10(params); |
| | | List<VoDayLoss> list11_15 = dayDao.selectLossAmountOfDay11_15(params); |
| | | List<VoDayLoss> list16_20 = dayDao.selectLossAmountOfDay16_20(params); |
| | | List<VoDayLoss> list21_25 = dayDao.selectLossAmountOfDay21_25(params); |
| | | List<VoDayLoss> list26_31 = dayDao.selectLossAmountOfDay26_31(params); |
| | | this.merge(list01_05, list06_10, list11_15, list16_20, list21_25, list26_31); |
| | | } |
| | | rsVo.obj = list01_05 ; |
| | | } |
| | | } |
| | | return rsVo ; |
| | | } |
| | | |
| | | private void merge(List<VoDayLoss> list01_05, |
| | | List<VoDayLoss> list06_10, |
| | | List<VoDayLoss> list11_15, |
| | | List<VoDayLoss> list16_20, |
| | | List<VoDayLoss> list21_25, |
| | | List<VoDayLoss> list26_31){ |
| | | for(VoDayLoss vo01_05 : list01_05){ |
| | | for(VoDayLoss vo06_10 : list06_10){ |
| | | if(vo01_05.intakeId.longValue() == vo06_10.intakeId.longValue()){ |
| | | vo01_05.lossAmount6 = vo06_10.lossAmount6 ; |
| | | vo01_05.lossAmount7 = vo06_10.lossAmount7 ; |
| | | vo01_05.lossAmount8 = vo06_10.lossAmount8 ; |
| | | vo01_05.lossAmount9 = vo06_10.lossAmount9 ; |
| | | vo01_05.lossAmount10 = vo06_10.lossAmount10 ; |
| | | break ; |
| | | } |
| | | } |
| | | for(VoDayLoss vo11_15 : list11_15){ |
| | | if(vo01_05.intakeId.longValue() == vo11_15.intakeId.longValue()){ |
| | | vo01_05.lossAmount11 = vo11_15.lossAmount11 ; |
| | | vo01_05.lossAmount12 = vo11_15.lossAmount12 ; |
| | | vo01_05.lossAmount13 = vo11_15.lossAmount13 ; |
| | | vo01_05.lossAmount14 = vo11_15.lossAmount14 ; |
| | | vo01_05.lossAmount15 = vo11_15.lossAmount15 ; |
| | | break ; |
| | | } |
| | | } |
| | | for(VoDayLoss vo16_20 : list16_20){ |
| | | if(vo01_05.intakeId.longValue() == vo16_20.intakeId.longValue()){ |
| | | vo01_05.lossAmount16 = vo16_20.lossAmount16 ; |
| | | vo01_05.lossAmount17 = vo16_20.lossAmount17 ; |
| | | vo01_05.lossAmount18 = vo16_20.lossAmount18 ; |
| | | vo01_05.lossAmount19 = vo16_20.lossAmount19 ; |
| | | vo01_05.lossAmount20 = vo16_20.lossAmount20 ; |
| | | break ; |
| | | } |
| | | } |
| | | for(VoDayLoss vo21_25 : list21_25){ |
| | | if(vo01_05.intakeId.longValue() == vo21_25.intakeId.longValue()){ |
| | | vo01_05.lossAmount21 = vo21_25.lossAmount21 ; |
| | | vo01_05.lossAmount22 = vo21_25.lossAmount22 ; |
| | | vo01_05.lossAmount23 = vo21_25.lossAmount23 ; |
| | | vo01_05.lossAmount24 = vo21_25.lossAmount24 ; |
| | | vo01_05.lossAmount25 = vo21_25.lossAmount25 ; |
| | | break ; |
| | | } |
| | | } |
| | | for(VoDayLoss vo26_31 : list26_31){ |
| | | if(vo01_05.intakeId.longValue() == vo26_31.intakeId.longValue()){ |
| | | vo01_05.lossAmount26 = vo26_31.lossAmount26 ; |
| | | vo01_05.lossAmount27 = vo26_31.lossAmount27 ; |
| | | vo01_05.lossAmount28 = vo26_31.lossAmount28 ; |
| | | vo01_05.lossAmount29 = vo26_31.lossAmount29 ; |
| | | vo01_05.lossAmount30 = vo26_31.lossAmount30 ; |
| | | vo01_05.lossAmount31 = vo26_31.lossAmount31 ; |
| | | break ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç»è®¡æå®æä»½åææ¼æé |
| | | * @param qo |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoMonthAmount>> lossAmountOfMonth(LossQo qo) throws ParseException { |
| | | QueryResultVo<List<VoMonthAmount>> rsVo = new QueryResultVo<>() ; |
| | | // çææ¥è¯¢åæ° |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; |
| | | // è·åç¬¦åæ¡ä»¶çè®°å½æ° |
| | | Long itemTotal = monthDao.selectIntakeCount4LossMonth(qo.intakeNum) ; |
| | | |
| | | if(itemTotal != null && itemTotal > 0){ |
| | | rsVo.pageSize = qo.pageSize ; |
| | | rsVo.pageCurr = qo.pageCurr ; |
| | | rsVo.calculateAndSet(itemTotal, params); |
| | | |
| | | List<VoMonthAmount> list = monthDao.selectIntakes4LossMonth(params); |
| | | if(list == null || list.size() == 0){ |
| | | rsVo.obj = list ; |
| | | }else{ |
| | | String json = JSON.toJSONString(list) ; |
| | | params.put("intakesJson", json); |
| | | |
| | | List<VoMonthAmount> list01_06 = monthDao.selectLossAmountOfMonth01_06(params); |
| | | if(list01_06 != null && list01_06.size() > 0){ |
| | | //ä¸é¢1å°12æåäº2个æ¥è¯¢ï¼åå æ¯å¨ä¸ä¸ªæ¥è¯¢ä¸ï¼é常æ
¢ï¼ä¸ç¥éä»ä¹åå ï¼ä¹è®¸æ¯åæ¥è¯¢å¤ªå¤çåå |
| | | List<VoMonthAmount> list07_12 = monthDao.selectLossAmountOfMonth07_12(params); |
| | | this.merge(list01_06, list07_12); |
| | | } |
| | | rsVo.obj = list01_06 ; |
| | | } |
| | | } |
| | | return rsVo ; |
| | | } |
| | | |
| | | private void merge(List<VoMonthAmount> list01_06, |
| | | List<VoMonthAmount> list07_12){ |
| | | for(VoMonthAmount vo01_06 : list01_06){ |
| | | for(VoMonthAmount vo07_12 : list07_12){ |
| | | if(vo01_06.intakeId.longValue() == vo07_12.intakeId.longValue()){ |
| | | vo01_06.month7 = vo07_12.month7 ; |
| | | vo01_06.month8 = vo07_12.month8 ; |
| | | vo01_06.month9 = vo07_12.month9 ; |
| | | vo01_06.month10 = vo07_12.month10 ; |
| | | vo01_06.month11 = vo07_12.month11 ; |
| | | vo01_06.month12 = vo07_12.month12 ; |
| | | break ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrTemp.delSome; |
| | | |
| | | import com.dy.pipIrrGlobal.daoTmp.DeleteMapper; |
| | | import com.dy.pipIrrGlobal.voTmp.VoStClientAmountDay; |
| | | import com.dy.pipIrrGlobal.voTmp.VoStClientAmountMonth; |
| | | import com.dy.pipIrrGlobal.voTmp.VoStClientAmountYear; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/11 10:54 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class DelSomeClientAmountSv { |
| | | |
| | | private DeleteMapper dao; |
| | | |
| | | @Autowired |
| | | private void setDao(DeleteMapper dao){ |
| | | this.dao = dao; |
| | | } |
| | | |
| | | public void delStClientDay(){ |
| | | VoStClientAmountDay first = null ; |
| | | List<VoStClientAmountDay> list = dao.selectAllStClientDay() ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoStClientAmountDay vo : list){ |
| | | if(first == null){ |
| | | first = vo ; |
| | | }else{ |
| | | if(first.clientId.longValue() != vo.clientId.longValue()){ |
| | | //åæ·åäº |
| | | first = vo ; |
| | | }else{ |
| | | if(!first.dt.equals(vo.dt)) { |
| | | //æ¥æåäº |
| | | first = vo ; |
| | | }else{ |
| | | //åä¸ä¸ªåæ·åæ¥æ |
| | | doDelStClientDay(vo.id) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void delStClientMonth(){ |
| | | VoStClientAmountMonth first = null ; |
| | | List<VoStClientAmountMonth> list = dao.selectAllStClientMonth() ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoStClientAmountMonth vo : list){ |
| | | if(first == null){ |
| | | first = vo ; |
| | | }else{ |
| | | if(first.clientId.longValue() != vo.clientId.longValue()){ |
| | | //åæ·åäº |
| | | first = vo ; |
| | | }else{ |
| | | if(first.year.intValue() != vo.year.intValue()) { |
| | | //年度åäº |
| | | first = vo ; |
| | | }else{ |
| | | if(first.month.intValue() != vo.month.intValue()){ |
| | | //æä»½åäº |
| | | first = vo ; |
| | | }else{ |
| | | //åä¸ä¸ªåæ·åå¹´åæ |
| | | doDelStClientMonth(vo.id) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public void delStClientYear(){ |
| | | VoStClientAmountYear first = null ; |
| | | List<VoStClientAmountYear> list = dao.selectAllStClientYear() ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoStClientAmountYear vo : list){ |
| | | if(first == null){ |
| | | first = vo ; |
| | | }else{ |
| | | if(first.clientId.longValue() != vo.clientId.longValue()){ |
| | | //åæ·åäº |
| | | first = vo ; |
| | | }else{ |
| | | if(first.year.intValue() != vo.year.intValue()) { |
| | | //年度åäº |
| | | first = vo ; |
| | | }else{ |
| | | //åä¸ä¸ªåæ·åå¹´ |
| | | doDelStClientYear(vo.id) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | @Transactional |
| | | int doDelStClientDay(Long id){ |
| | | return dao.deleteStClientDayById(id) ; |
| | | } |
| | | |
| | | @Transactional |
| | | int doDelStClientMonth(Long id){ |
| | | return dao.deleteStClientMonthById(id) ; |
| | | } |
| | | |
| | | @Transactional |
| | | int doDelStClientYear(Long id){ |
| | | return dao.deleteStClientYearById(id) ; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dy.pipIrrTemp.delSome; |
| | | |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | @SuppressWarnings("unchecked")//javaçæ¬è¶é«ï¼å¯¹æ³å约æè¶ä¸¥ï¼æä»¥é
ç½®SuppressWarnings("unchecked") |
| | | public class DelSomeCtrl { |
| | | |
| | | private DelSomeSv sv; |
| | | private DelSomeLossAmountSv lossAmountSv; |
| | | private DelSomeIntakeAmountSv intakeAmountSv; |
| | | private DelSomeClientAmountSv clientAmountSv; |
| | | |
| | | @Autowired |
| | | private void setSv(DelSomeSv sv) { |
| | | this.sv = sv; |
| | | private void setSv(DelSomeLossAmountSv sv) { |
| | | this.lossAmountSv = sv; |
| | | } |
| | | |
| | | @Autowired |
| | | private void setSv(DelSomeIntakeAmountSv sv) { |
| | | this.intakeAmountSv = sv; |
| | | } |
| | | |
| | | @Autowired |
| | | private void setSv(DelSomeClientAmountSv sv) { |
| | | this.clientAmountSv = sv; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "deleteSomeStatisticLossAmount") |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> deleteSomeStatisticLossAmount(){ |
| | | this.sv.delStLossMonth(); |
| | | this.lossAmountSv.delStLossDay(); |
| | | this.lossAmountSv.delStLossMonth(); |
| | | this.lossAmountSv.delStLossYear(); |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¸äºåæ°´å£ç»è®¡ |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "deleteSomeStatisticIntakeAmount") |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> deleteSomeStatisticIntakeAmount(){ |
| | | this.intakeAmountSv.delStIntakeDay(); |
| | | this.intakeAmountSv.delStIntakeMonth(); |
| | | this.intakeAmountSv.delStIntakeYear(); |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¸äºåæ·ç»è®¡ |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "deleteSomeStatisticClientAmount") |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> deleteSomeStatisticClientAmount(){ |
| | | this.clientAmountSv.delStClientDay(); |
| | | this.clientAmountSv.delStClientMonth(); |
| | | this.clientAmountSv.delStClientYear(); |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrTemp.delSome; |
| | | |
| | | import com.dy.pipIrrGlobal.daoTmp.DeleteMapper; |
| | | import com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountDay; |
| | | import com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountMonth; |
| | | import com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountYear; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/11 10:54 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class DelSomeIntakeAmountSv { |
| | | |
| | | private DeleteMapper dao; |
| | | |
| | | @Autowired |
| | | private void setDao(DeleteMapper dao){ |
| | | this.dao = dao; |
| | | } |
| | | |
| | | public void delStIntakeDay(){ |
| | | VoStIntakeAmountDay first = null ; |
| | | List<VoStIntakeAmountDay> list = dao.selectAllStIntakeDay() ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoStIntakeAmountDay vo : list){ |
| | | if(first == null){ |
| | | first = vo ; |
| | | }else{ |
| | | if(first.intakeId.longValue() != vo.intakeId.longValue()){ |
| | | //åæ°´å£åäº |
| | | first = vo ; |
| | | }else{ |
| | | if(!first.dt.equals(vo.dt)) { |
| | | //æ¥æåäº |
| | | first = vo ; |
| | | }else{ |
| | | //åä¸ä¸ªåæ°´å£åæ¥æ |
| | | doDelStIntakeDay(vo.id) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void delStIntakeMonth(){ |
| | | VoStIntakeAmountMonth first = null ; |
| | | List<VoStIntakeAmountMonth> list = dao.selectAllStIntakeMonth() ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoStIntakeAmountMonth vo : list){ |
| | | if(first == null){ |
| | | first = vo ; |
| | | }else{ |
| | | if(first.intakeId.longValue() != vo.intakeId.longValue()){ |
| | | //åæ°´å£åäº |
| | | first = vo ; |
| | | }else{ |
| | | if(first.year.intValue() != vo.year.intValue()) { |
| | | //年度åäº |
| | | first = vo ; |
| | | }else{ |
| | | if(first.month.intValue() != vo.month.intValue()){ |
| | | //æä»½åäº |
| | | first = vo ; |
| | | }else{ |
| | | //åä¸ä¸ªåæ°´å£åå¹´åæ |
| | | doDelStIntakeMonth(vo.id) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public void delStIntakeYear(){ |
| | | VoStIntakeAmountYear first = null ; |
| | | List<VoStIntakeAmountYear> list = dao.selectAllStIntakeYear() ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoStIntakeAmountYear vo : list){ |
| | | if(first == null){ |
| | | first = vo ; |
| | | }else{ |
| | | if(first.intakeId.longValue() != vo.intakeId.longValue()){ |
| | | //åæ°´å£åäº |
| | | first = vo ; |
| | | }else{ |
| | | if(first.year.intValue() != vo.year.intValue()) { |
| | | //年度åäº |
| | | first = vo ; |
| | | }else{ |
| | | //åä¸ä¸ªåæ°´å£åå¹´ |
| | | doDelStIntakeYear(vo.id) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | int doDelStIntakeDay(Long id){ |
| | | return dao.deleteStIntakeDayById(id) ; |
| | | } |
| | | |
| | | @Transactional |
| | | int doDelStIntakeMonth(Long id){ |
| | | return dao.deleteStIntakeMonthById(id) ; |
| | | } |
| | | |
| | | @Transactional |
| | | int doDelStIntakeYear(Long id){ |
| | | return dao.deleteStIntakeYearById(id) ; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dy.pipIrrTemp.delSome; |
| | | |
| | | import com.dy.pipIrrGlobal.daoTmp.DeleteMapper; |
| | | import com.dy.pipIrrGlobal.voTmp.VoStLossAmountDay; |
| | | import com.dy.pipIrrGlobal.voTmp.VoStLossAmountMonth; |
| | | import com.dy.pipIrrGlobal.voTmp.VoStLossAmountYear; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2024/12/11 10:54 |
| | | * @Description |
| | | */ |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class DelSomeLossAmountSv { |
| | | |
| | | private DeleteMapper dao; |
| | | |
| | | @Autowired |
| | | private void setDao(DeleteMapper dao){ |
| | | this.dao = dao; |
| | | } |
| | | |
| | | public void delStLossDay(){ |
| | | VoStLossAmountDay first = null ; |
| | | List<VoStLossAmountDay> list = dao.selectAllStLossDay() ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoStLossAmountDay vo : list){ |
| | | if(first == null){ |
| | | first = vo ; |
| | | }else{ |
| | | if(first.intakeId.longValue() != vo.intakeId.longValue()){ |
| | | //åæ°´å£åäº |
| | | first = vo ; |
| | | }else{ |
| | | if(!first.dt.equals(vo.dt)) { |
| | | //æ¥æåäº |
| | | first = vo ; |
| | | }else{ |
| | | //åä¸ä¸ªåæ°´å£åæ¥æ |
| | | doDelStLossDay(vo.id) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void delStLossMonth(){ |
| | | VoStLossAmountMonth first = null ; |
| | | List<VoStLossAmountMonth> list = dao.selectAllStLossMonth() ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoStLossAmountMonth vo : list){ |
| | | if(first == null){ |
| | | first = vo ; |
| | | }else{ |
| | | if(first.intakeId.longValue() != vo.intakeId.longValue()){ |
| | | //åæ°´å£åäº |
| | | first = vo ; |
| | | }else{ |
| | | if(first.year.intValue() != vo.year.intValue()) { |
| | | //年度åäº |
| | | first = vo ; |
| | | }else{ |
| | | if(first.month.intValue() != vo.month.intValue()){ |
| | | //æä»½åäº |
| | | first = vo ; |
| | | }else{ |
| | | //åä¸ä¸ªåæ°´å£åå¹´åæ |
| | | doDelStLossMonth(vo.id) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public void delStLossYear(){ |
| | | VoStLossAmountYear first = null ; |
| | | List<VoStLossAmountYear> list = dao.selectAllStLossYear() ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoStLossAmountYear vo : list){ |
| | | if(first == null){ |
| | | first = vo ; |
| | | }else{ |
| | | if(first.intakeId.longValue() != vo.intakeId.longValue()){ |
| | | //åæ°´å£åäº |
| | | first = vo ; |
| | | }else{ |
| | | if(first.year.intValue() != vo.year.intValue()) { |
| | | //年度åäº |
| | | first = vo ; |
| | | }else{ |
| | | //åä¸ä¸ªåæ°´å£åå¹´ |
| | | doDelStLossYear(vo.id) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | @Transactional |
| | | int doDelStLossDay(Long id){ |
| | | return dao.deleteStLossDayById(id) ; |
| | | } |
| | | @Transactional |
| | | int doDelStLossMonth(Long id){ |
| | | return dao.deleteStLossMonthById(id) ; |
| | | } |
| | | |
| | | @Transactional |
| | | int doDelStLossYear(Long id){ |
| | | return dao.deleteStLossYearById(id) ; |
| | | } |
| | | |
| | | } |