lvzhikai 6 years ago
parent
commit
8fbcb54fd0
100 changed files with 37758 additions and 0 deletions
  1. 6 0
      Dockerfile
  2. 210 0
      pom.xml
  3. 19 0
      src/main/java/com/chinaitop/depot/DepotAgentApplication.java
  4. 12 0
      src/main/java/com/chinaitop/depot/HelloWebXml.java
  5. 35 0
      src/main/java/com/chinaitop/depot/SwaggerConfig.java
  6. 251 0
      src/main/java/com/chinaitop/depot/agent/basic/controller/AgentController.java
  7. 445 0
      src/main/java/com/chinaitop/depot/agent/basic/controller/AgentDepotController.java
  8. 127 0
      src/main/java/com/chinaitop/depot/agent/basic/controller/AgentPeopleController.java
  9. 113 0
      src/main/java/com/chinaitop/depot/agent/basic/controller/AgentStoreWareController.java
  10. 224 0
      src/main/java/com/chinaitop/depot/agent/basic/controller/AgentStorehouseController.java
  11. 175 0
      src/main/java/com/chinaitop/depot/agent/basic/controller/AgentTankController.java
  12. 40 0
      src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentDepotMapper.java
  13. 468 0
      src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentDepotMapper.xml
  14. 43 0
      src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentMapper.java
  15. 460 0
      src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentMapper.xml
  16. 30 0
      src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentPeopleMapper.java
  17. 326 0
      src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentPeopleMapper.xml
  18. 46 0
      src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentStorehouseMapper.java
  19. 367 0
      src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentStorehouseMapper.xml
  20. 30 0
      src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentTankMapper.java
  21. 326 0
      src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentTankMapper.xml
  22. 42 0
      src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentWarehouseMapper.java
  23. 413 0
      src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentWarehouseMapper.xml
  24. 165 0
      src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgent.java
  25. 155 0
      src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentDepot.java
  26. 1191 0
      src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentDepotExample.java
  27. 1271 0
      src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentExample.java
  28. 125 0
      src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentPeople.java
  29. 991 0
      src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentPeopleExample.java
  30. 65 0
      src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentStorehouse.java
  31. 561 0
      src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentStorehouseExample.java
  32. 125 0
      src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentTank.java
  33. 991 0
      src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentTankExample.java
  34. 185 0
      src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentWarehouse.java
  35. 819 0
      src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentWarehouseExample.java
  36. 54 0
      src/main/java/com/chinaitop/depot/agent/basic/service/agentDepotService.java
  37. 24 0
      src/main/java/com/chinaitop/depot/agent/basic/service/agentPeopleService.java
  38. 37 0
      src/main/java/com/chinaitop/depot/agent/basic/service/agentService.java
  39. 28 0
      src/main/java/com/chinaitop/depot/agent/basic/service/agentStoreWareService.java
  40. 31 0
      src/main/java/com/chinaitop/depot/agent/basic/service/agentStorehouseService.java
  41. 33 0
      src/main/java/com/chinaitop/depot/agent/basic/service/agentTankService.java
  42. 218 0
      src/main/java/com/chinaitop/depot/agent/basic/service/impl/AgentDepotServiceImpl.java
  43. 47 0
      src/main/java/com/chinaitop/depot/agent/basic/service/impl/AgentPeopleServiceImpl.java
  44. 191 0
      src/main/java/com/chinaitop/depot/agent/basic/service/impl/AgentServiceImpl.java
  45. 86 0
      src/main/java/com/chinaitop/depot/agent/basic/service/impl/AgentStoreWareServiceImpl.java
  46. 76 0
      src/main/java/com/chinaitop/depot/agent/basic/service/impl/AgentStorehouseServiceImpl.java
  47. 188 0
      src/main/java/com/chinaitop/depot/agent/basic/service/impl/AgentTankServiceImpl.java
  48. 295 0
      src/main/java/com/chinaitop/depot/agent/bgz/controller/BusinessAgentBgmxzController.java
  49. 155 0
      src/main/java/com/chinaitop/depot/agent/bgz/controller/BusinessAgentBgzzController.java
  50. 263 0
      src/main/java/com/chinaitop/depot/agent/bgz/controller/BusinessAgentFcbgzController.java
  51. 64 0
      src/main/java/com/chinaitop/depot/agent/bgz/mapper/BusinessAgentBgmxzMapper.java
  52. 577 0
      src/main/java/com/chinaitop/depot/agent/bgz/mapper/BusinessAgentBgmxzMapper.xml
  53. 30 0
      src/main/java/com/chinaitop/depot/agent/bgz/mapper/BusinessAgentBgzzMapper.java
  54. 406 0
      src/main/java/com/chinaitop/depot/agent/bgz/mapper/BusinessAgentBgzzMapper.xml
  55. 48 0
      src/main/java/com/chinaitop/depot/agent/bgz/mapper/BusinessAgentFcbgzMapper.java
  56. 523 0
      src/main/java/com/chinaitop/depot/agent/bgz/mapper/BusinessAgentFcbgzMapper.xml
  57. 390 0
      src/main/java/com/chinaitop/depot/agent/bgz/model/BusinessAgentBgmxz.java
  58. 1370 0
      src/main/java/com/chinaitop/depot/agent/bgz/model/BusinessAgentBgmxzExample.java
  59. 334 0
      src/main/java/com/chinaitop/depot/agent/bgz/model/BusinessAgentBgzz.java
  60. 1280 0
      src/main/java/com/chinaitop/depot/agent/bgz/model/BusinessAgentBgzzExample.java
  61. 407 0
      src/main/java/com/chinaitop/depot/agent/bgz/model/BusinessAgentFcbgz.java
  62. 1460 0
      src/main/java/com/chinaitop/depot/agent/bgz/model/BusinessAgentFcbgzExample.java
  63. 87 0
      src/main/java/com/chinaitop/depot/agent/bgz/service/BusinessAgentBgmxzService.java
  64. 32 0
      src/main/java/com/chinaitop/depot/agent/bgz/service/BusinessAgentBgzzService.java
  65. 62 0
      src/main/java/com/chinaitop/depot/agent/bgz/service/BusinessAgentFcbgzService.java
  66. 107 0
      src/main/java/com/chinaitop/depot/agent/bgz/service/impl/BusinessAgentBgmxzServiceImpl.java
  67. 36 0
      src/main/java/com/chinaitop/depot/agent/bgz/service/impl/BusinessAgentBgzzServiceImpl.java
  68. 84 0
      src/main/java/com/chinaitop/depot/agent/bgz/service/impl/BusinessAgentFcbgzServiceImpl.java
  69. 296 0
      src/main/java/com/chinaitop/depot/agent/crk/controller/AgentHcController.java
  70. 303 0
      src/main/java/com/chinaitop/depot/agent/crk/controller/AgentQcController.java
  71. 39 0
      src/main/java/com/chinaitop/depot/agent/crk/mapper/BusinessAgentHcMapper.java
  72. 476 0
      src/main/java/com/chinaitop/depot/agent/crk/mapper/BusinessAgentHcMapper.xml
  73. 39 0
      src/main/java/com/chinaitop/depot/agent/crk/mapper/BusinessAgentQcMapper.java
  74. 477 0
      src/main/java/com/chinaitop/depot/agent/crk/mapper/BusinessAgentQcMapper.xml
  75. 293 0
      src/main/java/com/chinaitop/depot/agent/crk/model/BusinessAgentHc.java
  76. 1229 0
      src/main/java/com/chinaitop/depot/agent/crk/model/BusinessAgentHcExample.java
  77. 293 0
      src/main/java/com/chinaitop/depot/agent/crk/model/BusinessAgentQc.java
  78. 1229 0
      src/main/java/com/chinaitop/depot/agent/crk/model/BusinessAgentQcExample.java
  79. 48 0
      src/main/java/com/chinaitop/depot/agent/crk/service/agentHcService.java
  80. 49 0
      src/main/java/com/chinaitop/depot/agent/crk/service/agentQcService.java
  81. 216 0
      src/main/java/com/chinaitop/depot/agent/crk/service/impl/AgentHcServiceImpl.java
  82. 216 0
      src/main/java/com/chinaitop/depot/agent/crk/service/impl/AgentQcServiceImpl.java
  83. 283 0
      src/main/java/com/chinaitop/depot/agent/number/controller/AgentNumberController.java
  84. 34 0
      src/main/java/com/chinaitop/depot/agent/number/mapper/BusinessAgentNumberMapper.java
  85. 370 0
      src/main/java/com/chinaitop/depot/agent/number/mapper/BusinessAgentNumberMapper.xml
  86. 135 0
      src/main/java/com/chinaitop/depot/agent/number/model/BusinessAgentNumber.java
  87. 1001 0
      src/main/java/com/chinaitop/depot/agent/number/model/BusinessAgentNumberExample.java
  88. 42 0
      src/main/java/com/chinaitop/depot/agent/number/service/agentNumberService.java
  89. 200 0
      src/main/java/com/chinaitop/depot/agent/number/service/impl/AgentNumberServiceImpl.java
  90. 649 0
      src/main/java/com/chinaitop/depot/agent/quality/controller/AgentQualityController.java
  91. 80 0
      src/main/java/com/chinaitop/depot/agent/quality/controller/AgentQualitySonController.java
  92. 57 0
      src/main/java/com/chinaitop/depot/agent/quality/mapper/BusinessAgentQualityMapper.java
  93. 1916 0
      src/main/java/com/chinaitop/depot/agent/quality/mapper/BusinessAgentQualityMapper.xml
  94. 32 0
      src/main/java/com/chinaitop/depot/agent/quality/mapper/BusinessAgentQualitySonMapper.java
  95. 225 0
      src/main/java/com/chinaitop/depot/agent/quality/mapper/BusinessAgentQualitySonMapper.xml
  96. 1029 0
      src/main/java/com/chinaitop/depot/agent/quality/model/BusinessAgentQuality.java
  97. 6061 0
      src/main/java/com/chinaitop/depot/agent/quality/model/BusinessAgentQualityExample.java
  98. 55 0
      src/main/java/com/chinaitop/depot/agent/quality/model/BusinessAgentQualitySon.java
  99. 511 0
      src/main/java/com/chinaitop/depot/agent/quality/model/BusinessAgentQualitySonExample.java
  100. 0 0
      src/main/java/com/chinaitop/depot/agent/quality/service/AgentQualityService.java

+ 6 - 0
Dockerfile

@@ -0,0 +1,6 @@
1
+FROM 192.168.123.25:31104/unis/java:8
2
+
3
+ADD ./target/depot-agent.jar /root
4
+CMD ["sh", "-c", "cd /root; java -Djava.security.egd=file:/dev/./urandom -jar /root/depot-agent.jar --depot-agent.server.enable-self-preservation=false"]
5
+EXPOSE 9027
6
+

+ 210 - 0
pom.xml

@@ -0,0 +1,210 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
+	<modelVersion>4.0.0</modelVersion>
5
+
6
+	<groupId>com.chinaitop</groupId>
7
+	<artifactId>depot-agent</artifactId>
8
+	<version>0.0.1-SNAPSHOT</version>
9
+    <packaging>jar</packaging>
10
+
11
+	<name>depot-agent</name>
12
+	<description>Demo project for Spring Boot</description>
13
+
14
+	<parent>
15
+        <groupId>org.springframework.boot</groupId>
16
+        <artifactId>spring-boot-starter-parent</artifactId>
17
+        <version>2.0.0.RELEASE</version>
18
+        <relativePath/>
19
+    </parent>
20
+
21
+	<properties>
22
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24
+        <java.version>1.8</java.version>
25
+        <spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
26
+	</properties>
27
+
28
+    <dependencies>
29
+        <dependency>
30
+            <groupId>org.springframework.boot</groupId>
31
+            <artifactId>spring-boot-starter-web</artifactId>
32
+        </dependency>
33
+        <dependency>
34
+            <groupId>org.springframework.cloud</groupId>
35
+            <artifactId>spring-cloud-starter-config</artifactId>
36
+        </dependency>
37
+        <dependency>
38
+            <groupId>org.mybatis.spring.boot</groupId>
39
+            <artifactId>mybatis-spring-boot-starter</artifactId>
40
+            <version>1.3.1</version>
41
+        </dependency>
42
+        <dependency>
43
+			<groupId>org.springframework.boot</groupId>
44
+			<artifactId>spring-boot-starter-test</artifactId>
45
+			<scope>test</scope>
46
+		</dependency>
47
+
48
+        <!-- 引入spring boot自带的pagehelper插件 -->
49
+        <dependency>
50
+            <groupId>com.github.pagehelper</groupId>
51
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
52
+            <version>1.2.3</version>
53
+        </dependency>
54
+
55
+        <!-- 导入Eureka服务的依赖 -->
56
+        <dependency>
57
+            <groupId>org.springframework.cloud</groupId>
58
+            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
59
+        </dependency>
60
+        <!-- swagger2 -->
61
+        <dependency>
62
+            <groupId>io.springfox</groupId>
63
+            <artifactId>springfox-swagger2</artifactId>
64
+            <version>2.6.1</version>
65
+        </dependency>
66
+        <dependency>
67
+            <groupId>io.springfox</groupId>
68
+            <artifactId>springfox-swagger-ui</artifactId>
69
+            <version>2.6.1</version>
70
+        </dependency>
71
+
72
+        <dependency>
73
+            <groupId>org.springframework.boot</groupId>
74
+            <artifactId>spring-boot-starter-data-redis</artifactId>
75
+        </dependency>
76
+        <dependency>
77
+            <groupId>org.springframework.session</groupId>
78
+            <artifactId>spring-session-data-redis</artifactId>
79
+        </dependency>
80
+
81
+        <!-- 阿里巴巴json -->
82
+        <dependency>
83
+            <groupId>com.alibaba</groupId>
84
+            <artifactId>fastjson</artifactId>
85
+            <version>1.2.37</version>
86
+        </dependency>
87
+        <dependency>    
88
+		    <groupId>net.sf.json-lib</groupId>    
89
+		    <artifactId>json-lib</artifactId>    
90
+		    <version>2.4</version>    
91
+		    <classifier>jdk15</classifier>    
92
+		</dependency>
93
+
94
+		<!-- gbase依赖包 -->  
95
+		<dependency>
96
+	      	<groupId>com.gbase8s</groupId>
97
+	      	<artifactId>ifxjdbc</artifactId>
98
+	      	<version>1.0</version>
99
+	    </dependency>
100
+    	<dependency>
101
+      		<groupId>com.gbase</groupId>
102
+      		<artifactId>druid</artifactId>
103
+      		<version>1.0.28</version>
104
+    	</dependency>
105
+    	
106
+        <dependency>
107
+            <groupId>mysql</groupId>
108
+            <artifactId>mysql-connector-java</artifactId>
109
+        </dependency>
110
+
111
+        <dependency>
112
+            <groupId>org.apache.commons</groupId>
113
+            <artifactId>commons-lang3</artifactId>
114
+            <version>3.7</version>
115
+        </dependency>
116
+
117
+        <dependency>
118
+            <groupId>commons-codec</groupId>
119
+            <artifactId>commons-codec</artifactId>
120
+            <version>1.9</version>
121
+        </dependency>
122
+
123
+        <dependency>
124
+            <groupId>org.apache.poi</groupId>
125
+            <artifactId>poi-ooxml</artifactId>
126
+            <version>3.9</version>
127
+        </dependency>
128
+
129
+        <!-- 加载mybatis逆向生成工具包 -->
130
+        <dependency>
131
+		    <groupId>org.mybatis.generator</groupId>
132
+		    <artifactId>mybatis-generator-core</artifactId>
133
+		    <!-- 注意版本.这里我使用的是1.3.2 -->
134
+		    <version>1.3.2</version>
135
+		</dependency>
136
+
137
+        <!--<dependency>-->
138
+            <!--<groupId>org.springframework.boot</groupId>-->
139
+            <!--<artifactId>spring-boot-starter-tomcat</artifactId>-->
140
+            <!--<scope>provided</scope>-->
141
+        <!--</dependency>-->
142
+    </dependencies>
143
+
144
+    <dependencyManagement>
145
+        <dependencies>
146
+            <dependency>
147
+                <groupId>org.springframework.cloud</groupId>
148
+                <artifactId>spring-cloud-dependencies</artifactId>
149
+                <version>${spring-cloud.version}</version>
150
+                <type>pom</type>
151
+                <scope>import</scope>
152
+            </dependency>
153
+        </dependencies>
154
+    </dependencyManagement>
155
+
156
+    <build>
157
+
158
+        <finalName>${project.artifactId}</finalName>
159
+        <plugins>
160
+            <plugin>
161
+                <groupId>org.springframework.boot</groupId>
162
+                <artifactId>spring-boot-maven-plugin</artifactId>
163
+            </plugin>
164
+
165
+            <plugin>
166
+                <groupId>org.apache.maven.plugins</groupId>
167
+                <artifactId>maven-surefire-plugin</artifactId>
168
+                <configuration>
169
+                    <skip>true</skip>
170
+                </configuration>
171
+            </plugin>
172
+
173
+            <plugin>
174
+                <groupId>org.apache.maven.plugins</groupId>
175
+                <artifactId>maven-war-plugin</artifactId>
176
+                <version>2.6</version>
177
+                <configuration>
178
+                    <failOnMissingWebXml>false</failOnMissingWebXml>
179
+                </configuration>
180
+            </plugin>
181
+        </plugins>
182
+        <!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉。 -->
183
+        <resources>
184
+            <resource>
185
+                <directory>src/main/java</directory>
186
+                <includes>
187
+                    <include>**/*.properties</include>
188
+					<include>**/*.xml</include>
189
+					<include>**/*.store</include>
190
+                </includes>
191
+                <filtering>false</filtering>
192
+            </resource>
193
+            <resource>
194
+                <directory>src/main/resources</directory>
195
+            </resource>
196
+        </resources>
197
+    </build>
198
+
199
+    <repositories>
200
+        <repository>
201
+            <id>spring-milestones</id>
202
+            <name>Spring Milestones</name>
203
+            <url>https://repo.spring.io/milestone</url>
204
+            <snapshots>
205
+                <enabled>false</enabled>
206
+            </snapshots>
207
+        </repository>
208
+    </repositories>
209
+
210
+</project>

+ 19 - 0
src/main/java/com/chinaitop/depot/DepotAgentApplication.java

@@ -0,0 +1,19 @@
1
+package com.chinaitop.depot;
2
+
3
+import com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration;
4
+import org.mybatis.spring.annotation.MapperScan;
5
+import org.springframework.boot.SpringApplication;
6
+import org.springframework.boot.autoconfigure.SpringBootApplication;
7
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
8
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
9
+
10
+@EnableEurekaClient
11
+@EnableDiscoveryClient
12
+@SpringBootApplication(exclude = PageHelperAutoConfiguration.class)//配置mybatis的配置文件使用,否则报多个分页插件
13
+@MapperScan(basePackages = {"com.chinaitop.depot.agent.*.mapper"})
14
+public class DepotAgentApplication {
15
+
16
+	public static void main(String[] args) {
17
+		SpringApplication.run(DepotAgentApplication.class, args);
18
+	}
19
+}

+ 12 - 0
src/main/java/com/chinaitop/depot/HelloWebXml.java

@@ -0,0 +1,12 @@
1
+package com.chinaitop.depot;
2
+ 
3
+import org.springframework.boot.builder.SpringApplicationBuilder;
4
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
5
+
6
+public class HelloWebXml extends SpringBootServletInitializer {
7
+    @Override
8
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
9
+        return application.sources(DepotAgentApplication.class);
10
+    }
11
+ 
12
+}

+ 35 - 0
src/main/java/com/chinaitop/depot/SwaggerConfig.java

@@ -0,0 +1,35 @@
1
+package com.chinaitop.depot;
2
+
3
+import org.springframework.context.annotation.Bean;
4
+import org.springframework.context.annotation.Configuration;
5
+
6
+import springfox.documentation.builders.ApiInfoBuilder;
7
+import springfox.documentation.builders.PathSelectors;
8
+import springfox.documentation.builders.RequestHandlerSelectors;
9
+import springfox.documentation.service.ApiInfo;
10
+import springfox.documentation.spi.DocumentationType;
11
+import springfox.documentation.spring.web.plugins.Docket;
12
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
13
+
14
+@Configuration
15
+@EnableSwagger2
16
+public class SwaggerConfig {
17
+
18
+    @Bean
19
+    public Docket createRestApi() {
20
+        return new Docket(DocumentationType.SWAGGER_2)
21
+                .apiInfo(apiInfo())
22
+                .select()
23
+                .apis(RequestHandlerSelectors.basePackage("com.chinaitop.depot.agent.*.controller"))
24
+                .paths(PathSelectors.any())
25
+                .build();
26
+    }
27
+    private ApiInfo apiInfo() {
28
+        return new ApiInfoBuilder()
29
+                .title("智能粮库管理平台api文档")
30
+                .description("代储库管理")
31
+                .termsOfServiceUrl("http://192.168.80.25:9001")
32
+                .version("1.0")
33
+                .build();
34
+    }
35
+}

+ 251 - 0
src/main/java/com/chinaitop/depot/agent/basic/controller/AgentController.java

@@ -0,0 +1,251 @@
1
+package com.chinaitop.depot.agent.basic.controller;
2
+
3
+import java.util.ArrayList;
4
+import java.util.HashMap;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import javax.annotation.Resource;
9
+import javax.servlet.http.HttpServletRequest;
10
+
11
+import com.chinaitop.depot.agent.basic.model.*;
12
+import com.chinaitop.depot.agent.basic.service.agentDepotService;
13
+import com.chinaitop.depot.agent.basic.service.agentStoreWareService;
14
+import com.chinaitop.depot.agent.basic.service.agentStorehouseService;
15
+import com.chinaitop.depot.utils.ImportServiceImpl;
16
+import com.fasterxml.jackson.databind.ObjectMapper;
17
+import io.swagger.annotations.Api;
18
+import io.swagger.annotations.ApiImplicitParam;
19
+import io.swagger.annotations.ApiImplicitParams;
20
+import io.swagger.annotations.ApiOperation;
21
+import org.springframework.http.MediaType;
22
+import org.springframework.web.bind.annotation.RequestMapping;
23
+import org.springframework.web.bind.annotation.RequestMethod;
24
+import org.springframework.web.bind.annotation.RestController;
25
+
26
+import com.chinaitop.depot.agent.basic.service.agentService;
27
+import com.chinaitop.utils.ParameterUtil;
28
+import com.github.pagehelper.PageHelper;
29
+import com.github.pagehelper.PageInfo;
30
+import org.springframework.web.multipart.MultipartFile;
31
+
32
+@RestController
33
+@RequestMapping(value = "/agent")
34
+@Api(description = "代储点信息管理")
35
+public class AgentController {
36
+
37
+    @Resource
38
+    private agentService agentService;
39
+
40
+
41
+    @Resource
42
+    private agentDepotService agentDepotService;
43
+
44
+    @Resource
45
+    private agentStorehouseService agentStorehouseService;
46
+
47
+    @Resource
48
+    private agentStoreWareService agentStoreWareService;
49
+
50
+    @Resource
51
+    private ImportServiceImpl importService;
52
+
53
+    /**
54
+     * 查询代储点信息记录
55
+     * @param pageNum
56
+     * @param pageSize
57
+     * @return
58
+     */
59
+    @RequestMapping(value = "/getAgentList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
60
+    @ApiOperation(value="代储点信息", notes = "代储点信息记录列表")
61
+    @ApiImplicitParams({
62
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
63
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
64
+            @ApiImplicitParam(name = "agentName", value = "代储点名称", paramType = "query"),
65
+            @ApiImplicitParam(name = "orgid", value = "组织id", paramType = "query")
66
+    })
67
+    public PageInfo<BusinessAgent> getAgentList(Integer pageNum, Integer pageSize,String agentName,String orgid){
68
+
69
+        BusinessAgentExample example = new BusinessAgentExample();
70
+        BusinessAgentExample.Criteria criteria = example.createCriteria();
71
+        criteria.andOrgIdEqualTo(Integer.valueOf(orgid));
72
+        criteria.andDelFlagEqualTo(1);
73
+        if(ParameterUtil.isnotnull(agentName)){
74
+            criteria.andAgentNameLike("%"+agentName+"%");
75
+        }
76
+        example.setOrderByClause("updatetime desc");
77
+        PageHelper.startPage(pageNum, pageSize);
78
+        List<BusinessAgent> list = agentService.getAgentList(example);
79
+        PageInfo<BusinessAgent> pageInfo = new PageInfo<BusinessAgent>(list);
80
+        return pageInfo;
81
+    }
82
+
83
+    /**
84
+     * 代储点查询信息--代储库列表转化用
85
+     * @return
86
+     */
87
+    @RequestMapping(value = "/getQueryAgentList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
88
+    @ApiOperation(value="代储点查询信息", notes = "代储点信息记录列表")
89
+    @ApiImplicitParams({
90
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query")
91
+    })
92
+    public Map<Integer, Object> getQueryAgentList(String orgId){
93
+        BusinessAgentExample example = new BusinessAgentExample();
94
+        BusinessAgentExample.Criteria criteria = example.createCriteria();
95
+        criteria.andOrgIdEqualTo(Integer.valueOf(orgId));
96
+        criteria.andDelFlagEqualTo(1);
97
+        List<BusinessAgent> list = agentService.getAgentList(example);
98
+        Map<Integer, Object> agentData = new HashMap<Integer, Object>();
99
+        for (BusinessAgent obj : list) {
100
+            agentData.put(obj.getId(), obj);
101
+        }
102
+        return agentData;
103
+    }
104
+
105
+    /**
106
+     * 保存代储点信息
107
+     * @param agentJson 主键id
108
+     * @return
109
+     * @throws Exception
110
+     */
111
+    @RequestMapping(value="/saveAgent", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
112
+    @ApiOperation(value="保存代储点信息", notes = "保存代储点详细信息")
113
+    @ApiImplicitParams({
114
+            @ApiImplicitParam(name = "agentJson", value = "代储点信息", paramType = "form")
115
+    })
116
+    public Map<String, Object> saveAgent(String agentJson,Integer orgId) throws Exception {
117
+        Map<String, Object> modelMap = new HashMap<String, Object>();
118
+        // JSON字符串转对象
119
+        ObjectMapper mapper = new ObjectMapper();
120
+        BusinessAgent agent = (BusinessAgent)mapper.readValue(agentJson, BusinessAgent.class);
121
+        if (agent.getId() == null) {
122
+            agent.setOrgId(orgId);
123
+            agent.setDelFlag(1);
124
+            agent.setCreateTime(ParameterUtil.string2date(ParameterUtil.getSysDateTime()));//创建时间
125
+            agentService.add(agent);
126
+        } else {
127
+            agentService.update(agent);
128
+        }
129
+        modelMap.put("agentId", agent.getId());
130
+        modelMap.put("status", "success");
131
+        return modelMap;
132
+    }
133
+
134
+    /**
135
+     * 删除代储点信息
136
+     * @param id 主键id
137
+     * @return
138
+     */
139
+    @RequestMapping(value="/removeAgent", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
140
+    @ApiOperation(value="删除代储点信息", notes = "删除代储点信息")
141
+    @ApiImplicitParams({
142
+            @ApiImplicitParam(name = "id", value = "主键id", paramType = "form")
143
+    })
144
+    public Map<String, Object> removeAgent(Integer id){
145
+        Map<String, Object> modelMap = new HashMap<>();
146
+        if (id != null) {
147
+//            this.removeDepotList(id);
148
+            agentService.updateDeleteById(id);
149
+            modelMap.put("status", "success");
150
+        }
151
+        return modelMap;
152
+    }
153
+
154
+    /**
155
+     * 根据id查找代储点信息
156
+     * @param id 主键id
157
+     * @return
158
+     */
159
+    @RequestMapping(value="/edit", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
160
+    @ApiOperation(value="根据id查找代储点信息", notes = "根据id查找代储点信息")
161
+    @ApiImplicitParams({
162
+            @ApiImplicitParam(name = "id", value = "主键id", paramType = "query")
163
+    })
164
+    public BusinessAgent edit(Integer id) {
165
+        BusinessAgent agent = new BusinessAgent();
166
+        if (id != null) {
167
+            agent = agentService.findById(id);
168
+        }
169
+        return agent;
170
+    }
171
+
172
+
173
+    //根据库id删除粮库
174
+    public void removeDepotList(Integer agentId){
175
+        BusinessAgentDepotExample example = new BusinessAgentDepotExample();
176
+        BusinessAgentDepotExample.Criteria criteria = example.createCriteria();
177
+        criteria.andAgentIdEqualTo(agentId.toString());
178
+        List<BusinessAgentDepot> depotList = agentDepotService.getAgentDepotList(example);
179
+        for (BusinessAgentDepot depotData:depotList) {
180
+            agentDepotService.updateDeleteById(depotData.getId(),2);
181
+
182
+            this.removeWareList(depotData.getId());
183
+        }
184
+    }
185
+    //根据库id删除仓房
186
+    public void removeStoreList(Integer depotId){
187
+        BusinessAgentStorehouseExample example = new BusinessAgentStorehouseExample();
188
+        BusinessAgentStorehouseExample.Criteria criteria = example.createCriteria();
189
+        criteria.andAgentDepotIdEqualTo(depotId);
190
+        List<BusinessAgentStorehouse> storeList = agentStorehouseService.getStoreDataList(example);
191
+        for (BusinessAgentStorehouse storeData:storeList) {
192
+            agentStorehouseService.updateStoreDeleteById(storeData.getId(),2);
193
+
194
+            this.removeWareList(storeData.getId());
195
+        }
196
+    }
197
+
198
+    //根据仓房id删除货位
199
+    public void removeWareList(Integer storeHouseId){
200
+        BusinessAgentWarehouseExample example = new BusinessAgentWarehouseExample();
201
+        BusinessAgentWarehouseExample.Criteria criteria = example.createCriteria();
202
+        criteria.andAgentStorehouseIdEqualTo(storeHouseId);
203
+        List<BusinessAgentWarehouse> wareList = agentStoreWareService.getWareDataList(example);
204
+        for (BusinessAgentWarehouse wareData:wareList) {
205
+            agentStoreWareService.removeAgentWare(wareData.getId(),2);
206
+        }
207
+    }
208
+
209
+    /**
210
+     * 导入excel
211
+     * @param file 文件
212
+     * @param fileType 类型:如xlsx
213
+     * @param orgId 组织机构id
214
+     * @return
215
+     */
216
+    @RequestMapping(value="/importFile", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
217
+    @ApiOperation(value="导入excel", notes = "导入excel")
218
+    @ApiImplicitParams({
219
+            @ApiImplicitParam(name = "file", value = "文件数据", paramType = "query"),
220
+            @ApiImplicitParam(name = "fileType", value = "文件名", paramType = "query"),
221
+            @ApiImplicitParam(name = "rootPath", value = "路径", paramType = "query"),
222
+            @ApiImplicitParam(name = "orgId", value = "组织机构id", paramType = "query")
223
+    })
224
+    public Map<String, Object> importFile(MultipartFile file, String fileType, HttpServletRequest request, Integer orgId){
225
+
226
+        String[] titleArr = {"代储点名称", "法定代表人", "统一社会信用代码", "代储点性质", "代储点类型", "仓容",
227
+                "人员", "信用", "经度", "纬度", "所属行政区划分"};//第一行的title
228
+        boolean[] emptyArr = {false, false, false, false, false, false,
229
+                true, true, false, true, true};//指定列可为空,不可为空值为false.
230
+
231
+        List<List<String>> list = new ArrayList<List<String>>();//该list为数据返回的list
232
+        Map<String, Object> fileMap = new HashMap<>();
233
+        String errormsg = null;
234
+        try {
235
+        	errormsg = importService.importFile(file, fileType, request, titleArr, emptyArr, list,0);
236
+
237
+            if (errormsg != null && !"".equals(errormsg)) {
238
+                fileMap.put("errormsg",errormsg);
239
+                return fileMap;
240
+            }
241
+
242
+            if (list.size()>0) {
243
+                errormsg = agentService.importData(list, orgId);
244
+            }
245
+        } catch (Exception e) {
246
+            e.printStackTrace();
247
+        }
248
+        fileMap.put("errormsg",errormsg);
249
+        return fileMap;
250
+    }
251
+}

+ 445 - 0
src/main/java/com/chinaitop/depot/agent/basic/controller/AgentDepotController.java

@@ -0,0 +1,445 @@
1
+package com.chinaitop.depot.agent.basic.controller;
2
+
3
+import com.alibaba.fastjson.JSONArray;
4
+import com.chinaitop.depot.agent.basic.model.*;
5
+import com.chinaitop.depot.agent.basic.service.agentDepotService;
6
+import com.chinaitop.depot.agent.basic.service.agentStoreWareService;
7
+import com.chinaitop.depot.agent.basic.service.agentStorehouseService;
8
+import com.chinaitop.depot.utils.ImportServiceImpl;
9
+import com.chinaitop.utils.ParameterUtil;
10
+import com.fasterxml.jackson.databind.ObjectMapper;
11
+import com.github.pagehelper.PageHelper;
12
+import com.github.pagehelper.PageInfo;
13
+import io.swagger.annotations.Api;
14
+import io.swagger.annotations.ApiImplicitParam;
15
+import io.swagger.annotations.ApiImplicitParams;
16
+import io.swagger.annotations.ApiOperation;
17
+import org.springframework.http.MediaType;
18
+import org.springframework.web.bind.annotation.RequestMapping;
19
+import org.springframework.web.bind.annotation.RequestMethod;
20
+import org.springframework.web.bind.annotation.RestController;
21
+import org.springframework.web.multipart.MultipartFile;
22
+
23
+import javax.annotation.Resource;
24
+import javax.servlet.http.HttpServletRequest;
25
+import java.util.*;
26
+
27
+@RestController
28
+@RequestMapping(value = "/agentDepot")
29
+@Api(description = "代储点信息管理")
30
+public class AgentDepotController {
31
+
32
+    @Resource
33
+    private agentDepotService agentDepotService;
34
+
35
+    @Resource
36
+    private agentStorehouseService agentStorehouseService;
37
+
38
+    @Resource
39
+    private agentStoreWareService agentStoreWareService;
40
+
41
+    @Resource
42
+    private ImportServiceImpl importService;
43
+
44
+    /**
45
+     * 代储库信息信息记录
46
+     * @param pageNum
47
+     * @param pageSize
48
+     * @return
49
+     */
50
+    @RequestMapping(value = "/getAgentDepotList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
51
+    @ApiOperation(value="代储库信息", notes = "代储点粮库信息列表")
52
+    @ApiImplicitParams({
53
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
54
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
55
+            @ApiImplicitParam(name = "agentDepotName", value = "代储库名称", paramType = "query"),
56
+            @ApiImplicitParam(name = "agentId", value = "代储点id", paramType = "query"),
57
+            @ApiImplicitParam(name = "orgid", value = "组织id", paramType = "query")
58
+    })
59
+    public PageInfo<BusinessAgentDepot> getAgentDepotList(Integer pageNum, Integer pageSize,String agentDepotName,String orgid, String agentId){
60
+        Map<String,Object> map = new HashMap<>();
61
+        map.put("orgId",orgid);
62
+        if(ParameterUtil.isnotnull(agentDepotName)){
63
+            map.put("agentDepotName","%" + agentDepotName + "%");
64
+        }
65
+        if(ParameterUtil.isnotnull(agentId)){
66
+            map.put("agentId",agentId);
67
+        }
68
+
69
+        PageHelper.startPage(pageNum, pageSize);
70
+        List<BusinessAgentDepot> list = agentDepotService.getAgentList(map);
71
+        PageInfo<BusinessAgentDepot> pageInfo = new PageInfo<BusinessAgentDepot>(list);
72
+        return pageInfo;
73
+    }
74
+
75
+    /**
76
+     * 代储库信息信息记录--仓房用
77
+     * @return
78
+     */
79
+    @RequestMapping(value = "/getAgentDepotHouse", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
80
+    @ApiOperation(value="代储库信息", notes = "代储点粮库信息列表")
81
+    @ApiImplicitParams({
82
+            @ApiImplicitParam(name = "agentDepotName", value = "代储库名称", paramType = "query"),
83
+            @ApiImplicitParam(name = "agentId", value = "代储点id", paramType = "query"),
84
+            @ApiImplicitParam(name = "orgid", value = "组织id", paramType = "query")
85
+    })
86
+    public List<BusinessAgentDepot> getAgentDepotHouse(String agentDepotName,String orgid, String agentId){
87
+        BusinessAgentDepotExample example = new BusinessAgentDepotExample();
88
+        BusinessAgentDepotExample.Criteria criteria = example.createCriteria();
89
+        criteria.andOrgIdEqualTo(Integer.parseInt(orgid));
90
+        criteria.andDepotIdEqualTo(0);
91
+        criteria.andDelFlagEqualTo(1);
92
+        if(ParameterUtil.isnotnull(agentDepotName)){
93
+            criteria.andAgentDepotNameLike("%" + agentDepotName + "%");
94
+        }
95
+        if(ParameterUtil.isnotnull(agentId)){
96
+            criteria.andAgentIdEqualTo(agentId);
97
+        }
98
+
99
+        List<BusinessAgentDepot> list = agentDepotService.getAgentDepotList(example);
100
+        return list;
101
+    }
102
+
103
+    /**
104
+     * 保存代储点信息
105
+     * @param agentJson 主键id
106
+     * @return
107
+     * @throws Exception
108
+     */
109
+    @RequestMapping(value="/saveAgentDepot", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
110
+    @ApiOperation(value="保存代储点信息", notes = "保存代储点详细信息")
111
+    @ApiImplicitParams({
112
+            @ApiImplicitParam(name = "agentJson", value = "代储库信息", paramType = "form")
113
+    })
114
+    public Map<String, Object> saveAgentDepot(String agentJson,Integer orgId) throws Exception {
115
+        Map<String, Object> modelMap = new HashMap<String, Object>();
116
+        // JSON字符串转对象
117
+        ObjectMapper mapper = new ObjectMapper();
118
+        BusinessAgentDepot agentDepot = (BusinessAgentDepot)mapper.readValue(agentJson, BusinessAgentDepot.class);
119
+        agentDepot.setCreateTime(ParameterUtil.string2date(ParameterUtil.getSysDateTime()));//修改时间
120
+        if (agentDepot.getId() == null) {
121
+            agentDepot.setOrgId(orgId);
122
+            agentDepot.setDelFlag(1);
123
+            agentDepot.setDepotId(0);
124
+            agentDepotService.add(agentDepot);
125
+        } else {
126
+            agentDepotService.update(agentDepot);
127
+        }
128
+        modelMap.put("agentId", agentDepot.getId());
129
+        modelMap.put("status", "success");
130
+        return modelMap;
131
+    }
132
+
133
+    /**
134
+     * 删除代储库信息
135
+     * @param id 主键id
136
+     * @return
137
+     */
138
+    @RequestMapping(value="/removeAgentDepot", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
139
+    @ApiOperation(value="删除代储库信息", notes = "删除代储库信息")
140
+    @ApiImplicitParams({
141
+            @ApiImplicitParam(name = "id", value = "主键id", paramType = "form")
142
+    })
143
+    public Map<String, Object> removeAgentDepot(Integer id){
144
+        Map<String, Object> modelMap = new HashMap<>();
145
+        if (id != null) {
146
+            agentDepotService.updateDeleteById(id,2);
147
+            modelMap.put("status", "success");
148
+        }
149
+        return modelMap;
150
+    }
151
+
152
+    /**
153
+     * 根据id查找代储点信息
154
+     * @param id 主键id
155
+     * @return
156
+     */
157
+    @RequestMapping(value="/editDepot", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
158
+    @ApiOperation(value="根据id查找代储点信息", notes = "根据id查找代储点信息")
159
+    @ApiImplicitParams({
160
+            @ApiImplicitParam(name = "id", value = "主键id", paramType = "query")
161
+    })
162
+    public BusinessAgentDepot editDepot(Integer id) {
163
+        BusinessAgentDepot agentDepot = new BusinessAgentDepot();
164
+        if (id != null) {
165
+            agentDepot = agentDepotService.findById(id);
166
+        }
167
+        return agentDepot;
168
+    }
169
+
170
+    /**
171
+     * 代储库查询信息--列表转化用
172
+     * @return
173
+     */
174
+    @RequestMapping(value = "/getQueryAgentDepotList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
175
+    @ApiOperation(value="代储库查询信息", notes = "代储库信息记录列表")
176
+    @ApiImplicitParams({
177
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query")
178
+    })
179
+    public Map<Integer, Object> getQueryAgentDepotList(String orgId,Integer depotId){
180
+        BusinessAgentDepotExample example = new BusinessAgentDepotExample();
181
+        BusinessAgentDepotExample.Criteria criteria = example.createCriteria();
182
+        criteria.andOrgIdEqualTo(Integer.valueOf(orgId));
183
+        criteria.andDelFlagEqualTo(1);
184
+        if(depotId!=null && depotId!=000){
185
+        	criteria.andDepotIdEqualTo(depotId);
186
+        }
187
+        if(depotId!=null && depotId==000){ //去掉手动新增的库点
188
+        	criteria.andDepotIdNotEqualTo(0);
189
+        }
190
+        List<BusinessAgentDepot> list = agentDepotService.getAgentDepotList(example);
191
+        Map<Integer, Object> agentData = new HashMap<Integer, Object>();
192
+        for (BusinessAgentDepot obj : list) {
193
+            agentData.put(obj.getId(), obj);
194
+        }
195
+        return agentData;
196
+    }
197
+
198
+    /**
199
+     * 查找所有粮库
200
+     * @param orgName 组织机构名称
201
+     * @return
202
+     */
203
+    @RequestMapping(value="/getDepotList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
204
+    @ApiOperation(value="查找所有粮库", notes = "查找所有粮库信息")
205
+    @ApiImplicitParams({
206
+            @ApiImplicitParam(name="orgId", value="组织机构id", paramType="query"),
207
+            @ApiImplicitParam(name="storehouseId", value="仓房id", paramType="query"),
208
+            @ApiImplicitParam(name="orgName", value="组织机构名称", paramType="query")
209
+    })
210
+    public List<List<Map<String, Object>>> getDepotList(String orgId,String storehouseId,String orgName) {
211
+        //查询所有粮库
212
+        Map<String,Object> map = new HashMap<>();
213
+        map.put("agentDepotId",orgId);
214
+        map.put("storehouseId",storehouseId);
215
+
216
+        if(ParameterUtil.isnotnull(orgName)){
217
+            map.put("orgName","%" + orgName + "%");
218
+        }
219
+        //查出来的数据
220
+        List<Map<String, Object>> list = agentDepotService.getDepotList(map);
221
+        //准备处理,每六条数据一个list
222
+        List<List<Map<String, Object>>> dataList = new ArrayList<List<Map<String, Object>>>();
223
+        List<Map<String, Object>> six = new ArrayList<Map<String, Object>>();
224
+        for (int i = 0;i<list.size();i++){
225
+            six.add(list.get(i));
226
+            //如果查出来的数据小于六条则直接加入总数据返回
227
+            if(ParameterUtil.isequal(six.size(),list.size())){
228
+                dataList.add(six);
229
+            }
230
+            if(ParameterUtil.isequal((i+1)%6,0)){
231
+                dataList.add(six);
232
+                six = new ArrayList<Map<String, Object>>();;
233
+            }
234
+        }
235
+        return dataList;
236
+    }
237
+
238
+//    /**
239
+//     * 保存已有粮库代储库信息----老--2019/20/23号,3个月后无改动可删除
240
+//     * @param depotList 已有粮库
241
+//     * @return
242
+//     * @throws Exception
243
+//     */
244
+//    @RequestMapping(value="/saveLaoDepot", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
245
+//    @ApiOperation(value="保存已有粮库代储库信息", notes = "保存已有粮库代储库信息")
246
+//    @ApiImplicitParams({
247
+//            @ApiImplicitParam(name = "depotList", value = "已有粮库", paramType = "form"),
248
+//            @ApiImplicitParam(name = "agentId", value = "代储点Id", paramType = "form"),
249
+//            @ApiImplicitParam(name = "orgId", value = "组织结构id", paramType = "form")
250
+//    })
251
+//    public Map<String, Object> saveLaoDepot(String depotList,String agentId,Integer orgId) throws Exception {
252
+//        Map<String, Object> modelMap = new HashMap<String, Object>();
253
+//        // JSON字符串转对象s
254
+//        List<String> depotLists= JSONArray.parseArray(depotList,String.class);
255
+//        for (String data:depotLists) {
256
+//            List<String> six= JSONArray.parseArray(data,String.class);
257
+//            for (String sixdata:six) {
258
+//                Map<String, String> map = ParameterUtil.stringToMap(sixdata.substring(1,sixdata.length()-1),":",",");
259
+//                if(ParameterUtil.isnotnull(map.get("stateLao")) && ParameterUtil.isequal(map.get("stateLao"),"1")){//判断库是否已经是代储库
260
+//                    //如果是代储库判断是否有改动
261
+//                    if(ParameterUtil.isequal(map.get("stateValue"),"0") || ParameterUtil.isequal(map.get("stateValue"),"false")){
262
+//                        this.removeStoreList(Integer.parseInt(map.get("id")));
263
+//                        //有改动直接修改状态为删除---1正常,2删除
264
+//                        agentDepotService.updateDeleteById(Integer.parseInt(map.get("id")),2);
265
+//                    }
266
+//                }else if(ParameterUtil.isequal(map.get("stateValue"),"true")){
267
+//                    //去数据库中查询,看看是否已经添加,但是删除的数据
268
+//                    Map<String,Object> getDepot = new HashMap<>();
269
+//                    getDepot.put("depotId",Integer.parseInt(map.get("orgId")));
270
+//                    List<Map<String,Object>> dataList = agentDepotService.getDepot(getDepot);
271
+//                    if(!ParameterUtil.isequal(dataList.size(),0)){//如果有已经添加但是删除的数据则回复成正常数据
272
+//                        agentDepotService.updateDeleteById(Integer.parseInt(dataList.get(0).get("id").toString()),1);
273
+//                    }else{//如果没有则新增
274
+//                        BusinessAgentDepot agentDepot = new BusinessAgentDepot();
275
+//                        agentDepot.setOrgId(orgId);
276
+//                        agentDepot.setDelFlag(1);
277
+//                        agentDepot.setAgentId(agentId);
278
+//                        agentDepot.setAgentDepotName(map.get("orgName").substring(1,map.get("orgName").length()-1));
279
+//                        agentDepot.setCreateTime(ParameterUtil.string2date(ParameterUtil.getSysDateTime()));//修改时间
280
+//                        agentDepot.setDepotId(Integer.parseInt(map.get("orgId")));
281
+//                        agentDepotService.add(agentDepot);
282
+//                    }
283
+//                }
284
+//            }
285
+//        }
286
+//
287
+//        modelMap.put("status", "success");
288
+//        return modelMap;
289
+//    }
290
+
291
+    /**
292
+     * 保存已有粮库代储库信息
293
+     * @param agentDepotId 选中粮库
294
+     * @return
295
+     * @throws Exception
296
+     */
297
+    @RequestMapping(value="/saveLaoDepot", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
298
+    @ApiOperation(value="保存已有粮库代储库信息", notes = "保存已有粮库代储库信息")
299
+    @ApiImplicitParams({
300
+            @ApiImplicitParam(name = "agentDepotId", value = "已有粮库", paramType = "form"),
301
+            @ApiImplicitParam(name = "storehouseId", value = "仓房id", paramType = "form"),
302
+            @ApiImplicitParam(name = "warehouIds", value = "货位id集合", paramType = "form"),
303
+            @ApiImplicitParam(name = "orgName", value = "组织结构名称", paramType = "form"),
304
+            @ApiImplicitParam(name = "orgId", value = "组织结构id", paramType = "form")
305
+    })
306
+    public Map<String, Object> saveLaoDepot(Integer agentDepotId,Integer storehouseId,String warehouIds,String orgName,Integer orgId) throws Exception {
307
+        //添加代储库
308
+        Map<String, Object> modelMap = new HashMap<String, Object>();
309
+        //查询是否已经添加过此粮库,如果添加过则过滤,不再添加
310
+        BusinessAgentDepotExample example = new BusinessAgentDepotExample();
311
+        BusinessAgentDepotExample.Criteria criteria = example.createCriteria();
312
+        criteria.andOrgIdEqualTo(agentDepotId);
313
+        criteria.andDepotIdEqualTo(orgId);
314
+        List<BusinessAgentDepot> depotNum = agentDepotService.selectIdNum(example);
315
+        //添加仓房
316
+        BusinessAgentStorehouse agentStorehouse = new BusinessAgentStorehouse();
317
+        agentStorehouse.setOrgId(agentDepotId);
318
+        agentStorehouse.setDelFlag(1);
319
+
320
+        if(depotNum.size() == 0){
321
+            BusinessAgentDepot agentDepot = new BusinessAgentDepot();
322
+            agentDepot.setOrgId(agentDepotId);
323
+            agentDepot.setDelFlag(1);
324
+            agentDepot.setAgentDepotName(orgName);
325
+            agentDepot.setCreateTime(ParameterUtil.string2date(ParameterUtil.getSysDateTime()));//修改时间
326
+            agentDepot.setDepotId(orgId);
327
+            agentDepotService.add(agentDepot);
328
+            agentStorehouse.setAgentDepotId(agentDepot.getId());
329
+        }else if(depotNum.get(0).getDelFlag() == 2){
330
+            agentDepotService.updateDeleteById(depotNum.get(0).getId(),1);
331
+            agentStorehouse.setAgentDepotId(depotNum.get(0).getId());
332
+        }else{
333
+            agentStorehouse.setAgentDepotId(depotNum.get(0).getId());
334
+        }
335
+
336
+        agentStorehouse.setCreateTime(ParameterUtil.string2date(ParameterUtil.getSysDateTime()));//修改时间
337
+        agentStorehouse.setStorehouseId(storehouseId);
338
+        agentStorehouseService.add(agentStorehouse);
339
+
340
+        //添加货位
341
+        String[] wareIds = warehouIds.split("\\|");
342
+        for (String wareId: wareIds ) {
343
+            BusinessAgentWarehouse agentWarehouse = new BusinessAgentWarehouse();
344
+            agentWarehouse.setWarehouseId(Integer.parseInt(wareId));
345
+            agentWarehouse.setAgentStorehouseId(agentStorehouse.getId());
346
+            agentWarehouse.setOrgId(agentDepotId);
347
+            agentWarehouse.setDelFlag(1);
348
+            agentWarehouse.setCreateTime(ParameterUtil.string2datetime(ParameterUtil.getSysDateTime()));//修改时间
349
+            agentWarehouse.setBgmxzTbsj(ParameterUtil.string2datetime(ParameterUtil.getSysDateTime()));
350
+            agentWarehouse.setQccrkTbsj(ParameterUtil.string2datetime(ParameterUtil.getSysDateTime()));
351
+            agentWarehouse.setHccrkTbsj(ParameterUtil.string2datetime(ParameterUtil.getSysDateTime()));
352
+            agentStoreWareService.addWareHouse(agentWarehouse);
353
+        }
354
+        modelMap.put("status", "success");
355
+        return modelMap;
356
+    }
357
+
358
+    /**
359
+     * 保存粮库代储企业信息
360
+     * @param agentId 选中粮库
361
+     * @return
362
+     * @throws Exception
363
+     */
364
+    @RequestMapping(value="/addAgentId", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
365
+    @ApiOperation(value="保存粮库代储企业信息", notes = "保存粮库代储企业信息")
366
+    @ApiImplicitParams({
367
+            @ApiImplicitParam(name = "id", value = "代储库id", paramType = "form"),
368
+            @ApiImplicitParam(name = "agentId", value = "代储企业id", paramType = "form")
369
+    })
370
+    public Map<String, Object> addAgentId(Integer id,String agentId) throws Exception {
371
+        //添加代储库
372
+        Map<String, Object> modelMap = new HashMap<String, Object>();
373
+        BusinessAgentDepot agentDepot = new BusinessAgentDepot();
374
+        agentDepot.setId(id);
375
+        agentDepot.setAgentId(agentId);
376
+        agentDepotService.updateByPrimaryKeySelective(agentDepot);
377
+        modelMap.put("status", "success");
378
+        return modelMap;
379
+    }
380
+
381
+    /**
382
+     * 导入excel
383
+     * @param file 文件
384
+     * @param fileType 类型:如xlsx
385
+     * @param orgId 组织机构id
386
+     * @return
387
+     */
388
+    @RequestMapping(value="/importDepotFile", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
389
+    @ApiOperation(value="导入excel", notes = "导入excel")
390
+    @ApiImplicitParams({
391
+            @ApiImplicitParam(name = "file", value = "文件数据", paramType = "query"),
392
+            @ApiImplicitParam(name = "fileType", value = "文件名", paramType = "query"),
393
+            @ApiImplicitParam(name = "rootPath", value = "路径", paramType = "query"),
394
+            @ApiImplicitParam(name = "orgId", value = "组织机构id", paramType = "query")
395
+    })
396
+    public Map<String, Object> importDepotFile(MultipartFile file, String fileType, HttpServletRequest request, Integer orgId){
397
+
398
+        String[] titleArr = {"库点名称","代储点名称", "库点类别", "设计仓容", "地址","电话","经度", "纬度", "所属行政区划分"};//第一行的title
399
+        boolean[] emptyArr = {false, false, false, true, true, true, true, true, false};//指定列可为空,不可为空值为false.
400
+
401
+        List<List<String>> list = new ArrayList<List<String>>();//该list为数据返回的list
402
+        Map<String, Object> fileMap = new HashMap<>();
403
+        String errormsg = null;
404
+        try {
405
+        	errormsg = importService.importFile(file, fileType, request, titleArr, emptyArr, list,0);
406
+
407
+            if (errormsg != null && !"".equals(errormsg)) {
408
+                fileMap.put("errormsg",errormsg);
409
+                return fileMap;
410
+            }
411
+
412
+            if (list.size()>0) {
413
+                errormsg = agentDepotService.importData(list, orgId);
414
+            }
415
+        } catch (Exception e) {
416
+            e.printStackTrace();
417
+        }
418
+        fileMap.put("errormsg",errormsg);
419
+        return fileMap;
420
+    }
421
+
422
+    //根据库id删除仓房
423
+    public void removeStoreList(Integer depotId){
424
+        BusinessAgentStorehouseExample example = new BusinessAgentStorehouseExample();
425
+        BusinessAgentStorehouseExample.Criteria criteria = example.createCriteria();
426
+        criteria.andAgentDepotIdEqualTo(depotId);
427
+        List<BusinessAgentStorehouse> storeList = agentStorehouseService.getStoreDataList(example);
428
+        for (BusinessAgentStorehouse storeData:storeList) {
429
+            agentStorehouseService.updateStoreDeleteById(storeData.getId(),2);
430
+
431
+            this.removeWareList(storeData.getId());
432
+        }
433
+    }
434
+
435
+    //根据仓房id删除货位
436
+    public void removeWareList(Integer storeHouseId){
437
+        BusinessAgentWarehouseExample example = new BusinessAgentWarehouseExample();
438
+        BusinessAgentWarehouseExample.Criteria criteria = example.createCriteria();
439
+        criteria.andAgentStorehouseIdEqualTo(storeHouseId);
440
+        List<BusinessAgentWarehouse> wareList = agentStoreWareService.getWareDataList(example);
441
+        for (BusinessAgentWarehouse wareData:wareList) {
442
+            agentStoreWareService.removeAgentWare(wareData.getId(),2);
443
+        }
444
+    }
445
+}

+ 127 - 0
src/main/java/com/chinaitop/depot/agent/basic/controller/AgentPeopleController.java

@@ -0,0 +1,127 @@
1
+package com.chinaitop.depot.agent.basic.controller;
2
+
3
+import com.chinaitop.depot.agent.basic.model.BusinessAgentPeople;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentPeopleExample;
5
+import com.chinaitop.depot.agent.basic.service.agentPeopleService;
6
+import com.chinaitop.depot.utils.ImportServiceImpl;
7
+import com.chinaitop.utils.ParameterUtil;
8
+import com.fasterxml.jackson.databind.ObjectMapper;
9
+import com.github.pagehelper.PageHelper;
10
+import com.github.pagehelper.PageInfo;
11
+import io.swagger.annotations.Api;
12
+import io.swagger.annotations.ApiImplicitParam;
13
+import io.swagger.annotations.ApiImplicitParams;
14
+import io.swagger.annotations.ApiOperation;
15
+import org.springframework.http.MediaType;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RequestMethod;
18
+import org.springframework.web.bind.annotation.RestController;
19
+
20
+import javax.annotation.Resource;
21
+import java.util.HashMap;
22
+import java.util.List;
23
+import java.util.Map;
24
+
25
+@RestController
26
+@RequestMapping(value = "/agentPeople")
27
+@Api(description = "人员信息管理")
28
+public class AgentPeopleController {
29
+
30
+    @Resource
31
+    private agentPeopleService agentPeopleService;
32
+
33
+    /**
34
+     * 查询人员信息记录
35
+     * @param pageNum
36
+     * @param pageSize
37
+     * @return
38
+     */
39
+    @RequestMapping(value = "/getAgentPeopleList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
40
+    @ApiOperation(value="人员信息", notes = "人员信息记录列表")
41
+    @ApiImplicitParams({
42
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
43
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
44
+            @ApiImplicitParam(name = "PeopleName", value = "人员名称", paramType = "query"),
45
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query")
46
+    })
47
+    public PageInfo<BusinessAgentPeople> getAgentPeopleList(Integer pageNum, Integer pageSize,String PeopleName,String orgId){
48
+
49
+        BusinessAgentPeopleExample example = new BusinessAgentPeopleExample();
50
+        BusinessAgentPeopleExample.Criteria criteria = example.createCriteria();
51
+        criteria.andOrgIdEqualTo(Integer.valueOf(orgId));
52
+        if(ParameterUtil.isnotnull(PeopleName)){
53
+            criteria.andPeopleNameLike("%"+PeopleName+"%");
54
+        }
55
+        example.setOrderByClause("updatetime desc");
56
+        PageHelper.startPage(pageNum, pageSize);
57
+        List<BusinessAgentPeople> list = agentPeopleService.getAgentList(example);
58
+        PageInfo<BusinessAgentPeople> pageInfo = new PageInfo<BusinessAgentPeople>(list);
59
+        return pageInfo;
60
+    }
61
+
62
+    /**
63
+     * 保存人员信息
64
+     * @param agentJson 主键id
65
+     * @return
66
+     * @throws Exception
67
+     */
68
+    @RequestMapping(value="/saveAgentPeople", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
69
+    @ApiOperation(value="保存人员信息", notes = "保存人员详细信息")
70
+    @ApiImplicitParams({
71
+            @ApiImplicitParam(name = "agentJson", value = "人员信息", paramType = "form"),
72
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query")
73
+    })
74
+    public Map<String, Object> saveAgentPeople(String agentJson,Integer orgId) throws Exception {
75
+        Map<String, Object> modelMap = new HashMap<String, Object>();
76
+        // JSON字符串转对象
77
+        ObjectMapper mapper = new ObjectMapper();
78
+        BusinessAgentPeople agentPeople = (BusinessAgentPeople)mapper.readValue(agentJson, BusinessAgentPeople.class);
79
+        agentPeople.setCreateTime(ParameterUtil.string2date(ParameterUtil.getSysDateTime()));//修改时间
80
+        if (agentPeople.getId() == null) {
81
+            agentPeople.setOrgId(orgId);
82
+            agentPeopleService.add(agentPeople);
83
+        } else {
84
+            agentPeopleService.update(agentPeople);
85
+        }
86
+        modelMap.put("agentId", agentPeople.getId());
87
+        modelMap.put("status", "success");
88
+        return modelMap;
89
+    }
90
+
91
+    /**
92
+     * 删除代储点信息
93
+     * @param id 主键id
94
+     * @return
95
+     */
96
+    @RequestMapping(value="/removeAgentPeople", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
97
+    @ApiOperation(value="删除人员信息", notes = "删除人员信息")
98
+    @ApiImplicitParams({
99
+            @ApiImplicitParam(name = "id", value = "主键id", paramType = "form")
100
+    })
101
+    public Map<String, Object> removeAgentPeople(Integer id){
102
+        Map<String, Object> modelMap = new HashMap<>();
103
+        if (id != null) {
104
+            agentPeopleService.updateDeleteById(id);
105
+            modelMap.put("status", "success");
106
+        }
107
+        return modelMap;
108
+    }
109
+
110
+    /**
111
+     * 根据id查找人员信息
112
+     * @param id 主键id
113
+     * @return
114
+     */
115
+    @RequestMapping(value="/edit", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
116
+    @ApiOperation(value="根据id查找人员信息", notes = "根据id查找人员信息")
117
+    @ApiImplicitParams({
118
+            @ApiImplicitParam(name = "id", value = "主键id", paramType = "query")
119
+    })
120
+    public BusinessAgentPeople edit(Integer id) {
121
+        BusinessAgentPeople agentPeople = new BusinessAgentPeople();
122
+        if (id != null) {
123
+            agentPeople = agentPeopleService.findById(id);
124
+        }
125
+        return agentPeople;
126
+    }
127
+}

+ 113 - 0
src/main/java/com/chinaitop/depot/agent/basic/controller/AgentStoreWareController.java

@@ -0,0 +1,113 @@
1
+package com.chinaitop.depot.agent.basic.controller;
2
+
3
+import java.util.HashMap;
4
+import java.util.List;
5
+import java.util.Map;
6
+
7
+import javax.annotation.Resource;
8
+
9
+import org.springframework.http.MediaType;
10
+import org.springframework.web.bind.annotation.RequestMapping;
11
+import org.springframework.web.bind.annotation.RequestMethod;
12
+import org.springframework.web.bind.annotation.RestController;
13
+
14
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse;
15
+import com.chinaitop.depot.agent.basic.service.agentStoreWareService;
16
+import com.chinaitop.utils.ParameterUtil;
17
+import com.github.pagehelper.PageHelper;
18
+import com.github.pagehelper.PageInfo;
19
+
20
+import io.swagger.annotations.Api;
21
+import io.swagger.annotations.ApiImplicitParam;
22
+import io.swagger.annotations.ApiImplicitParams;
23
+import io.swagger.annotations.ApiOperation;
24
+
25
+@RestController
26
+@RequestMapping(value = "/agentStoreWare")
27
+@Api(description = "代储货位信息管理")
28
+public class AgentStoreWareController {
29
+
30
+    @Resource
31
+    private agentStoreWareService agentStoreWareService;
32
+
33
+    /**
34
+     * 货位列表
35
+     * @return
36
+     */
37
+    @RequestMapping(value = "/getWareList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
38
+    @ApiOperation(value="货位列表", notes = "货位信息列表")
39
+    @ApiImplicitParams({
40
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
41
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
42
+            @ApiImplicitParam(name = "warehouseName", value = "货位名称", paramType = "query"),
43
+            @ApiImplicitParam(name = "storehouseId", value = "仓房id", paramType = "query"),
44
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query")
45
+    })
46
+    public PageInfo<Map<String,Object>> getWareList(Integer pageNum, Integer pageSize, String warehouseName, String storehouseId, String orgId){
47
+        Map<String,Object> map = new HashMap<>();
48
+        map.put("orgId",orgId);
49
+        if(ParameterUtil.isnotnull(warehouseName)){
50
+            map.put("warehouseName","%" + warehouseName + "%");
51
+        }
52
+        if(ParameterUtil.isnotnull(storehouseId)){
53
+            map.put("storehouseId",storehouseId);
54
+        }
55
+
56
+        PageHelper.startPage(pageNum, pageSize);
57
+        List<Map<String,Object>> list = agentStoreWareService.getWareList(map);
58
+        PageInfo<Map<String,Object>> pageInfo = new PageInfo<Map<String,Object>>(list);
59
+        //处理驼峰命名大写问题
60
+        List<Map<String, Object>> page_list = ParameterUtil.slashCapitals(pageInfo.getList());
61
+        pageInfo.setList(page_list);
62
+        return pageInfo;
63
+    }
64
+
65
+    /**
66
+     * 根据agent_storehouse_id(仓房id)和orgId 获取货位的列表
67
+     */
68
+    @RequestMapping(value = "/getAgentWarehouseList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
69
+    @ApiOperation(value="代储库的货位信息", notes = "代储库的货位信息")
70
+    @ApiImplicitParams({
71
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query"),
72
+            @ApiImplicitParam(name = "agentStorehouseId", value = "仓房id", paramType = "query")
73
+    })
74
+    public List<Map<String, Object>> getAgentWarehouseList(Integer orgId,Integer agentStorehouseId){
75
+        Map<String,Object> map = new HashMap<>();
76
+        map.put("orgId",orgId);
77
+        map.put("agentStorehouseId",agentStorehouseId);
78
+        List<Map<String, Object>> list = agentStoreWareService.getAgentStoreWare(map);
79
+        //处理驼峰命名大写问题
80
+        List<Map<String, Object>> listDatas = ParameterUtil.slashCapitals(list);
81
+        return listDatas;
82
+    }
83
+
84
+    /**
85
+     * 查询已有货位
86
+     */
87
+    @RequestMapping(value="/getWarehouse", method = RequestMethod.GET)
88
+    @ApiOperation(value="根据单位和仓房查询货位信息(货位对外接口)", notes = "根据单位和仓房查询货位信息(货位对外接口)")
89
+    @ApiImplicitParams({
90
+            @ApiImplicitParam(name = "unitId", value = "单位ID", paramType = "query"),
91
+            @ApiImplicitParam(name = "storehouseId", value = "仓房ID", paramType = "query")
92
+    })
93
+    public Map<String, Object> getWarehouse(Integer unitId, Integer storehouseId) {
94
+        Map<String, Object> map = null;
95
+
96
+        map = agentStoreWareService.getWarehouse(unitId, storehouseId);
97
+        //处理驼峰命名大写问题
98
+        Map<String, Object> mapData = ParameterUtil.slashCapitals(map);
99
+        return mapData;
100
+    }
101
+    
102
+    /**
103
+     * 除去代储货位的本库货位
104
+     */
105
+    @RequestMapping(value = "/getAgentWareHouseId", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
106
+    @ApiOperation(value="除去代储货位的本库货位", notes = "除去代储货位的本库货位")
107
+    @ApiImplicitParams({
108
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query")
109
+    })
110
+    public List<Integer> getAgentwareHouseId(Integer orgId){
111
+        return agentStoreWareService.getAgentwareHouseId(orgId);
112
+    }
113
+}

+ 224 - 0
src/main/java/com/chinaitop/depot/agent/basic/controller/AgentStorehouseController.java

@@ -0,0 +1,224 @@
1
+package com.chinaitop.depot.agent.basic.controller;
2
+
3
+import com.alibaba.fastjson.JSONArray;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouse;
5
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse;
6
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouseExample;
7
+import com.chinaitop.depot.agent.basic.service.agentDepotService;
8
+import com.chinaitop.depot.agent.basic.service.agentStoreWareService;
9
+import com.chinaitop.depot.agent.basic.service.agentStorehouseService;
10
+import com.chinaitop.utils.ParameterUtil;
11
+import com.github.pagehelper.PageHelper;
12
+import com.github.pagehelper.PageInfo;
13
+import io.swagger.annotations.Api;
14
+import io.swagger.annotations.ApiImplicitParam;
15
+import io.swagger.annotations.ApiImplicitParams;
16
+import io.swagger.annotations.ApiOperation;
17
+import org.springframework.http.MediaType;
18
+import org.springframework.web.bind.annotation.RequestMapping;
19
+import org.springframework.web.bind.annotation.RequestMethod;
20
+import org.springframework.web.bind.annotation.RestController;
21
+
22
+import javax.annotation.Resource;
23
+import java.util.ArrayList;
24
+import java.util.HashMap;
25
+import java.util.List;
26
+import java.util.Map;
27
+
28
+@RestController
29
+@RequestMapping(value = "/agentStorehouse")
30
+@Api(description = "代储仓房信息管理")
31
+public class AgentStorehouseController {
32
+
33
+    @Resource
34
+    private agentDepotService agentDepotService;
35
+
36
+    @Resource
37
+    private agentStorehouseService agentStorehouseService;
38
+
39
+    @Resource
40
+    private agentStoreWareService agentStoreWareService;
41
+
42
+    /**
43
+     * 代储库信息
44
+     * @return
45
+     */
46
+    @RequestMapping(value = "/getDepotInfo", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
47
+    @ApiOperation(value="代储库信息", notes = "代储点粮库信息列表")
48
+    @ApiImplicitParams({
49
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query")
50
+    })
51
+    public List<Map<String,Object>> getDepotInfo(String orgId){
52
+        Map<String,Object> map = new HashMap<>();
53
+        map.put("orgId",orgId);
54
+        List<Map<String,Object>> list = agentDepotService.getDepotLaoList(map);
55
+        //处理驼峰命名大写问题
56
+        List<Map<String, Object>> listDatas = ParameterUtil.slashCapitals(list);
57
+        return listDatas;
58
+    }
59
+
60
+    /**
61
+     * 代储仓房信息
62
+     * @return
63
+     */
64
+    @RequestMapping(value = "/getAgentStoreInfo", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
65
+    @ApiOperation(value="代储仓房信息", notes = "代储点仓房信息列表")
66
+    @ApiImplicitParams({
67
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query"),
68
+            @ApiImplicitParam(name = "depotId", value = "代储库id", paramType = "query")
69
+    })
70
+    public List<Map<String,Object>> getAgentStoreInfo(String depotId, String orgId){
71
+        Map<String,Object> map = new HashMap<>();
72
+        map.put("orgId",orgId);
73
+        map.put("depotId",depotId);
74
+        List<Map<String,Object>> list = agentStorehouseService.getAgentStoreInfo(map);
75
+        //处理驼峰命名大写问题
76
+        List<Map<String, Object>> listDatas = ParameterUtil.slashCapitals(list);
77
+        return listDatas;
78
+    }
79
+
80
+    /**
81
+     * 获取代储库下边的仓房信息,已有粮库和手加粮库都有
82
+     * @return
83
+     */
84
+    @RequestMapping(value = "/getDepotToStoreList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
85
+    @ApiOperation(value="代储仓房信息", notes = "代储点仓房信息列表")
86
+    @ApiImplicitParams({
87
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query"),
88
+            @ApiImplicitParam(name = "depotId", value = "代储库id", paramType = "query")
89
+    })
90
+    public List<Map<String,Object>> getDepotToStoreList(String orgId, String depotId){
91
+        Map<String,Object> map = new HashMap<>();
92
+        map.put("orgId",orgId);
93
+        map.put("depotId",depotId);
94
+        List<Map<String,Object>> list = agentStorehouseService.getDepotToStoreList(map);
95
+        //处理驼峰命名大写问题
96
+        List<Map<String, Object>> listDatas = ParameterUtil.slashCapitals(list);
97
+        return listDatas;
98
+    }
99
+
100
+    /**
101
+     * 仓房列表
102
+     * @return
103
+     */
104
+    @RequestMapping(value = "/getStoreList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
105
+    @ApiOperation(value="仓房列表", notes = "仓房信息列表")
106
+    @ApiImplicitParams({
107
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
108
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
109
+            @ApiImplicitParam(name = "agentDepotName", value = "代储库名称", paramType = "query"),
110
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query")
111
+    })
112
+    public PageInfo<Map<String,Object>> getStoreList(Integer pageNum, Integer pageSize, String agentDepotName, String orgId){
113
+        Map<String,Object> map = new HashMap<>();
114
+        map.put("orgId",orgId);
115
+        if(ParameterUtil.isnotnull(agentDepotName)){
116
+            map.put("agentDepotName","%" + agentDepotName + "%");
117
+        }
118
+
119
+        PageHelper.startPage(pageNum, pageSize);
120
+        List<Map<String,Object>> list = agentStorehouseService.getStoreList(map);
121
+        PageInfo<Map<String,Object>> pageInfo = new PageInfo<Map<String,Object>>(list);
122
+        //处理驼峰命名大写问题
123
+        List<Map<String, Object>> page_list = ParameterUtil.slashCapitals(pageInfo.getList());
124
+        pageInfo.setList(page_list);
125
+        return pageInfo;
126
+    }
127
+
128
+    /**
129
+     * 查找粮库下仓房
130
+     * @param orgId 组织机构名称
131
+     * @return
132
+     */
133
+    @RequestMapping(value="/getStorehouseList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
134
+    @ApiOperation(value="查找粮库下仓房", notes = "查找粮库下仓房信息")
135
+    @ApiImplicitParams({
136
+            @ApiImplicitParam(name="orgId", value="组织机构id", paramType="query"),
137
+            @ApiImplicitParam(name="depotId", value="代储点Id", paramType="query")
138
+    })
139
+    public List<List<Map<String, Object>>> getStorehouseList(String orgId,String depotId) {
140
+        Map<String,Object> map = new HashMap<>();
141
+        map.put("orgId",orgId);
142
+        if(ParameterUtil.isnotnull(depotId)){
143
+            map.put("depotId",depotId);
144
+        }
145
+        //查出来的数据
146
+        List<Map<String, Object>> list = agentStorehouseService.getStorehouseList(map);
147
+        //处理驼峰命名大写问题
148
+        List<Map<String, Object>> listDatas = ParameterUtil.slashCapitals(list);
149
+        //准备处理,每六条数据一个list
150
+        List<List<Map<String, Object>>> dataList = new ArrayList<List<Map<String, Object>>>();
151
+        List<Map<String, Object>> six = new ArrayList<Map<String, Object>>();
152
+        for (int i = 0;i<listDatas.size();i++){
153
+            six.add(listDatas.get(i));
154
+            //如果查出来的数据小于六条则直接加入总数据返回
155
+            if(ParameterUtil.isequal(six.size(),listDatas.size())){
156
+                dataList.add(six);
157
+            }
158
+            if(ParameterUtil.isequal((i+1)%6,0)){
159
+                dataList.add(six);
160
+                six = new ArrayList<Map<String, Object>>();;
161
+            }
162
+        }
163
+        return dataList;
164
+    }
165
+
166
+    /**
167
+     * 根据agent_depot_id、orgId 获取仓房信息
168
+     * @return
169
+     */
170
+    @RequestMapping(value = "/getAgentStorehouseInfo", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
171
+    @ApiOperation(value="代储仓房信息", notes = "代储点仓房信息列表")
172
+    @ApiImplicitParams({
173
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query")
174
+    })
175
+    public List<Map<String, Object>> getAgentStorehouseInfo(Integer orgId,Integer agentDepotId){
176
+        Map<String,Object> map = new HashMap<>();
177
+        map.put("orgId",orgId);
178
+        map.put("agentDepotId",agentDepotId);
179
+        List<Map<String, Object>> list = agentStorehouseService.getAgentStorehouse(map);
180
+        //处理驼峰命名大写问题
181
+        List<Map<String, Object>> listDatas = ParameterUtil.slashCapitals(list);
182
+        return listDatas;
183
+    }
184
+
185
+    //根据仓房id删除仓房
186
+    @RequestMapping(value="/removeStoreHouse", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
187
+    @ApiOperation(value="删除仓房", notes = "根据仓房id删除仓房")
188
+    @ApiImplicitParams({
189
+            @ApiImplicitParam(name = "depotId", value = "代储粮库id", paramType = "form"),
190
+            @ApiImplicitParam(name = "storehouseId", value = "仓房id", paramType = "form")
191
+    })
192
+    public void removeStoreHouse(Integer depotId,Integer storehouseId){
193
+        agentDepotService.updateDeleteById(depotId,2);
194
+        agentStorehouseService.updateStoreDeleteById(storehouseId,2);
195
+        this.removeWareList(storehouseId);
196
+    }
197
+
198
+    //根据仓房id删除货位
199
+    public void removeWareList(Integer storeHouseId){
200
+        BusinessAgentWarehouseExample example = new BusinessAgentWarehouseExample();
201
+        BusinessAgentWarehouseExample.Criteria criteria = example.createCriteria();
202
+        criteria.andAgentStorehouseIdEqualTo(storeHouseId);
203
+        List<BusinessAgentWarehouse> wareList = agentStoreWareService.getWareDataList(example);
204
+        for (BusinessAgentWarehouse wareData:wareList) {
205
+            agentStoreWareService.removeAgentWare(wareData.getId(),2);
206
+        }
207
+    }
208
+    
209
+    
210
+    /**
211
+     * 获取本库的代储仓房(启用着的)
212
+     * @return
213
+     */
214
+    @RequestMapping(value = "/getAgentHouseId", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
215
+    @ApiOperation(value="获取本库的代储仓房(启用着的)", notes = "获取本库的代储仓房(启用着的)")
216
+    @ApiImplicitParams({
217
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query")
218
+    })
219
+    public List<Integer> getAgentHouseId(Integer orgId){
220
+         
221
+        return agentDepotService.getAgentHouseId(orgId);
222
+    }
223
+    
224
+}

+ 175 - 0
src/main/java/com/chinaitop/depot/agent/basic/controller/AgentTankController.java

@@ -0,0 +1,175 @@
1
+package com.chinaitop.depot.agent.basic.controller;
2
+
3
+import com.chinaitop.depot.agent.basic.model.BusinessAgentTank;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentTankExample;
5
+import com.chinaitop.depot.agent.basic.service.agentTankService;
6
+import com.chinaitop.depot.agent.basic.service.agentTankService;
7
+import com.chinaitop.depot.utils.ImportServiceImpl;
8
+import com.chinaitop.utils.ParameterUtil;
9
+import com.fasterxml.jackson.databind.ObjectMapper;
10
+import com.github.pagehelper.PageHelper;
11
+import com.github.pagehelper.PageInfo;
12
+import io.swagger.annotations.Api;
13
+import io.swagger.annotations.ApiImplicitParam;
14
+import io.swagger.annotations.ApiImplicitParams;
15
+import io.swagger.annotations.ApiOperation;
16
+import org.springframework.http.MediaType;
17
+import org.springframework.web.bind.annotation.RequestMapping;
18
+import org.springframework.web.bind.annotation.RequestMethod;
19
+import org.springframework.web.bind.annotation.RestController;
20
+import org.springframework.web.multipart.MultipartFile;
21
+
22
+import javax.annotation.Resource;
23
+import javax.servlet.http.HttpServletRequest;
24
+import java.util.ArrayList;
25
+import java.util.HashMap;
26
+import java.util.List;
27
+import java.util.Map;
28
+
29
+@RestController
30
+@RequestMapping(value = "/agentTank")
31
+@Api(description = "油罐信息管理")
32
+public class AgentTankController {
33
+
34
+    @Resource
35
+    private agentTankService agentTankService;
36
+
37
+    @Resource
38
+    private ImportServiceImpl importService;
39
+
40
+    /**
41
+     * 查询油罐信息记录
42
+     * @param pageNum
43
+     * @param pageSize
44
+     * @return
45
+     */
46
+    @RequestMapping(value = "/getAgentTankList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
47
+    @ApiOperation(value="油罐信息", notes = "油罐信息记录列表")
48
+    @ApiImplicitParams({
49
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
50
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
51
+            @ApiImplicitParam(name = "tankNumber", value = "油罐编号", paramType = "query"),
52
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query")
53
+    })
54
+    public PageInfo<BusinessAgentTank> getAgentList(Integer pageNum, Integer pageSize,String tankNumber,String orgId){
55
+
56
+        BusinessAgentTankExample example = new BusinessAgentTankExample();
57
+        BusinessAgentTankExample.Criteria criteria = example.createCriteria();
58
+        criteria.andOrgIdEqualTo(Integer.valueOf(orgId));
59
+        if(ParameterUtil.isnotnull(tankNumber)){
60
+            criteria.andTankNumberLike("%" + tankNumber +"%");
61
+        }
62
+        example.setOrderByClause("updatetime desc");
63
+        PageHelper.startPage(pageNum, pageSize);
64
+        List<BusinessAgentTank> list = agentTankService.getAgentList(example);
65
+        PageInfo<BusinessAgentTank> pageInfo = new PageInfo<BusinessAgentTank>(list);
66
+        return pageInfo;
67
+    }
68
+
69
+    /**
70
+     * 保存代储点信息
71
+     * @param agentJson 主键id
72
+     * @return
73
+     * @throws Exception
74
+     */
75
+    @RequestMapping(value="/saveAgentTank", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
76
+    @ApiOperation(value="保存油罐信息", notes = "保存油罐详细信息")
77
+    @ApiImplicitParams({
78
+            @ApiImplicitParam(name = "agentJson", value = "油罐信息", paramType = "form"),
79
+            @ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query")
80
+    })
81
+    public Map<String, Object> saveAgent(String agentJson,Integer orgId) throws Exception {
82
+        Map<String, Object> modelMap = new HashMap<String, Object>();
83
+        // JSON字符串转对象
84
+        ObjectMapper mapper = new ObjectMapper();
85
+        BusinessAgentTank agent = (BusinessAgentTank)mapper.readValue(agentJson, BusinessAgentTank.class);
86
+        agent.setCreateTime(ParameterUtil.string2date(ParameterUtil.getSysDateTime()));//修改时间
87
+        if (ParameterUtil.isnull(agent.getId())) {
88
+            agent.setOrgId(orgId);
89
+            agentTankService.add(agent);
90
+        } else {
91
+            agentTankService.update(agent);
92
+        }
93
+        modelMap.put("agentId", agent.getId());
94
+        modelMap.put("status", "success");
95
+        return modelMap;
96
+    }
97
+
98
+    /**
99
+     * 删除油罐信息
100
+     * @param id 主键id
101
+     * @return
102
+     */
103
+    @RequestMapping(value="/removeAgentTank", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
104
+    @ApiOperation(value="删除油罐信息", notes = "删除油罐信息")
105
+    @ApiImplicitParams({
106
+            @ApiImplicitParam(name = "id", value = "主键id", paramType = "form")
107
+    })
108
+    public Map<String, Object> removeAgent(Integer id){
109
+        Map<String, Object> modelMap = new HashMap<>();
110
+        if (id != null) {
111
+            agentTankService.updateDeleteById(id);
112
+            modelMap.put("status", "success");
113
+        }
114
+        return modelMap;
115
+    }
116
+
117
+    /**
118
+     * 根据id查找代储点信息
119
+     * @param id 主键id
120
+     * @return
121
+     */
122
+    @RequestMapping(value="/edit", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
123
+    @ApiOperation(value="根据id查找油罐信息", notes = "根据id查找油罐信息")
124
+    @ApiImplicitParams({
125
+            @ApiImplicitParam(name = "id", value = "主键id", paramType = "query")
126
+    })
127
+    public BusinessAgentTank edit(Integer id) {
128
+        BusinessAgentTank agent = new BusinessAgentTank();
129
+        if (id != null) {
130
+            agent = agentTankService.findById(id);
131
+        }
132
+        return agent;
133
+    }
134
+
135
+    /**
136
+     * 导入excel
137
+     * @param file 文件
138
+     * @param fileType 类型:如xlsx
139
+     * @param orgId 组织机构id
140
+     * @return
141
+     */
142
+    @RequestMapping(value="/importFile", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
143
+    @ApiOperation(value="导入excel", notes = "导入excel")
144
+    @ApiImplicitParams({
145
+            @ApiImplicitParam(name = "file", value = "文件数据", paramType = "query"),
146
+            @ApiImplicitParam(name = "fileType", value = "文件名", paramType = "query"),
147
+            @ApiImplicitParam(name = "rootPath", value = "路径", paramType = "query"),
148
+            @ApiImplicitParam(name = "orgId", value = "组织机构id", paramType = "query")
149
+    })
150
+    public Map<String, Object> importFile(MultipartFile file, String fileType, HttpServletRequest request, Integer orgId){
151
+
152
+        String[] titleArr = {"粮库名称","油罐编号", "设计容量", "设计年限", "是否国债投资", "启用日期", "当前状态", "责任保管员"};//第一行的title
153
+        boolean[] emptyArr = {false, false, false, false, false, false, false, false};//指定列可为空,不可为空值为false.
154
+
155
+        List<List<String>> list = new ArrayList<List<String>>();//该list为数据返回的list
156
+        Map<String, Object> fileMap = new HashMap<>();
157
+        String errormsg = null;
158
+        try {
159
+        	errormsg = importService.importFile(file, fileType, request, titleArr, emptyArr, list,0);
160
+
161
+            if (errormsg != null && !"".equals(errormsg)) {
162
+                fileMap.put("errormsg",errormsg);
163
+                return fileMap;
164
+            }
165
+
166
+            if (list.size()>0) {
167
+                errormsg = agentTankService.importData(list, orgId);
168
+            }
169
+        } catch (Exception e) {
170
+            e.printStackTrace();
171
+        }
172
+        fileMap.put("errormsg",errormsg);
173
+        return fileMap;
174
+    }
175
+}

+ 40 - 0
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentDepotMapper.java

@@ -0,0 +1,40 @@
1
+package com.chinaitop.depot.agent.basic.mapper;
2
+
3
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepot;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepotExample;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+public interface BusinessAgentDepotMapper {
11
+    int countByExample(BusinessAgentDepotExample example);
12
+
13
+    int deleteByExample(BusinessAgentDepotExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessAgentDepot record);
18
+
19
+    int insertSelective(BusinessAgentDepot record);
20
+
21
+    List<BusinessAgentDepot> selectByExample(BusinessAgentDepotExample example);
22
+
23
+    BusinessAgentDepot selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessAgentDepot record, @Param("example") BusinessAgentDepotExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessAgentDepot record, @Param("example") BusinessAgentDepotExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessAgentDepot record);
30
+
31
+    int updateByPrimaryKey(BusinessAgentDepot record);
32
+
33
+    List<Map<String,Object>> getDepotList(Map<String,Object> map);
34
+
35
+    List<Map<String,Object>> getDepot(Map<String,Object> map);
36
+
37
+    List<BusinessAgentDepot> getByExample(Map<String,Object> map);
38
+
39
+    List<Map<String,Object>> getDepotLaoList(Map<String,Object> map);
40
+}

+ 468 - 0
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentDepotMapper.xml

@@ -0,0 +1,468 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.agent.basic.mapper.BusinessAgentDepotMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.basic.model.BusinessAgentDepot" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="agent_id" property="agentId" jdbcType="VARCHAR" />
7
+    <result column="depot_id" property="depotId" jdbcType="INTEGER" />
8
+    <result column="agent_depot_name" property="agentDepotName" jdbcType="VARCHAR" />
9
+    <result column="depot_type" property="depotType" jdbcType="VARCHAR" />
10
+    <result column="design_storage" property="designStorage" jdbcType="VARCHAR" />
11
+    <result column="address" property="address" jdbcType="VARCHAR" />
12
+    <result column="phone" property="phone" jdbcType="VARCHAR" />
13
+    <result column="longitude" property="longitude" jdbcType="VARCHAR" />
14
+    <result column="latitude" property="latitude" jdbcType="VARCHAR" />
15
+    <result column="administrative_area" property="administrativeArea" jdbcType="VARCHAR" />
16
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
17
+    <result column="del_flag" property="delFlag" jdbcType="INTEGER" />
18
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
19
+    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
20
+  </resultMap>
21
+  <sql id="Example_Where_Clause" >
22
+    <where >
23
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
24
+        <if test="criteria.valid" >
25
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
26
+            <foreach collection="criteria.criteria" item="criterion" >
27
+              <choose >
28
+                <when test="criterion.noValue" >
29
+                  and ${criterion.condition}
30
+                </when>
31
+                <when test="criterion.singleValue" >
32
+                  and ${criterion.condition} #{criterion.value}
33
+                </when>
34
+                <when test="criterion.betweenValue" >
35
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
36
+                </when>
37
+                <when test="criterion.listValue" >
38
+                  and ${criterion.condition}
39
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
40
+                    #{listItem}
41
+                  </foreach>
42
+                </when>
43
+              </choose>
44
+            </foreach>
45
+          </trim>
46
+        </if>
47
+      </foreach>
48
+    </where>
49
+  </sql>
50
+  <sql id="Update_By_Example_Where_Clause" >
51
+    <where >
52
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
53
+        <if test="criteria.valid" >
54
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
55
+            <foreach collection="criteria.criteria" item="criterion" >
56
+              <choose >
57
+                <when test="criterion.noValue" >
58
+                  and ${criterion.condition}
59
+                </when>
60
+                <when test="criterion.singleValue" >
61
+                  and ${criterion.condition} #{criterion.value}
62
+                </when>
63
+                <when test="criterion.betweenValue" >
64
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
65
+                </when>
66
+                <when test="criterion.listValue" >
67
+                  and ${criterion.condition}
68
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
69
+                    #{listItem}
70
+                  </foreach>
71
+                </when>
72
+              </choose>
73
+            </foreach>
74
+          </trim>
75
+        </if>
76
+      </foreach>
77
+    </where>
78
+  </sql>
79
+  <sql id="Base_Column_List" >
80
+    id, agent_id, depot_id, agent_depot_name, depot_type, design_storage, address, phone, 
81
+    longitude, latitude, administrative_area, org_id, del_flag, create_time, updatetime
82
+  </sql>
83
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentDepotExample" >
84
+    select
85
+    <if test="distinct" >
86
+      distinct
87
+    </if>
88
+    <include refid="Base_Column_List" />
89
+    from business_agent_depot
90
+    <if test="_parameter != null" >
91
+      <include refid="Example_Where_Clause" />
92
+    </if>
93
+    <if test="orderByClause != null" >
94
+      order by ${orderByClause}
95
+    </if>
96
+  </select>
97
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
98
+    select 
99
+    <include refid="Base_Column_List" />
100
+    from business_agent_depot
101
+    where id = #{id,jdbcType=INTEGER}
102
+  </select>
103
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
104
+    delete from business_agent_depot
105
+    where id = #{id,jdbcType=INTEGER}
106
+  </delete>
107
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentDepotExample" >
108
+    delete from business_agent_depot
109
+    <if test="_parameter != null" >
110
+      <include refid="Example_Where_Clause" />
111
+    </if>
112
+  </delete>
113
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentDepot" >
114
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
115
+      select seq_business_agent_depot.nextVal from dual
116
+    </selectKey>
117
+    insert into business_agent_depot (id, agent_id, depot_id, 
118
+      agent_depot_name, depot_type, design_storage, 
119
+      address, phone, longitude, 
120
+      latitude, administrative_area, org_id, 
121
+      del_flag, create_time, updatetime
122
+      )
123
+    values (#{id,jdbcType=INTEGER}, #{agentId,jdbcType=VARCHAR}, #{depotId,jdbcType=INTEGER},
124
+      #{agentDepotName,jdbcType=VARCHAR}, #{depotType,jdbcType=VARCHAR}, #{designStorage,jdbcType=VARCHAR}, 
125
+      #{address,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, 
126
+      #{latitude,jdbcType=VARCHAR}, #{administrativeArea,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, 
127
+      #{delFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}
128
+      )
129
+  </insert>
130
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentDepot" >
131
+    insert into business_agent_depot
132
+    <trim prefix="(" suffix=")" suffixOverrides="," >
133
+      <if test="id != null" >
134
+        id,
135
+      </if>
136
+      <if test="agentId != null" >
137
+        agent_id,
138
+      </if>
139
+      <if test="depotId != null" >
140
+        depot_id,
141
+      </if>
142
+      <if test="agentDepotName != null" >
143
+        agent_depot_name,
144
+      </if>
145
+      <if test="depotType != null" >
146
+        depot_type,
147
+      </if>
148
+      <if test="designStorage != null" >
149
+        design_storage,
150
+      </if>
151
+      <if test="address != null" >
152
+        address,
153
+      </if>
154
+      <if test="phone != null" >
155
+        phone,
156
+      </if>
157
+      <if test="longitude != null" >
158
+        longitude,
159
+      </if>
160
+      <if test="latitude != null" >
161
+        latitude,
162
+      </if>
163
+      <if test="administrativeArea != null" >
164
+        administrative_area,
165
+      </if>
166
+      <if test="orgId != null" >
167
+        org_id,
168
+      </if>
169
+      <if test="delFlag != null" >
170
+        del_flag,
171
+      </if>
172
+      <if test="createTime != null" >
173
+        create_time,
174
+      </if>
175
+      <if test="updatetime != null" >
176
+        updatetime,
177
+      </if>
178
+    </trim>
179
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
180
+      <if test="id != null" >
181
+        #{id,jdbcType=INTEGER},
182
+      </if>
183
+      <if test="agentId != null" >
184
+        #{agentId,jdbcType=VARCHAR},
185
+      </if>
186
+      <if test="depotId != null" >
187
+        #{depotId,jdbcType=INTEGER},
188
+      </if>
189
+      <if test="agentDepotName != null" >
190
+        #{agentDepotName,jdbcType=VARCHAR},
191
+      </if>
192
+      <if test="depotType != null" >
193
+        #{depotType,jdbcType=VARCHAR},
194
+      </if>
195
+      <if test="designStorage != null" >
196
+        #{designStorage,jdbcType=VARCHAR},
197
+      </if>
198
+      <if test="address != null" >
199
+        #{address,jdbcType=VARCHAR},
200
+      </if>
201
+      <if test="phone != null" >
202
+        #{phone,jdbcType=VARCHAR},
203
+      </if>
204
+      <if test="longitude != null" >
205
+        #{longitude,jdbcType=VARCHAR},
206
+      </if>
207
+      <if test="latitude != null" >
208
+        #{latitude,jdbcType=VARCHAR},
209
+      </if>
210
+      <if test="administrativeArea != null" >
211
+        #{administrativeArea,jdbcType=VARCHAR},
212
+      </if>
213
+      <if test="orgId != null" >
214
+        #{orgId,jdbcType=INTEGER},
215
+      </if>
216
+      <if test="delFlag != null" >
217
+        #{delFlag,jdbcType=INTEGER},
218
+      </if>
219
+      <if test="createTime != null" >
220
+        #{createTime,jdbcType=TIMESTAMP},
221
+      </if>
222
+      <if test="updatetime != null" >
223
+        #{updatetime,jdbcType=TIMESTAMP},
224
+      </if>
225
+    </trim>
226
+  </insert>
227
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentDepotExample" resultType="java.lang.Integer" >
228
+    select count(*) from business_agent_depot
229
+    <if test="_parameter != null" >
230
+      <include refid="Example_Where_Clause" />
231
+    </if>
232
+  </select>
233
+  <update id="updateByExampleSelective" parameterType="map" >
234
+    update business_agent_depot
235
+    <set >
236
+      <if test="record.id != null" >
237
+        id = #{record.id,jdbcType=INTEGER},
238
+      </if>
239
+      <if test="record.agentId != null" >
240
+        agent_id = #{record.agentId,jdbcType=VARCHAR},
241
+      </if>
242
+      <if test="record.depotId != null" >
243
+        depot_id = #{record.depotId,jdbcType=INTEGER},
244
+      </if>
245
+      <if test="record.agentDepotName != null" >
246
+        agent_depot_name = #{record.agentDepotName,jdbcType=VARCHAR},
247
+      </if>
248
+      <if test="record.depotType != null" >
249
+        depot_type = #{record.depotType,jdbcType=VARCHAR},
250
+      </if>
251
+      <if test="record.designStorage != null" >
252
+        design_storage = #{record.designStorage,jdbcType=VARCHAR},
253
+      </if>
254
+      <if test="record.address != null" >
255
+        address = #{record.address,jdbcType=VARCHAR},
256
+      </if>
257
+      <if test="record.phone != null" >
258
+        phone = #{record.phone,jdbcType=VARCHAR},
259
+      </if>
260
+      <if test="record.longitude != null" >
261
+        longitude = #{record.longitude,jdbcType=VARCHAR},
262
+      </if>
263
+      <if test="record.latitude != null" >
264
+        latitude = #{record.latitude,jdbcType=VARCHAR},
265
+      </if>
266
+      <if test="record.administrativeArea != null" >
267
+        administrative_area = #{record.administrativeArea,jdbcType=VARCHAR},
268
+      </if>
269
+      <if test="record.orgId != null" >
270
+        org_id = #{record.orgId,jdbcType=INTEGER},
271
+      </if>
272
+      <if test="record.delFlag != null" >
273
+        del_flag = #{record.delFlag,jdbcType=INTEGER},
274
+      </if>
275
+      <if test="record.createTime != null" >
276
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
277
+      </if>
278
+      <if test="record.updatetime != null" >
279
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
280
+      </if>
281
+    </set>
282
+    <if test="_parameter != null" >
283
+      <include refid="Update_By_Example_Where_Clause" />
284
+    </if>
285
+  </update>
286
+  <update id="updateByExample" parameterType="map" >
287
+    update business_agent_depot
288
+    set id = #{record.id,jdbcType=INTEGER},
289
+      agent_id = #{record.agentId,jdbcType=VARCHAR},
290
+      depot_id = #{record.depotId,jdbcType=INTEGER},
291
+      agent_depot_name = #{record.agentDepotName,jdbcType=VARCHAR},
292
+      depot_type = #{record.depotType,jdbcType=VARCHAR},
293
+      design_storage = #{record.designStorage,jdbcType=VARCHAR},
294
+      address = #{record.address,jdbcType=VARCHAR},
295
+      phone = #{record.phone,jdbcType=VARCHAR},
296
+      longitude = #{record.longitude,jdbcType=VARCHAR},
297
+      latitude = #{record.latitude,jdbcType=VARCHAR},
298
+      administrative_area = #{record.administrativeArea,jdbcType=VARCHAR},
299
+      org_id = #{record.orgId,jdbcType=INTEGER},
300
+      del_flag = #{record.delFlag,jdbcType=INTEGER},
301
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
302
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
303
+    <if test="_parameter != null" >
304
+      <include refid="Update_By_Example_Where_Clause" />
305
+    </if>
306
+  </update>
307
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentDepot" >
308
+    update business_agent_depot
309
+    <set >
310
+      <if test="agentId != null" >
311
+        agent_id = #{agentId,jdbcType=VARCHAR},
312
+      </if>
313
+      <if test="depotId != null" >
314
+        depot_id = #{depotId,jdbcType=INTEGER},
315
+      </if>
316
+      <if test="agentDepotName != null" >
317
+        agent_depot_name = #{agentDepotName,jdbcType=VARCHAR},
318
+      </if>
319
+      <if test="depotType != null" >
320
+        depot_type = #{depotType,jdbcType=VARCHAR},
321
+      </if>
322
+      <if test="designStorage != null" >
323
+        design_storage = #{designStorage,jdbcType=VARCHAR},
324
+      </if>
325
+      <if test="address != null" >
326
+        address = #{address,jdbcType=VARCHAR},
327
+      </if>
328
+      <if test="phone != null" >
329
+        phone = #{phone,jdbcType=VARCHAR},
330
+      </if>
331
+      <if test="longitude != null" >
332
+        longitude = #{longitude,jdbcType=VARCHAR},
333
+      </if>
334
+      <if test="latitude != null" >
335
+        latitude = #{latitude,jdbcType=VARCHAR},
336
+      </if>
337
+      <if test="administrativeArea != null" >
338
+        administrative_area = #{administrativeArea,jdbcType=VARCHAR},
339
+      </if>
340
+      <if test="orgId != null" >
341
+        org_id = #{orgId,jdbcType=INTEGER},
342
+      </if>
343
+      <if test="delFlag != null" >
344
+        del_flag = #{delFlag,jdbcType=INTEGER},
345
+      </if>
346
+      <if test="createTime != null" >
347
+        create_time = #{createTime,jdbcType=TIMESTAMP},
348
+      </if>
349
+      <if test="updatetime != null" >
350
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
351
+      </if>
352
+    </set>
353
+    where id = #{id,jdbcType=INTEGER}
354
+  </update>
355
+  <update id="updateByPrimaryKey" useGeneratedKeys="true" keyProperty="id" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentDepot" >
356
+    update business_agent_depot
357
+    set agent_id = #{agentId,jdbcType=VARCHAR},
358
+      depot_id = #{depotId,jdbcType=INTEGER},
359
+      agent_depot_name = #{agentDepotName,jdbcType=VARCHAR},
360
+      depot_type = #{depotType,jdbcType=VARCHAR},
361
+      design_storage = #{designStorage,jdbcType=VARCHAR},
362
+      address = #{address,jdbcType=VARCHAR},
363
+      phone = #{phone,jdbcType=VARCHAR},
364
+      longitude = #{longitude,jdbcType=VARCHAR},
365
+      latitude = #{latitude,jdbcType=VARCHAR},
366
+      administrative_area = #{administrativeArea,jdbcType=VARCHAR},
367
+      org_id = #{orgId,jdbcType=INTEGER},
368
+      del_flag = #{delFlag,jdbcType=INTEGER},
369
+      create_time = #{createTime,jdbcType=TIMESTAMP},
370
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
371
+    where id = #{id,jdbcType=INTEGER}
372
+  </update>
373
+  <select id="getDepotList" resultType="java.util.Map" parameterType="java.util.Map">
374
+    SELECT
375
+        store.id,
376
+        store.agent_depot_id depot_id,
377
+        org.org_id,
378
+        org.org_name,
379
+        NVL2(store.id,'true','false') state_value,
380
+        NVL2(store.id,org.org_code,null) org_code,
381
+        NVL2(store.id,org.area_name,null) area_name
382
+    FROM
383
+        org_info org
384
+    LEFT JOIN business_agent_storehouse store ON store.org_id = org.org_id
385
+        AND store.del_flag = 1 AND store.storehouse_id = #{storehouseId,jdbcType=VARCHAR}
386
+    WHERE org.org_class_id = 5318
387
+    <if test="orgName != null">
388
+      AND org.org_name LIKE #{orgName,jdbcType=VARCHAR}
389
+    </if>
390
+  </select>
391
+  <select id="getByExample" resultMap="BaseResultMap" parameterType="java.util.Map">
392
+    SELECT
393
+    *
394
+    FROM
395
+    (
396
+    SELECT
397
+    depot.id,
398
+    depot.depot_id,
399
+    depot.agent_depot_name,
400
+    depot.agent_id,
401
+    depot.depot_type,
402
+    depot.design_storage,
403
+    depot.address,
404
+    depot.administrative_area,
405
+    depot.updatetime
406
+    FROM
407
+    business_agent_depot depot
408
+    WHERE
409
+    depot.depot_id = 0 AND depot.del_flag = 1 AND depot.org_id = #{orgId,jdbcType=INTEGER}
410
+    <if test="agentDepotName != null">
411
+      AND depot.agent_depot_name LIKE #{agentDepotName,jdbcType=VARCHAR}
412
+    </if>
413
+    <if test="agentId != null">
414
+      AND depot.agent_id LIKE #{agentId,jdbcType=VARCHAR}
415
+    </if>
416
+    UNION ALL
417
+    SELECT
418
+    depot.id,
419
+    depot.depot_id,
420
+    depot.agent_depot_name,
421
+    depot.agent_id,
422
+    depotType.enumName,
423
+    org.design_capacity design_storage,
424
+    org.address,
425
+    org.area_name administrative_area,
426
+    depot.updatetime
427
+    FROM
428
+    business_agent_depot depot
429
+    LEFT JOIN org_info org ON org.org_id = depot.depot_id
430
+    LEFT JOIN basic_enum depotType ON depotType.enumId = org.company_nature
431
+    WHERE depot.org_id = #{orgId,jdbcType=INTEGER} AND depot.del_flag = 1
432
+    AND depot.depot_id != 0
433
+    <if test="agentDepotName != null">
434
+      AND depot.agent_depot_name LIKE #{agentDepotName,jdbcType=VARCHAR}
435
+    </if>
436
+    <if test="agentId != null">
437
+      AND depot.agent_id = #{agentId,jdbcType=VARCHAR}
438
+    </if>
439
+    ) t
440
+    ORDER BY
441
+    t.updatetime DESC
442
+  </select>
443
+  <select id="getDepotLaoList" resultType="java.util.Map" parameterType="java.util.Map">
444
+    SELECT
445
+        depot.id,
446
+        depot.depot_id,
447
+        depot.agent_depot_name,
448
+        depot.agent_id,
449
+        depotType.enumName depot_type,
450
+        org.design_capacity design_storage,
451
+        org.address,
452
+        org.area_name administrative_area,
453
+        depot.updatetime
454
+    FROM
455
+        business_agent_depot depot
456
+    LEFT JOIN org_info org ON org.org_id = depot.depot_id
457
+    LEFT JOIN basic_enum depotType ON depotType.enumId = org.company_nature
458
+    WHERE depot.depot_id != 0 AND depot.del_flag = 1 AND depot.org_id = #{orgId,jdbcType=INTEGER}
459
+  </select>
460
+  <select id="getDepot" resultType="java.util.Map" parameterType="java.util.Map">
461
+    SELECT
462
+        id
463
+    FROM
464
+        business_agent_depot
465
+    WHERE
466
+        depot_id != 0 AND depot_id = #{depotId,jdbcType=VARCHAR}
467
+  </select>
468
+</mapper>

+ 43 - 0
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentMapper.java

@@ -0,0 +1,43 @@
1
+package com.chinaitop.depot.agent.basic.mapper;
2
+
3
+import com.chinaitop.depot.agent.basic.model.BusinessAgent;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentExample;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+public interface BusinessAgentMapper {
11
+    int countByExample(BusinessAgentExample example);
12
+
13
+    int deleteByExample(BusinessAgentExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessAgent record);
18
+
19
+    int insertSelective(BusinessAgent record);
20
+
21
+    List<BusinessAgent> selectByExample(BusinessAgentExample example);
22
+
23
+    BusinessAgent selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessAgent record, @Param("example") BusinessAgentExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessAgent record, @Param("example") BusinessAgentExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessAgent record);
30
+
31
+    int updateByPrimaryKey(BusinessAgent record);
32
+
33
+    Map<String,Object> getNameId(Map<String, Object> map);
34
+    //根据名称查询id
35
+    Map<String,Object> getEnumId(Map<String, Object> map);
36
+
37
+    //根据名称查询子节点id
38
+    Map<String,Object> getEnumChildId(Map<String, Object> map);
39
+
40
+    Map<String,Object> getStorehouseId(Map<String, Object> map);
41
+
42
+    Map<String,Object> getWarehouseId(Map<String, Object> map);
43
+}

+ 460 - 0
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentMapper.xml

@@ -0,0 +1,460 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.agent.basic.mapper.BusinessAgentMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.basic.model.BusinessAgent" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="agent_name" property="agentName" jdbcType="VARCHAR" />
7
+    <result column="legal_person" property="legalPerson" jdbcType="VARCHAR" />
8
+    <result column="credit_code" property="creditCode" jdbcType="VARCHAR" />
9
+    <result column="agent_nature" property="agentNature" jdbcType="VARCHAR" />
10
+    <result column="agent_type" property="agentType" jdbcType="VARCHAR" />
11
+    <result column="capacity" property="capacity" jdbcType="VARCHAR" />
12
+    <result column="person" property="person" jdbcType="VARCHAR" />
13
+    <result column="credit" property="credit" jdbcType="VARCHAR" />
14
+    <result column="longitude" property="longitude" jdbcType="VARCHAR" />
15
+    <result column="latitude" property="latitude" jdbcType="VARCHAR" />
16
+    <result column="administrative_area" property="administrativeArea" jdbcType="VARCHAR" />
17
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
18
+    <result column="del_flag" property="delFlag" jdbcType="INTEGER" />
19
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
20
+    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
21
+  </resultMap>
22
+  <sql id="Example_Where_Clause" >
23
+    <where >
24
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
25
+        <if test="criteria.valid" >
26
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
27
+            <foreach collection="criteria.criteria" item="criterion" >
28
+              <choose >
29
+                <when test="criterion.noValue" >
30
+                  and ${criterion.condition}
31
+                </when>
32
+                <when test="criterion.singleValue" >
33
+                  and ${criterion.condition} #{criterion.value}
34
+                </when>
35
+                <when test="criterion.betweenValue" >
36
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
37
+                </when>
38
+                <when test="criterion.listValue" >
39
+                  and ${criterion.condition}
40
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
41
+                    #{listItem}
42
+                  </foreach>
43
+                </when>
44
+              </choose>
45
+            </foreach>
46
+          </trim>
47
+        </if>
48
+      </foreach>
49
+    </where>
50
+  </sql>
51
+  <sql id="Update_By_Example_Where_Clause" >
52
+    <where >
53
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
54
+        <if test="criteria.valid" >
55
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
56
+            <foreach collection="criteria.criteria" item="criterion" >
57
+              <choose >
58
+                <when test="criterion.noValue" >
59
+                  and ${criterion.condition}
60
+                </when>
61
+                <when test="criterion.singleValue" >
62
+                  and ${criterion.condition} #{criterion.value}
63
+                </when>
64
+                <when test="criterion.betweenValue" >
65
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
66
+                </when>
67
+                <when test="criterion.listValue" >
68
+                  and ${criterion.condition}
69
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
70
+                    #{listItem}
71
+                  </foreach>
72
+                </when>
73
+              </choose>
74
+            </foreach>
75
+          </trim>
76
+        </if>
77
+      </foreach>
78
+    </where>
79
+  </sql>
80
+  <sql id="Base_Column_List" >
81
+    id, agent_name, legal_person, credit_code, agent_nature, agent_type, capacity, person, 
82
+    credit, longitude, latitude, administrative_area, org_id, del_flag, create_time, 
83
+    updatetime
84
+  </sql>
85
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentExample" >
86
+    select
87
+    <if test="distinct" >
88
+      distinct
89
+    </if>
90
+    <include refid="Base_Column_List" />
91
+    from business_agent
92
+    <if test="_parameter != null" >
93
+      <include refid="Example_Where_Clause" />
94
+    </if>
95
+    <if test="orderByClause != null" >
96
+      order by ${orderByClause}
97
+    </if>
98
+  </select>
99
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
100
+    select 
101
+    <include refid="Base_Column_List" />
102
+    from business_agent
103
+    where id = #{id,jdbcType=INTEGER}
104
+  </select>
105
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
106
+    delete from business_agent
107
+    where id = #{id,jdbcType=INTEGER}
108
+  </delete>
109
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentExample" >
110
+    delete from business_agent
111
+    <if test="_parameter != null" >
112
+      <include refid="Example_Where_Clause" />
113
+    </if>
114
+  </delete>
115
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgent" >
116
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
117
+      select seq_business_agent.nextVal from dual
118
+    </selectKey>
119
+    insert into business_agent (id, agent_name, legal_person, 
120
+      credit_code, agent_nature, agent_type, 
121
+      capacity, person, credit, 
122
+      longitude, latitude, administrative_area, 
123
+      org_id, del_flag, create_time, 
124
+      updatetime)
125
+    values (#{id,jdbcType=INTEGER}, #{agentName,jdbcType=VARCHAR}, #{legalPerson,jdbcType=VARCHAR},
126
+      #{creditCode,jdbcType=VARCHAR}, #{agentNature,jdbcType=VARCHAR}, #{agentType,jdbcType=VARCHAR}, 
127
+      #{capacity,jdbcType=VARCHAR}, #{person,jdbcType=VARCHAR}, #{credit,jdbcType=VARCHAR}, 
128
+      #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, #{administrativeArea,jdbcType=VARCHAR}, 
129
+      #{orgId,jdbcType=INTEGER}, #{delFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
130
+      #{updatetime,jdbcType=TIMESTAMP})
131
+  </insert>
132
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgent" >
133
+    insert into business_agent
134
+    <trim prefix="(" suffix=")" suffixOverrides="," >
135
+      <if test="id != null" >
136
+        id,
137
+      </if>
138
+      <if test="agentName != null" >
139
+        agent_name,
140
+      </if>
141
+      <if test="legalPerson != null" >
142
+        legal_person,
143
+      </if>
144
+      <if test="creditCode != null" >
145
+        credit_code,
146
+      </if>
147
+      <if test="agentNature != null" >
148
+        agent_nature,
149
+      </if>
150
+      <if test="agentType != null" >
151
+        agent_type,
152
+      </if>
153
+      <if test="capacity != null" >
154
+        capacity,
155
+      </if>
156
+      <if test="person != null" >
157
+        person,
158
+      </if>
159
+      <if test="credit != null" >
160
+        credit,
161
+      </if>
162
+      <if test="longitude != null" >
163
+        longitude,
164
+      </if>
165
+      <if test="latitude != null" >
166
+        latitude,
167
+      </if>
168
+      <if test="administrativeArea != null" >
169
+        administrative_area,
170
+      </if>
171
+      <if test="orgId != null" >
172
+        org_id,
173
+      </if>
174
+      <if test="delFlag != null" >
175
+        del_flag,
176
+      </if>
177
+      <if test="createTime != null" >
178
+        create_time,
179
+      </if>
180
+      <if test="updatetime != null" >
181
+        updatetime,
182
+      </if>
183
+    </trim>
184
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
185
+      <if test="id != null" >
186
+        seq_business_agent.nextVal,
187
+      </if>
188
+      <if test="agentName != null" >
189
+        #{agentName,jdbcType=VARCHAR},
190
+      </if>
191
+      <if test="legalPerson != null" >
192
+        #{legalPerson,jdbcType=VARCHAR},
193
+      </if>
194
+      <if test="creditCode != null" >
195
+        #{creditCode,jdbcType=VARCHAR},
196
+      </if>
197
+      <if test="agentNature != null" >
198
+        #{agentNature,jdbcType=VARCHAR},
199
+      </if>
200
+      <if test="agentType != null" >
201
+        #{agentType,jdbcType=VARCHAR},
202
+      </if>
203
+      <if test="capacity != null" >
204
+        #{capacity,jdbcType=VARCHAR},
205
+      </if>
206
+      <if test="person != null" >
207
+        #{person,jdbcType=VARCHAR},
208
+      </if>
209
+      <if test="credit != null" >
210
+        #{credit,jdbcType=VARCHAR},
211
+      </if>
212
+      <if test="longitude != null" >
213
+        #{longitude,jdbcType=VARCHAR},
214
+      </if>
215
+      <if test="latitude != null" >
216
+        #{latitude,jdbcType=VARCHAR},
217
+      </if>
218
+      <if test="administrativeArea != null" >
219
+        #{administrativeArea,jdbcType=VARCHAR},
220
+      </if>
221
+      <if test="orgId != null" >
222
+        #{orgId,jdbcType=INTEGER},
223
+      </if>
224
+      <if test="delFlag != null" >
225
+        #{delFlag,jdbcType=INTEGER},
226
+      </if>
227
+      <if test="createTime != null" >
228
+        #{createTime,jdbcType=TIMESTAMP},
229
+      </if>
230
+      <if test="updatetime != null" >
231
+        #{updatetime,jdbcType=TIMESTAMP},
232
+      </if>
233
+    </trim>
234
+  </insert>
235
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentExample" resultType="java.lang.Integer" >
236
+    select count(*) from business_agent
237
+    <if test="_parameter != null" >
238
+      <include refid="Example_Where_Clause" />
239
+    </if>
240
+  </select>
241
+  <update id="updateByExampleSelective" parameterType="map" >
242
+    update business_agent
243
+    <set >
244
+      <if test="record.id != null" >
245
+        id = #{record.id,jdbcType=INTEGER},
246
+      </if>
247
+      <if test="record.agentName != null" >
248
+        agent_name = #{record.agentName,jdbcType=VARCHAR},
249
+      </if>
250
+      <if test="record.legalPerson != null" >
251
+        legal_person = #{record.legalPerson,jdbcType=VARCHAR},
252
+      </if>
253
+      <if test="record.creditCode != null" >
254
+        credit_code = #{record.creditCode,jdbcType=VARCHAR},
255
+      </if>
256
+      <if test="record.agentNature != null" >
257
+        agent_nature = #{record.agentNature,jdbcType=VARCHAR},
258
+      </if>
259
+      <if test="record.agentType != null" >
260
+        agent_type = #{record.agentType,jdbcType=VARCHAR},
261
+      </if>
262
+      <if test="record.capacity != null" >
263
+        capacity = #{record.capacity,jdbcType=VARCHAR},
264
+      </if>
265
+      <if test="record.person != null" >
266
+        person = #{record.person,jdbcType=VARCHAR},
267
+      </if>
268
+      <if test="record.credit != null" >
269
+        credit = #{record.credit,jdbcType=VARCHAR},
270
+      </if>
271
+      <if test="record.longitude != null" >
272
+        longitude = #{record.longitude,jdbcType=VARCHAR},
273
+      </if>
274
+      <if test="record.latitude != null" >
275
+        latitude = #{record.latitude,jdbcType=VARCHAR},
276
+      </if>
277
+      <if test="record.administrativeArea != null" >
278
+        administrative_area = #{record.administrativeArea,jdbcType=VARCHAR},
279
+      </if>
280
+      <if test="record.orgId != null" >
281
+        org_id = #{record.orgId,jdbcType=INTEGER},
282
+      </if>
283
+      <if test="record.delFlag != null" >
284
+        del_flag = #{record.delFlag,jdbcType=INTEGER},
285
+      </if>
286
+      <if test="record.createTime != null" >
287
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
288
+      </if>
289
+      <if test="record.updatetime != null" >
290
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
291
+      </if>
292
+    </set>
293
+    <if test="_parameter != null" >
294
+      <include refid="Update_By_Example_Where_Clause" />
295
+    </if>
296
+  </update>
297
+  <update id="updateByExample" parameterType="map" >
298
+    update business_agent
299
+    set id = #{record.id,jdbcType=INTEGER},
300
+      agent_name = #{record.agentName,jdbcType=VARCHAR},
301
+      legal_person = #{record.legalPerson,jdbcType=VARCHAR},
302
+      credit_code = #{record.creditCode,jdbcType=VARCHAR},
303
+      agent_nature = #{record.agentNature,jdbcType=VARCHAR},
304
+      agent_type = #{record.agentType,jdbcType=VARCHAR},
305
+      capacity = #{record.capacity,jdbcType=VARCHAR},
306
+      person = #{record.person,jdbcType=VARCHAR},
307
+      credit = #{record.credit,jdbcType=VARCHAR},
308
+      longitude = #{record.longitude,jdbcType=VARCHAR},
309
+      latitude = #{record.latitude,jdbcType=VARCHAR},
310
+      administrative_area = #{record.administrativeArea,jdbcType=VARCHAR},
311
+      org_id = #{record.orgId,jdbcType=INTEGER},
312
+      del_flag = #{record.delFlag,jdbcType=INTEGER},
313
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
314
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
315
+    <if test="_parameter != null" >
316
+      <include refid="Update_By_Example_Where_Clause" />
317
+    </if>
318
+  </update>
319
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgent" >
320
+    update business_agent
321
+    <set >
322
+      <if test="agentName != null" >
323
+        agent_name = #{agentName,jdbcType=VARCHAR},
324
+      </if>
325
+      <if test="legalPerson != null" >
326
+        legal_person = #{legalPerson,jdbcType=VARCHAR},
327
+      </if>
328
+      <if test="creditCode != null" >
329
+        credit_code = #{creditCode,jdbcType=VARCHAR},
330
+      </if>
331
+      <if test="agentNature != null" >
332
+        agent_nature = #{agentNature,jdbcType=VARCHAR},
333
+      </if>
334
+      <if test="agentType != null" >
335
+        agent_type = #{agentType,jdbcType=VARCHAR},
336
+      </if>
337
+      <if test="capacity != null" >
338
+        capacity = #{capacity,jdbcType=VARCHAR},
339
+      </if>
340
+      <if test="person != null" >
341
+        person = #{person,jdbcType=VARCHAR},
342
+      </if>
343
+      <if test="credit != null" >
344
+        credit = #{credit,jdbcType=VARCHAR},
345
+      </if>
346
+      <if test="longitude != null" >
347
+        longitude = #{longitude,jdbcType=VARCHAR},
348
+      </if>
349
+      <if test="latitude != null" >
350
+        latitude = #{latitude,jdbcType=VARCHAR},
351
+      </if>
352
+      <if test="administrativeArea != null" >
353
+        administrative_area = #{administrativeArea,jdbcType=VARCHAR},
354
+      </if>
355
+      <if test="orgId != null" >
356
+        org_id = #{orgId,jdbcType=INTEGER},
357
+      </if>
358
+      <if test="delFlag != null" >
359
+        del_flag = #{delFlag,jdbcType=INTEGER},
360
+      </if>
361
+      <if test="createTime != null" >
362
+        create_time = #{createTime,jdbcType=TIMESTAMP},
363
+      </if>
364
+      <if test="updatetime != null" >
365
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
366
+      </if>
367
+    </set>
368
+    where id = #{id,jdbcType=INTEGER}
369
+  </update>
370
+  <update id="updateByPrimaryKey" useGeneratedKeys="true" keyProperty="id" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgent" >
371
+    update business_agent
372
+    set agent_name = #{agentName,jdbcType=VARCHAR},
373
+      legal_person = #{legalPerson,jdbcType=VARCHAR},
374
+      credit_code = #{creditCode,jdbcType=VARCHAR},
375
+      agent_nature = #{agentNature,jdbcType=VARCHAR},
376
+      agent_type = #{agentType,jdbcType=VARCHAR},
377
+      capacity = #{capacity,jdbcType=VARCHAR},
378
+      person = #{person,jdbcType=VARCHAR},
379
+      credit = #{credit,jdbcType=VARCHAR},
380
+      longitude = #{longitude,jdbcType=VARCHAR},
381
+      latitude = #{latitude,jdbcType=VARCHAR},
382
+      administrative_area = #{administrativeArea,jdbcType=VARCHAR},
383
+      org_id = #{orgId,jdbcType=INTEGER},
384
+      del_flag = #{delFlag,jdbcType=INTEGER},
385
+      create_time = #{createTime,jdbcType=TIMESTAMP},
386
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
387
+    where id = #{id,jdbcType=INTEGER}
388
+  </update>
389
+  <select id="getNameId" parameterType="java.util.Map" resultType="java.util.HashMap">
390
+      SELECT
391
+          agent.id agentId,
392
+          depot.id depotId
393
+      FROM
394
+          business_agent agent
395
+      INNER JOIN business_agent_depot depot ON depot.agent_id = agent.id
396
+      WHERE
397
+          agent.del_flag = 1
398
+      AND depot.del_flag = 1
399
+      AND agent.agent_name = #{agentName}
400
+      AND depot.agent_depot_name = #{agentDepotName}
401
+  </select>
402
+  <select id="getEnumId" parameterType="java.util.Map" resultType="java.util.HashMap">
403
+      SELECT
404
+          enumId
405
+      FROM
406
+          basic_enum
407
+      WHERE
408
+          parentId = #{parentId}
409
+      AND enumName = #{enumName}
410
+  </select>
411
+  <select id="getEnumChildId" parameterType="java.util.Map" resultType="java.util.HashMap">
412
+      SELECT
413
+          enumId
414
+      FROM
415
+          basic_enum
416
+      WHERE
417
+          parentId = (
418
+              SELECT
419
+                  enumId
420
+              FROM
421
+                  basic_enum
422
+              WHERE
423
+                  parentId = #{parentId}
424
+              AND gbCode = (
425
+                  SELECT
426
+                      substr(enumCode, 1, 1)
427
+                  FROM
428
+                      basic_enum
429
+                  WHERE
430
+                      parentId = #{parentId}
431
+                  AND enumName = #{enumName}
432
+              )
433
+          )
434
+      AND enumName = #{enumName}
435
+  </select>
436
+  <select id="getStorehouseId" parameterType="java.util.Map" resultType="java.util.HashMap">
437
+      SELECT
438
+          storehouse_id storehouseId
439
+      FROM
440
+          basic_storehouse
441
+      WHERE
442
+          library_type = '1'
443
+      AND del_flag = 1
444
+      AND depot_id = #{depotId}
445
+      AND storehouse_name = #{storehouseName}
446
+  </select>
447
+  <select id="getWarehouseId" parameterType="java.util.Map" resultType="java.util.HashMap">
448
+      SELECT
449
+          whouse.warehouse_id warehouseId
450
+      FROM
451
+          basic_warehouse whouse
452
+      LEFT JOIN basic_storehouse shouse ON shouse.storehouse_id = whouse.storehouse_id
453
+      WHERE
454
+          whouse.library_type = '1'
455
+      AND whouse.del_flag = 1
456
+      AND shouse.del_flag = 1
457
+      AND whouse.warehouse_name = #{warehouseName}
458
+      AND shouse.storehouse_name = #{storehouseName}
459
+  </select>
460
+</mapper>

+ 30 - 0
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentPeopleMapper.java

@@ -0,0 +1,30 @@
1
+package com.chinaitop.depot.agent.basic.mapper;
2
+
3
+import com.chinaitop.depot.agent.basic.model.BusinessAgentPeople;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentPeopleExample;
5
+import java.util.List;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+public interface BusinessAgentPeopleMapper {
9
+    int countByExample(BusinessAgentPeopleExample example);
10
+
11
+    int deleteByExample(BusinessAgentPeopleExample example);
12
+
13
+    int deleteByPrimaryKey(Integer id);
14
+
15
+    int insert(BusinessAgentPeople record);
16
+
17
+    int insertSelective(BusinessAgentPeople record);
18
+
19
+    List<BusinessAgentPeople> selectByExample(BusinessAgentPeopleExample example);
20
+
21
+    BusinessAgentPeople selectByPrimaryKey(Integer id);
22
+
23
+    int updateByExampleSelective(@Param("record") BusinessAgentPeople record, @Param("example") BusinessAgentPeopleExample example);
24
+
25
+    int updateByExample(@Param("record") BusinessAgentPeople record, @Param("example") BusinessAgentPeopleExample example);
26
+
27
+    int updateByPrimaryKeySelective(BusinessAgentPeople record);
28
+
29
+    int updateByPrimaryKey(BusinessAgentPeople record);
30
+}

+ 326 - 0
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentPeopleMapper.xml

@@ -0,0 +1,326 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.agent.basic.mapper.BusinessAgentPeopleMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.basic.model.BusinessAgentPeople" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="depot_id" property="depotId" jdbcType="INTEGER" />
7
+    <result column="people_name" property="peopleName" jdbcType="VARCHAR" />
8
+    <result column="gender" property="gender" jdbcType="VARCHAR" />
9
+    <result column="credit_code" property="creditCode" jdbcType="VARCHAR" />
10
+    <result column="id_number" property="idNumber" jdbcType="VARCHAR" />
11
+    <result column="work_experience" property="workExperience" jdbcType="VARCHAR" />
12
+    <result column="native_place" property="nativePlace" jdbcType="VARCHAR" />
13
+    <result column="home_address" property="homeAddress" jdbcType="VARCHAR" />
14
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
15
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
16
+    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
17
+  </resultMap>
18
+  <sql id="Example_Where_Clause" >
19
+    <where >
20
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
21
+        <if test="criteria.valid" >
22
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
23
+            <foreach collection="criteria.criteria" item="criterion" >
24
+              <choose >
25
+                <when test="criterion.noValue" >
26
+                  and ${criterion.condition}
27
+                </when>
28
+                <when test="criterion.singleValue" >
29
+                  and ${criterion.condition} #{criterion.value}
30
+                </when>
31
+                <when test="criterion.betweenValue" >
32
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
33
+                </when>
34
+                <when test="criterion.listValue" >
35
+                  and ${criterion.condition}
36
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
37
+                    #{listItem}
38
+                  </foreach>
39
+                </when>
40
+              </choose>
41
+            </foreach>
42
+          </trim>
43
+        </if>
44
+      </foreach>
45
+    </where>
46
+  </sql>
47
+  <sql id="Update_By_Example_Where_Clause" >
48
+    <where >
49
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
50
+        <if test="criteria.valid" >
51
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
52
+            <foreach collection="criteria.criteria" item="criterion" >
53
+              <choose >
54
+                <when test="criterion.noValue" >
55
+                  and ${criterion.condition}
56
+                </when>
57
+                <when test="criterion.singleValue" >
58
+                  and ${criterion.condition} #{criterion.value}
59
+                </when>
60
+                <when test="criterion.betweenValue" >
61
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
62
+                </when>
63
+                <when test="criterion.listValue" >
64
+                  and ${criterion.condition}
65
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
66
+                    #{listItem}
67
+                  </foreach>
68
+                </when>
69
+              </choose>
70
+            </foreach>
71
+          </trim>
72
+        </if>
73
+      </foreach>
74
+    </where>
75
+  </sql>
76
+  <sql id="Base_Column_List" >
77
+    id, depot_id, people_name, gender, credit_code, id_number, work_experience, native_place, 
78
+    home_address, org_id, create_time, updatetime
79
+  </sql>
80
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentPeopleExample" >
81
+    select
82
+    <if test="distinct" >
83
+      distinct
84
+    </if>
85
+    <include refid="Base_Column_List" />
86
+    from business_agent_people
87
+    <if test="_parameter != null" >
88
+      <include refid="Example_Where_Clause" />
89
+    </if>
90
+    <if test="orderByClause != null" >
91
+      order by ${orderByClause}
92
+    </if>
93
+  </select>
94
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
95
+    select 
96
+    <include refid="Base_Column_List" />
97
+    from business_agent_people
98
+    where id = #{id,jdbcType=INTEGER}
99
+  </select>
100
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
101
+    delete from business_agent_people
102
+    where id = #{id,jdbcType=INTEGER}
103
+  </delete>
104
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentPeopleExample" >
105
+    delete from business_agent_people
106
+    <if test="_parameter != null" >
107
+      <include refid="Example_Where_Clause" />
108
+    </if>
109
+  </delete>
110
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentPeople" >
111
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
112
+      select seq_business_agent_people.nextVal from dual
113
+    </selectKey>
114
+    insert into business_agent_people (id, depot_id, people_name, 
115
+      gender, credit_code, id_number, 
116
+      work_experience, native_place, home_address, 
117
+      org_id, create_time, updatetime
118
+      )
119
+    values (#{id,jdbcType=INTEGER}, #{depotId,jdbcType=INTEGER}, #{peopleName,jdbcType=VARCHAR},
120
+      #{gender,jdbcType=VARCHAR}, #{creditCode,jdbcType=VARCHAR}, #{idNumber,jdbcType=VARCHAR}, 
121
+      #{workExperience,jdbcType=VARCHAR}, #{nativePlace,jdbcType=VARCHAR}, #{homeAddress,jdbcType=VARCHAR}, 
122
+      #{orgId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}
123
+      )
124
+  </insert>
125
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentPeople" >
126
+    insert into business_agent_people
127
+    <trim prefix="(" suffix=")" suffixOverrides="," >
128
+      <if test="id != null" >
129
+        id,
130
+      </if>
131
+      <if test="depotId != null" >
132
+        depot_id,
133
+      </if>
134
+      <if test="peopleName != null" >
135
+        people_name,
136
+      </if>
137
+      <if test="gender != null" >
138
+        gender,
139
+      </if>
140
+      <if test="creditCode != null" >
141
+        credit_code,
142
+      </if>
143
+      <if test="idNumber != null" >
144
+        id_number,
145
+      </if>
146
+      <if test="workExperience != null" >
147
+        work_experience,
148
+      </if>
149
+      <if test="nativePlace != null" >
150
+        native_place,
151
+      </if>
152
+      <if test="homeAddress != null" >
153
+        home_address,
154
+      </if>
155
+      <if test="orgId != null" >
156
+        org_id,
157
+      </if>
158
+      <if test="createTime != null" >
159
+        create_time,
160
+      </if>
161
+      <if test="updatetime != null" >
162
+        updatetime,
163
+      </if>
164
+    </trim>
165
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
166
+      <if test="id != null" >
167
+        #{id,jdbcType=INTEGER},
168
+      </if>
169
+      <if test="depotId != null" >
170
+        #{depotId,jdbcType=INTEGER},
171
+      </if>
172
+      <if test="peopleName != null" >
173
+        #{peopleName,jdbcType=VARCHAR},
174
+      </if>
175
+      <if test="gender != null" >
176
+        #{gender,jdbcType=VARCHAR},
177
+      </if>
178
+      <if test="creditCode != null" >
179
+        #{creditCode,jdbcType=VARCHAR},
180
+      </if>
181
+      <if test="idNumber != null" >
182
+        #{idNumber,jdbcType=VARCHAR},
183
+      </if>
184
+      <if test="workExperience != null" >
185
+        #{workExperience,jdbcType=VARCHAR},
186
+      </if>
187
+      <if test="nativePlace != null" >
188
+        #{nativePlace,jdbcType=VARCHAR},
189
+      </if>
190
+      <if test="homeAddress != null" >
191
+        #{homeAddress,jdbcType=VARCHAR},
192
+      </if>
193
+      <if test="orgId != null" >
194
+        #{orgId,jdbcType=INTEGER},
195
+      </if>
196
+      <if test="createTime != null" >
197
+        #{createTime,jdbcType=TIMESTAMP},
198
+      </if>
199
+      <if test="updatetime != null" >
200
+        #{updatetime,jdbcType=TIMESTAMP},
201
+      </if>
202
+    </trim>
203
+  </insert>
204
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentPeopleExample" resultType="java.lang.Integer" >
205
+    select count(*) from business_agent_people
206
+    <if test="_parameter != null" >
207
+      <include refid="Example_Where_Clause" />
208
+    </if>
209
+  </select>
210
+  <update id="updateByExampleSelective" parameterType="map" >
211
+    update business_agent_people
212
+    <set >
213
+      <if test="record.id != null" >
214
+        id = #{record.id,jdbcType=INTEGER},
215
+      </if>
216
+      <if test="record.depotId != null" >
217
+        depot_id = #{record.depotId,jdbcType=INTEGER},
218
+      </if>
219
+      <if test="record.peopleName != null" >
220
+        people_name = #{record.peopleName,jdbcType=VARCHAR},
221
+      </if>
222
+      <if test="record.gender != null" >
223
+        gender = #{record.gender,jdbcType=VARCHAR},
224
+      </if>
225
+      <if test="record.creditCode != null" >
226
+        credit_code = #{record.creditCode,jdbcType=VARCHAR},
227
+      </if>
228
+      <if test="record.idNumber != null" >
229
+        id_number = #{record.idNumber,jdbcType=VARCHAR},
230
+      </if>
231
+      <if test="record.workExperience != null" >
232
+        work_experience = #{record.workExperience,jdbcType=VARCHAR},
233
+      </if>
234
+      <if test="record.nativePlace != null" >
235
+        native_place = #{record.nativePlace,jdbcType=VARCHAR},
236
+      </if>
237
+      <if test="record.homeAddress != null" >
238
+        home_address = #{record.homeAddress,jdbcType=VARCHAR},
239
+      </if>
240
+      <if test="record.orgId != null" >
241
+        org_id = #{record.orgId,jdbcType=INTEGER},
242
+      </if>
243
+      <if test="record.createTime != null" >
244
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
245
+      </if>
246
+      <if test="record.updatetime != null" >
247
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
248
+      </if>
249
+    </set>
250
+    <if test="_parameter != null" >
251
+      <include refid="Update_By_Example_Where_Clause" />
252
+    </if>
253
+  </update>
254
+  <update id="updateByExample" parameterType="map" >
255
+    update business_agent_people
256
+    set id = #{record.id,jdbcType=INTEGER},
257
+      depot_id = #{record.depotId,jdbcType=INTEGER},
258
+      people_name = #{record.peopleName,jdbcType=VARCHAR},
259
+      gender = #{record.gender,jdbcType=VARCHAR},
260
+      credit_code = #{record.creditCode,jdbcType=VARCHAR},
261
+      id_number = #{record.idNumber,jdbcType=VARCHAR},
262
+      work_experience = #{record.workExperience,jdbcType=VARCHAR},
263
+      native_place = #{record.nativePlace,jdbcType=VARCHAR},
264
+      home_address = #{record.homeAddress,jdbcType=VARCHAR},
265
+      org_id = #{record.orgId,jdbcType=INTEGER},
266
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
267
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
268
+    <if test="_parameter != null" >
269
+      <include refid="Update_By_Example_Where_Clause" />
270
+    </if>
271
+  </update>
272
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentPeople" >
273
+    update business_agent_people
274
+    <set >
275
+      <if test="depotId != null" >
276
+        depot_id = #{depotId,jdbcType=INTEGER},
277
+      </if>
278
+      <if test="peopleName != null" >
279
+        people_name = #{peopleName,jdbcType=VARCHAR},
280
+      </if>
281
+      <if test="gender != null" >
282
+        gender = #{gender,jdbcType=VARCHAR},
283
+      </if>
284
+      <if test="creditCode != null" >
285
+        credit_code = #{creditCode,jdbcType=VARCHAR},
286
+      </if>
287
+      <if test="idNumber != null" >
288
+        id_number = #{idNumber,jdbcType=VARCHAR},
289
+      </if>
290
+      <if test="workExperience != null" >
291
+        work_experience = #{workExperience,jdbcType=VARCHAR},
292
+      </if>
293
+      <if test="nativePlace != null" >
294
+        native_place = #{nativePlace,jdbcType=VARCHAR},
295
+      </if>
296
+      <if test="homeAddress != null" >
297
+        home_address = #{homeAddress,jdbcType=VARCHAR},
298
+      </if>
299
+      <if test="orgId != null" >
300
+        org_id = #{orgId,jdbcType=INTEGER},
301
+      </if>
302
+      <if test="createTime != null" >
303
+        create_time = #{createTime,jdbcType=TIMESTAMP},
304
+      </if>
305
+      <if test="updatetime != null" >
306
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
307
+      </if>
308
+    </set>
309
+    where id = #{id,jdbcType=INTEGER}
310
+  </update>
311
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentPeople" >
312
+    update business_agent_people
313
+    set depot_id = #{depotId,jdbcType=INTEGER},
314
+      people_name = #{peopleName,jdbcType=VARCHAR},
315
+      gender = #{gender,jdbcType=VARCHAR},
316
+      credit_code = #{creditCode,jdbcType=VARCHAR},
317
+      id_number = #{idNumber,jdbcType=VARCHAR},
318
+      work_experience = #{workExperience,jdbcType=VARCHAR},
319
+      native_place = #{nativePlace,jdbcType=VARCHAR},
320
+      home_address = #{homeAddress,jdbcType=VARCHAR},
321
+      org_id = #{orgId,jdbcType=INTEGER},
322
+      create_time = #{createTime,jdbcType=TIMESTAMP},
323
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
324
+    where id = #{id,jdbcType=INTEGER}
325
+  </update>
326
+</mapper>

+ 46 - 0
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentStorehouseMapper.java

@@ -0,0 +1,46 @@
1
+package com.chinaitop.depot.agent.basic.mapper;
2
+
3
+import com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouse;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouseExample;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+public interface BusinessAgentStorehouseMapper {
11
+    int countByExample(BusinessAgentStorehouseExample example);
12
+
13
+    int deleteByExample(BusinessAgentStorehouseExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessAgentStorehouse record);
18
+
19
+    int insertSelective(BusinessAgentStorehouse record);
20
+
21
+    List<BusinessAgentStorehouse> selectByExample(BusinessAgentStorehouseExample example);
22
+
23
+    BusinessAgentStorehouse selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessAgentStorehouse record, @Param("example") BusinessAgentStorehouseExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessAgentStorehouse record, @Param("example") BusinessAgentStorehouseExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessAgentStorehouse record);
30
+
31
+    int updateByPrimaryKey(BusinessAgentStorehouse record);
32
+
33
+    List<Map<String, Object>> getAgentStorehouse(Map<String, Object> map);
34
+
35
+    List<Map<String,Object>> getStorehouseList(Map<String,Object> map);
36
+
37
+    List<Map<String,Object>> getStoreList(Map<String,Object> map);
38
+
39
+    List<Map<String,Object>> getDepotToStoreList(Map<String,Object> map);
40
+
41
+    List<Map<String,Object>> getAgentStoreInfo(Map<String,Object> map);
42
+
43
+	List<Integer> getAgentHouseId(Integer orgId);
44
+
45
+    List<Map<String,Object>> getStore(Map<String,Object> map);
46
+}

+ 367 - 0
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentStorehouseMapper.xml

@@ -0,0 +1,367 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.agent.basic.mapper.BusinessAgentStorehouseMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouse" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="storehouse_id" property="storehouseId" jdbcType="INTEGER" />
7
+    <result column="agent_depot_id" property="agentDepotId" jdbcType="INTEGER" />
8
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
9
+    <result column="del_flag" property="delFlag" jdbcType="INTEGER" />
10
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
11
+  </resultMap>
12
+  <sql id="Example_Where_Clause" >
13
+    <where >
14
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
15
+        <if test="criteria.valid" >
16
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
17
+            <foreach collection="criteria.criteria" item="criterion" >
18
+              <choose >
19
+                <when test="criterion.noValue" >
20
+                  and ${criterion.condition}
21
+                </when>
22
+                <when test="criterion.singleValue" >
23
+                  and ${criterion.condition} #{criterion.value}
24
+                </when>
25
+                <when test="criterion.betweenValue" >
26
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
27
+                </when>
28
+                <when test="criterion.listValue" >
29
+                  and ${criterion.condition}
30
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
31
+                    #{listItem}
32
+                  </foreach>
33
+                </when>
34
+              </choose>
35
+            </foreach>
36
+          </trim>
37
+        </if>
38
+      </foreach>
39
+    </where>
40
+  </sql>
41
+  <sql id="Update_By_Example_Where_Clause" >
42
+    <where >
43
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
44
+        <if test="criteria.valid" >
45
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
46
+            <foreach collection="criteria.criteria" item="criterion" >
47
+              <choose >
48
+                <when test="criterion.noValue" >
49
+                  and ${criterion.condition}
50
+                </when>
51
+                <when test="criterion.singleValue" >
52
+                  and ${criterion.condition} #{criterion.value}
53
+                </when>
54
+                <when test="criterion.betweenValue" >
55
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
56
+                </when>
57
+                <when test="criterion.listValue" >
58
+                  and ${criterion.condition}
59
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
60
+                    #{listItem}
61
+                  </foreach>
62
+                </when>
63
+              </choose>
64
+            </foreach>
65
+          </trim>
66
+        </if>
67
+      </foreach>
68
+    </where>
69
+  </sql>
70
+  <sql id="Base_Column_List" >
71
+    id, storehouse_id, agent_depot_id, org_id, del_flag, create_time
72
+  </sql>
73
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouseExample" >
74
+    select
75
+    <if test="distinct" >
76
+      distinct
77
+    </if>
78
+    <include refid="Base_Column_List" />
79
+    from business_agent_storehouse
80
+    <if test="_parameter != null" >
81
+      <include refid="Example_Where_Clause" />
82
+    </if>
83
+    <if test="orderByClause != null" >
84
+      order by ${orderByClause}
85
+    </if>
86
+  </select>
87
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
88
+    select 
89
+    <include refid="Base_Column_List" />
90
+    from business_agent_storehouse
91
+    where id = #{id,jdbcType=INTEGER}
92
+  </select>
93
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
94
+    delete from business_agent_storehouse
95
+    where id = #{id,jdbcType=INTEGER}
96
+  </delete>
97
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouseExample" >
98
+    delete from business_agent_storehouse
99
+    <if test="_parameter != null" >
100
+      <include refid="Example_Where_Clause" />
101
+    </if>
102
+  </delete>
103
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouse" >
104
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
105
+      select seq_business_agent_storehouse.nextVal from dual
106
+    </selectKey>
107
+    insert into business_agent_storehouse (id, storehouse_id, agent_depot_id, 
108
+      org_id, del_flag, create_time
109
+      )
110
+    values (#{id,jdbcType=INTEGER}, #{storehouseId,jdbcType=INTEGER}, #{agentDepotId,jdbcType=INTEGER},
111
+      #{orgId,jdbcType=INTEGER}, #{delFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
112
+      )
113
+  </insert>
114
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouse" >
115
+    insert into business_agent_storehouse
116
+    <trim prefix="(" suffix=")" suffixOverrides="," >
117
+      <if test="id != null" >
118
+        id,
119
+      </if>
120
+      <if test="storehouseId != null" >
121
+        storehouse_id,
122
+      </if>
123
+      <if test="agentDepotId != null" >
124
+        agent_depot_id,
125
+      </if>
126
+      <if test="orgId != null" >
127
+        org_id,
128
+      </if>
129
+      <if test="delFlag != null" >
130
+        del_flag,
131
+      </if>
132
+      <if test="createTime != null" >
133
+        create_time,
134
+      </if>
135
+    </trim>
136
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
137
+      <if test="id != null" >
138
+        #{id,jdbcType=INTEGER},
139
+      </if>
140
+      <if test="storehouseId != null" >
141
+        #{storehouseId,jdbcType=INTEGER},
142
+      </if>
143
+      <if test="agentDepotId != null" >
144
+        #{agentDepotId,jdbcType=INTEGER},
145
+      </if>
146
+      <if test="orgId != null" >
147
+        #{orgId,jdbcType=INTEGER},
148
+      </if>
149
+      <if test="delFlag != null" >
150
+        #{delFlag,jdbcType=INTEGER},
151
+      </if>
152
+      <if test="createTime != null" >
153
+        #{createTime,jdbcType=TIMESTAMP},
154
+      </if>
155
+    </trim>
156
+  </insert>
157
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouseExample" resultType="java.lang.Integer" >
158
+    select count(*) from business_agent_storehouse
159
+    <if test="_parameter != null" >
160
+      <include refid="Example_Where_Clause" />
161
+    </if>
162
+  </select>
163
+  <update id="updateByExampleSelective" parameterType="map" >
164
+    update business_agent_storehouse
165
+    <set >
166
+      <if test="record.id != null" >
167
+        id = #{record.id,jdbcType=INTEGER},
168
+      </if>
169
+      <if test="record.storehouseId != null" >
170
+        storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
171
+      </if>
172
+      <if test="record.agentDepotId != null" >
173
+        agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
174
+      </if>
175
+      <if test="record.orgId != null" >
176
+        org_id = #{record.orgId,jdbcType=INTEGER},
177
+      </if>
178
+      <if test="record.delFlag != null" >
179
+        del_flag = #{record.delFlag,jdbcType=INTEGER},
180
+      </if>
181
+      <if test="record.createTime != null" >
182
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
183
+      </if>
184
+    </set>
185
+    <if test="_parameter != null" >
186
+      <include refid="Update_By_Example_Where_Clause" />
187
+    </if>
188
+  </update>
189
+  <update id="updateByExample" parameterType="map" >
190
+    update business_agent_storehouse
191
+    set id = #{record.id,jdbcType=INTEGER},
192
+      storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
193
+      agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
194
+      org_id = #{record.orgId,jdbcType=INTEGER},
195
+      del_flag = #{record.delFlag,jdbcType=INTEGER},
196
+      create_time = #{record.createTime,jdbcType=TIMESTAMP}
197
+    <if test="_parameter != null" >
198
+      <include refid="Update_By_Example_Where_Clause" />
199
+    </if>
200
+  </update>
201
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouse" >
202
+    update business_agent_storehouse
203
+    <set >
204
+      <if test="storehouseId != null" >
205
+        storehouse_id = #{storehouseId,jdbcType=INTEGER},
206
+      </if>
207
+      <if test="agentDepotId != null" >
208
+        agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
209
+      </if>
210
+      <if test="orgId != null" >
211
+        org_id = #{orgId,jdbcType=INTEGER},
212
+      </if>
213
+      <if test="delFlag != null" >
214
+        del_flag = #{delFlag,jdbcType=INTEGER},
215
+      </if>
216
+      <if test="createTime != null" >
217
+        create_time = #{createTime,jdbcType=TIMESTAMP},
218
+      </if>
219
+    </set>
220
+    where id = #{id,jdbcType=INTEGER}
221
+  </update>
222
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouse" >
223
+    update business_agent_storehouse
224
+    set storehouse_id = #{storehouseId,jdbcType=INTEGER},
225
+      agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
226
+      org_id = #{orgId,jdbcType=INTEGER},
227
+      del_flag = #{delFlag,jdbcType=INTEGER},
228
+      create_time = #{createTime,jdbcType=TIMESTAMP}
229
+    where id = #{id,jdbcType=INTEGER}
230
+  </update>
231
+  <select id="getAgentStorehouse" resultType="java.util.Map" parameterType="java.util.Map">
232
+    SELECT
233
+		bs.storehouse_id,
234
+		bs.storehouse_name,
235
+		bs.storehouse_code
236
+	FROM
237
+		basic_storehouse bs
238
+	WHERE
239
+		bs.storehouse_id IN (
240
+			SELECT
241
+				storehouse_id
242
+			FROM
243
+				business_agent_storehouse
244
+			WHERE
245
+				org_id = #{orgId,jdbcType=INTEGER} AND
246
+			    agent_depot_id = #{agentDepotId,jdbcType=INTEGER} AND
247
+			    del_flag=1
248
+		)
249
+    and bs.del_flag = 1
250
+  </select>
251
+  <select id="getStorehouseList" resultType="java.util.Map" parameterType="java.util.Map">
252
+    SELECT
253
+      store.id,
254
+      bstore.storehouse_id,
255
+      bstore.storehouse_name,
256
+      CASE WHEN ISNULL(store.id) THEN FALSE ELSE TRUE END state_value,
257
+      CASE WHEN NOT ISNULL (store.id) THEN TRUE END state_lao
258
+    FROM
259
+      basic_storehouse bstore
260
+      LEFT JOIN business_agent_storehouse store ON store.storehouse_id = bstore.storehouse_id
261
+      AND store.del_flag = 1 AND store.org_id = #{orgId,jdbcType=INTEGER}
262
+      LEFT JOIN business_agent_depot depot ON depot.depot_id = bstore.org_id
263
+    WHERE bstore.del_flag = 1 AND depot.id = #{depotId,jdbcType=INTEGER}
264
+  </select>
265
+  <select id="getStoreList" resultType="java.util.Map" parameterType="java.util.Map">
266
+    SELECT
267
+    bstore.storehouse_id,
268
+    bstore.depot_name,
269
+    bstore.storehouse_code,
270
+    bstore.storehouse_name,
271
+    bstore.storehouse_type_mx,
272
+    bstore.architecture_type,
273
+    bstore.design_capacity,
274
+    bstore.actual_capacity,
275
+    bstore.dutystoreman,
276
+    bstore.storehouse_state,
277
+    bstore.del_flag,
278
+    bstore.usedate,
279
+    '0' view_state
280
+    FROM
281
+    basic_storehouse bstore
282
+    WHERE
283
+    bstore.library_type = 1 AND bstore.del_flag = 1
284
+    AND bstore.depot_id != bstore.org_id
285
+    AND bstore.org_id = #{orgId,jdbcType=VARCHAR}
286
+    <if test="agentDepotName != null">
287
+      AND bstore.depot_name LIKE #{agentDepotName,jdbcType=VARCHAR}
288
+    </if>
289
+    UNION ALL
290
+    SELECT
291
+    bstore.storehouse_id,
292
+    bstore.depot_name,
293
+    bstore.storehouse_code,
294
+    bstore.storehouse_name,
295
+    bstore.storehouse_type_mx,
296
+    bstore.architecture_type,
297
+    bstore.design_capacity,
298
+    bstore.actual_capacity,
299
+    bstore.dutystoreman,
300
+    bstore.storehouse_state,
301
+    bstore.del_flag,
302
+    bstore.usedate,
303
+    '1' view_state
304
+    FROM
305
+    business_agent_storehouse store
306
+    LEFT JOIN basic_storehouse bstore ON store.storehouse_id = bstore.storehouse_id
307
+    WHERE
308
+    bstore.del_flag = 1 AND store.del_flag = 1 AND store.org_id = #{orgId,jdbcType=VARCHAR}
309
+    <if test="agentDepotName != null">
310
+      AND bstore.depot_name LIKE #{agentDepotName,jdbcType=VARCHAR}
311
+    </if>
312
+  </select>
313
+  <select id="getAgentStoreInfo" resultType="java.util.Map" parameterType="java.util.Map">
314
+    SELECT
315
+      store.id,
316
+      bstore.storehouse_id,
317
+      bstore.storehouse_name
318
+    FROM
319
+      basic_storehouse bstore
320
+      INNER JOIN business_agent_storehouse store ON store.storehouse_id = bstore.storehouse_id AND store.org_id = #{orgId,jdbcType=INTEGER}
321
+    WHERE bstore.del_flag = 1 AND store.del_flag=1 AND store.agent_depot_id = #{depotId,jdbcType=INTEGER}
322
+  </select>
323
+  <select id="getStore" resultType="java.util.Map" parameterType="java.util.Map">
324
+    SELECT
325
+        id
326
+    FROM
327
+        business_agent_storehouse
328
+    WHERE
329
+        storehouse_id = #{storehouseId,jdbcType=VARCHAR}
330
+  </select>
331
+  
332
+  <select id="getAgentHouseId" resultType="java.lang.Integer" parameterType="java.lang.Integer">
333
+	SELECT
334
+		storehouse_id
335
+	FROM
336
+		business_agent_storehouse
337
+	WHERE
338
+		agent_depot_id in (select id from business_agent_depot where depot_id=#{orgId,jdbcType=INTEGER} and del_flag=1 )
339
+    and del_flag=1
340
+  </select>
341
+  <select id="getDepotToStoreList" resultType="java.util.Map" parameterType="java.util.Map">
342
+    SELECT
343
+        store.id,
344
+        bstore.storehouse_id,
345
+        bstore.storehouse_name
346
+    FROM
347
+        basic_storehouse bstore
348
+    INNER JOIN business_agent_storehouse store ON store.storehouse_id = bstore.storehouse_id
349
+    AND store.org_id = #{orgId,jdbcType=INTEGER}
350
+    WHERE
351
+        bstore.del_flag = 1
352
+    AND store.del_flag = 1
353
+    AND store.agent_depot_id = #{depotId,jdbcType=INTEGER}
354
+    UNION ALL
355
+    SELECT
356
+        bstore.storehouse_id id,
357
+        bstore.storehouse_id,
358
+        bstore.storehouse_name
359
+    FROM
360
+        basic_storehouse bstore
361
+    WHERE
362
+        bstore.del_flag = 1
363
+    AND bstore.library_type = 1
364
+    AND bstore.org_id = #{orgId,jdbcType=INTEGER}
365
+    AND bstore.depot_id = #{depotId,jdbcType=INTEGER}
366
+  </select>
367
+</mapper>

+ 30 - 0
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentTankMapper.java

@@ -0,0 +1,30 @@
1
+package com.chinaitop.depot.agent.basic.mapper;
2
+
3
+import com.chinaitop.depot.agent.basic.model.BusinessAgentTank;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentTankExample;
5
+import java.util.List;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+public interface BusinessAgentTankMapper {
9
+    int countByExample(BusinessAgentTankExample example);
10
+
11
+    int deleteByExample(BusinessAgentTankExample example);
12
+
13
+    int deleteByPrimaryKey(Integer id);
14
+
15
+    int insert(BusinessAgentTank record);
16
+
17
+    int insertSelective(BusinessAgentTank record);
18
+
19
+    List<BusinessAgentTank> selectByExample(BusinessAgentTankExample example);
20
+
21
+    BusinessAgentTank selectByPrimaryKey(Integer id);
22
+
23
+    int updateByExampleSelective(@Param("record") BusinessAgentTank record, @Param("example") BusinessAgentTankExample example);
24
+
25
+    int updateByExample(@Param("record") BusinessAgentTank record, @Param("example") BusinessAgentTankExample example);
26
+
27
+    int updateByPrimaryKeySelective(BusinessAgentTank record);
28
+
29
+    int updateByPrimaryKey(BusinessAgentTank record);
30
+}

+ 326 - 0
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentTankMapper.xml

@@ -0,0 +1,326 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.agent.basic.mapper.BusinessAgentTankMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.basic.model.BusinessAgentTank" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="depot_id" property="depotId" jdbcType="INTEGER" />
7
+    <result column="tank_number" property="tankNumber" jdbcType="VARCHAR" />
8
+    <result column="design_storage" property="designStorage" jdbcType="VARCHAR" />
9
+    <result column="design_year" property="designYear" jdbcType="VARCHAR" />
10
+    <result column="treasury_bonds" property="treasuryBonds" jdbcType="VARCHAR" />
11
+    <result column="enable_date" property="enableDate" jdbcType="VARCHAR" />
12
+    <result column="state" property="state" jdbcType="VARCHAR" />
13
+    <result column="keeper" property="keeper" jdbcType="VARCHAR" />
14
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
15
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
16
+    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
17
+  </resultMap>
18
+  <sql id="Example_Where_Clause" >
19
+    <where >
20
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
21
+        <if test="criteria.valid" >
22
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
23
+            <foreach collection="criteria.criteria" item="criterion" >
24
+              <choose >
25
+                <when test="criterion.noValue" >
26
+                  and ${criterion.condition}
27
+                </when>
28
+                <when test="criterion.singleValue" >
29
+                  and ${criterion.condition} #{criterion.value}
30
+                </when>
31
+                <when test="criterion.betweenValue" >
32
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
33
+                </when>
34
+                <when test="criterion.listValue" >
35
+                  and ${criterion.condition}
36
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
37
+                    #{listItem}
38
+                  </foreach>
39
+                </when>
40
+              </choose>
41
+            </foreach>
42
+          </trim>
43
+        </if>
44
+      </foreach>
45
+    </where>
46
+  </sql>
47
+  <sql id="Update_By_Example_Where_Clause" >
48
+    <where >
49
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
50
+        <if test="criteria.valid" >
51
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
52
+            <foreach collection="criteria.criteria" item="criterion" >
53
+              <choose >
54
+                <when test="criterion.noValue" >
55
+                  and ${criterion.condition}
56
+                </when>
57
+                <when test="criterion.singleValue" >
58
+                  and ${criterion.condition} #{criterion.value}
59
+                </when>
60
+                <when test="criterion.betweenValue" >
61
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
62
+                </when>
63
+                <when test="criterion.listValue" >
64
+                  and ${criterion.condition}
65
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
66
+                    #{listItem}
67
+                  </foreach>
68
+                </when>
69
+              </choose>
70
+            </foreach>
71
+          </trim>
72
+        </if>
73
+      </foreach>
74
+    </where>
75
+  </sql>
76
+  <sql id="Base_Column_List" >
77
+    id, depot_id, tank_number, design_storage, design_year, treasury_bonds, enable_date, 
78
+    state, keeper, org_id, create_time, updatetime
79
+  </sql>
80
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentTankExample" >
81
+    select
82
+    <if test="distinct" >
83
+      distinct
84
+    </if>
85
+    <include refid="Base_Column_List" />
86
+    from business_agent_tank
87
+    <if test="_parameter != null" >
88
+      <include refid="Example_Where_Clause" />
89
+    </if>
90
+    <if test="orderByClause != null" >
91
+      order by ${orderByClause}
92
+    </if>
93
+  </select>
94
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
95
+    select 
96
+    <include refid="Base_Column_List" />
97
+    from business_agent_tank
98
+    where id = #{id,jdbcType=INTEGER}
99
+  </select>
100
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
101
+    delete from business_agent_tank
102
+    where id = #{id,jdbcType=INTEGER}
103
+  </delete>
104
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentTankExample" >
105
+    delete from business_agent_tank
106
+    <if test="_parameter != null" >
107
+      <include refid="Example_Where_Clause" />
108
+    </if>
109
+  </delete>
110
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentTank" >
111
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
112
+      select seq_business_agent_tank.nextVal from dual
113
+    </selectKey>
114
+    insert into business_agent_tank (id, depot_id, tank_number, 
115
+      design_storage, design_year, treasury_bonds, 
116
+      enable_date, state, keeper, 
117
+      org_id, create_time, updatetime
118
+      )
119
+    values (#{id,jdbcType=INTEGER}, #{depotId,jdbcType=INTEGER}, #{tankNumber,jdbcType=VARCHAR},
120
+      #{designStorage,jdbcType=VARCHAR}, #{designYear,jdbcType=VARCHAR}, #{treasuryBonds,jdbcType=VARCHAR}, 
121
+      #{enableDate,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR}, #{keeper,jdbcType=VARCHAR}, 
122
+      #{orgId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}
123
+      )
124
+  </insert>
125
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentTank" >
126
+    insert into business_agent_tank
127
+    <trim prefix="(" suffix=")" suffixOverrides="," >
128
+      <if test="id != null" >
129
+        id,
130
+      </if>
131
+      <if test="depotId != null" >
132
+        depot_id,
133
+      </if>
134
+      <if test="tankNumber != null" >
135
+        tank_number,
136
+      </if>
137
+      <if test="designStorage != null" >
138
+        design_storage,
139
+      </if>
140
+      <if test="designYear != null" >
141
+        design_year,
142
+      </if>
143
+      <if test="treasuryBonds != null" >
144
+        treasury_bonds,
145
+      </if>
146
+      <if test="enableDate != null" >
147
+        enable_date,
148
+      </if>
149
+      <if test="state != null" >
150
+        state,
151
+      </if>
152
+      <if test="keeper != null" >
153
+        keeper,
154
+      </if>
155
+      <if test="orgId != null" >
156
+        org_id,
157
+      </if>
158
+      <if test="createTime != null" >
159
+        create_time,
160
+      </if>
161
+      <if test="updatetime != null" >
162
+        updatetime,
163
+      </if>
164
+    </trim>
165
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
166
+      <if test="id != null" >
167
+        #{id,jdbcType=INTEGER},
168
+      </if>
169
+      <if test="depotId != null" >
170
+        #{depotId,jdbcType=INTEGER},
171
+      </if>
172
+      <if test="tankNumber != null" >
173
+        #{tankNumber,jdbcType=VARCHAR},
174
+      </if>
175
+      <if test="designStorage != null" >
176
+        #{designStorage,jdbcType=VARCHAR},
177
+      </if>
178
+      <if test="designYear != null" >
179
+        #{designYear,jdbcType=VARCHAR},
180
+      </if>
181
+      <if test="treasuryBonds != null" >
182
+        #{treasuryBonds,jdbcType=VARCHAR},
183
+      </if>
184
+      <if test="enableDate != null" >
185
+        #{enableDate,jdbcType=VARCHAR},
186
+      </if>
187
+      <if test="state != null" >
188
+        #{state,jdbcType=VARCHAR},
189
+      </if>
190
+      <if test="keeper != null" >
191
+        #{keeper,jdbcType=VARCHAR},
192
+      </if>
193
+      <if test="orgId != null" >
194
+        #{orgId,jdbcType=INTEGER},
195
+      </if>
196
+      <if test="createTime != null" >
197
+        #{createTime,jdbcType=TIMESTAMP},
198
+      </if>
199
+      <if test="updatetime != null" >
200
+        #{updatetime,jdbcType=TIMESTAMP},
201
+      </if>
202
+    </trim>
203
+  </insert>
204
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentTankExample" resultType="java.lang.Integer" >
205
+    select count(*) from business_agent_tank
206
+    <if test="_parameter != null" >
207
+      <include refid="Example_Where_Clause" />
208
+    </if>
209
+  </select>
210
+  <update id="updateByExampleSelective" parameterType="map" >
211
+    update business_agent_tank
212
+    <set >
213
+      <if test="record.id != null" >
214
+        id = #{record.id,jdbcType=INTEGER},
215
+      </if>
216
+      <if test="record.depotId != null" >
217
+        depot_id = #{record.depotId,jdbcType=INTEGER},
218
+      </if>
219
+      <if test="record.tankNumber != null" >
220
+        tank_number = #{record.tankNumber,jdbcType=VARCHAR},
221
+      </if>
222
+      <if test="record.designStorage != null" >
223
+        design_storage = #{record.designStorage,jdbcType=VARCHAR},
224
+      </if>
225
+      <if test="record.designYear != null" >
226
+        design_year = #{record.designYear,jdbcType=VARCHAR},
227
+      </if>
228
+      <if test="record.treasuryBonds != null" >
229
+        treasury_bonds = #{record.treasuryBonds,jdbcType=VARCHAR},
230
+      </if>
231
+      <if test="record.enableDate != null" >
232
+        enable_date = #{record.enableDate,jdbcType=VARCHAR},
233
+      </if>
234
+      <if test="record.state != null" >
235
+        state = #{record.state,jdbcType=VARCHAR},
236
+      </if>
237
+      <if test="record.keeper != null" >
238
+        keeper = #{record.keeper,jdbcType=VARCHAR},
239
+      </if>
240
+      <if test="record.orgId != null" >
241
+        org_id = #{record.orgId,jdbcType=INTEGER},
242
+      </if>
243
+      <if test="record.createTime != null" >
244
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
245
+      </if>
246
+      <if test="record.updatetime != null" >
247
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
248
+      </if>
249
+    </set>
250
+    <if test="_parameter != null" >
251
+      <include refid="Update_By_Example_Where_Clause" />
252
+    </if>
253
+  </update>
254
+  <update id="updateByExample" parameterType="map" >
255
+    update business_agent_tank
256
+    set id = #{record.id,jdbcType=INTEGER},
257
+      depot_id = #{record.depotId,jdbcType=INTEGER},
258
+      tank_number = #{record.tankNumber,jdbcType=VARCHAR},
259
+      design_storage = #{record.designStorage,jdbcType=VARCHAR},
260
+      design_year = #{record.designYear,jdbcType=VARCHAR},
261
+      treasury_bonds = #{record.treasuryBonds,jdbcType=VARCHAR},
262
+      enable_date = #{record.enableDate,jdbcType=VARCHAR},
263
+      state = #{record.state,jdbcType=VARCHAR},
264
+      keeper = #{record.keeper,jdbcType=VARCHAR},
265
+      org_id = #{record.orgId,jdbcType=INTEGER},
266
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
267
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
268
+    <if test="_parameter != null" >
269
+      <include refid="Update_By_Example_Where_Clause" />
270
+    </if>
271
+  </update>
272
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentTank" >
273
+    update business_agent_tank
274
+    <set >
275
+      <if test="depotId != null" >
276
+        depot_id = #{depotId,jdbcType=INTEGER},
277
+      </if>
278
+      <if test="tankNumber != null" >
279
+        tank_number = #{tankNumber,jdbcType=VARCHAR},
280
+      </if>
281
+      <if test="designStorage != null" >
282
+        design_storage = #{designStorage,jdbcType=VARCHAR},
283
+      </if>
284
+      <if test="designYear != null" >
285
+        design_year = #{designYear,jdbcType=VARCHAR},
286
+      </if>
287
+      <if test="treasuryBonds != null" >
288
+        treasury_bonds = #{treasuryBonds,jdbcType=VARCHAR},
289
+      </if>
290
+      <if test="enableDate != null" >
291
+        enable_date = #{enableDate,jdbcType=VARCHAR},
292
+      </if>
293
+      <if test="state != null" >
294
+        state = #{state,jdbcType=VARCHAR},
295
+      </if>
296
+      <if test="keeper != null" >
297
+        keeper = #{keeper,jdbcType=VARCHAR},
298
+      </if>
299
+      <if test="orgId != null" >
300
+        org_id = #{orgId,jdbcType=INTEGER},
301
+      </if>
302
+      <if test="createTime != null" >
303
+        create_time = #{createTime,jdbcType=TIMESTAMP},
304
+      </if>
305
+      <if test="updatetime != null" >
306
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
307
+      </if>
308
+    </set>
309
+    where id = #{id,jdbcType=INTEGER}
310
+  </update>
311
+  <update id="updateByPrimaryKey" useGeneratedKeys="true" keyProperty="id" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentTank" >
312
+    update business_agent_tank
313
+    set depot_id = #{depotId,jdbcType=INTEGER},
314
+      tank_number = #{tankNumber,jdbcType=VARCHAR},
315
+      design_storage = #{designStorage,jdbcType=VARCHAR},
316
+      design_year = #{designYear,jdbcType=VARCHAR},
317
+      treasury_bonds = #{treasuryBonds,jdbcType=VARCHAR},
318
+      enable_date = #{enableDate,jdbcType=VARCHAR},
319
+      state = #{state,jdbcType=VARCHAR},
320
+      keeper = #{keeper,jdbcType=VARCHAR},
321
+      org_id = #{orgId,jdbcType=INTEGER},
322
+      create_time = #{createTime,jdbcType=TIMESTAMP},
323
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
324
+    where id = #{id,jdbcType=INTEGER}
325
+  </update>
326
+</mapper>

+ 42 - 0
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentWarehouseMapper.java

@@ -0,0 +1,42 @@
1
+package com.chinaitop.depot.agent.basic.mapper;
2
+
3
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouseExample;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+public interface BusinessAgentWarehouseMapper {
11
+    int countByExample(BusinessAgentWarehouseExample example);
12
+
13
+    int deleteByExample(BusinessAgentWarehouseExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessAgentWarehouse record);
18
+
19
+    int insertSelective(BusinessAgentWarehouse record);
20
+
21
+    List<BusinessAgentWarehouse> selectByExample(BusinessAgentWarehouseExample example);
22
+
23
+    BusinessAgentWarehouse selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessAgentWarehouse record, @Param("example") BusinessAgentWarehouseExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessAgentWarehouse record, @Param("example") BusinessAgentWarehouseExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessAgentWarehouse record);
30
+
31
+    int updateByPrimaryKey(BusinessAgentWarehouse record);
32
+    
33
+    List<Map<String, Object>> getAgentStoreWare(Map<String, Object> map);
34
+
35
+    List<Map<String,Object>> getWareList(Map<String,Object> map);
36
+
37
+	List<Integer> getAgentwareHouseId(Integer orgId);
38
+
39
+    List<Map<String,Object>> getWare(Map<String,Object> map);
40
+
41
+    List<Map<String,Object>> getWarehouse(Map<String,Object> map);
42
+}

+ 413 - 0
src/main/java/com/chinaitop/depot/agent/basic/mapper/BusinessAgentWarehouseMapper.xml

@@ -0,0 +1,413 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.chinaitop.depot.agent.basic.mapper.BusinessAgentWarehouseMapper">
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse">
5
+    <id column="id" jdbcType="INTEGER" property="id" />
6
+    <result column="warehouse_id" jdbcType="INTEGER" property="warehouseId" />
7
+    <result column="agent_storehouse_id" jdbcType="INTEGER" property="agentStorehouseId" />
8
+    <result column="org_id" jdbcType="INTEGER" property="orgId" />
9
+    <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
10
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
11
+    <result column="bgmxz_tbsj" jdbcType="TIMESTAMP" property="bgmxzTbsj" />
12
+    <result column="qccrk_tbsj" jdbcType="TIMESTAMP" property="qccrkTbsj" />
13
+    <result column="hccrk_tbsj" jdbcType="TIMESTAMP" property="hccrkTbsj" />
14
+    <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
15
+  </resultMap>
16
+  <sql id="Example_Where_Clause">
17
+    <where>
18
+      <foreach collection="oredCriteria" item="criteria" separator="or">
19
+        <if test="criteria.valid">
20
+          <trim prefix="(" prefixOverrides="and" suffix=")">
21
+            <foreach collection="criteria.criteria" item="criterion">
22
+              <choose>
23
+                <when test="criterion.noValue">
24
+                  and ${criterion.condition}
25
+                </when>
26
+                <when test="criterion.singleValue">
27
+                  and ${criterion.condition} #{criterion.value}
28
+                </when>
29
+                <when test="criterion.betweenValue">
30
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
31
+                </when>
32
+                <when test="criterion.listValue">
33
+                  and ${criterion.condition}
34
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
35
+                    #{listItem}
36
+                  </foreach>
37
+                </when>
38
+              </choose>
39
+            </foreach>
40
+          </trim>
41
+        </if>
42
+      </foreach>
43
+    </where>
44
+  </sql>
45
+  <sql id="Update_By_Example_Where_Clause">
46
+    <where>
47
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
48
+        <if test="criteria.valid">
49
+          <trim prefix="(" prefixOverrides="and" suffix=")">
50
+            <foreach collection="criteria.criteria" item="criterion">
51
+              <choose>
52
+                <when test="criterion.noValue">
53
+                  and ${criterion.condition}
54
+                </when>
55
+                <when test="criterion.singleValue">
56
+                  and ${criterion.condition} #{criterion.value}
57
+                </when>
58
+                <when test="criterion.betweenValue">
59
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
60
+                </when>
61
+                <when test="criterion.listValue">
62
+                  and ${criterion.condition}
63
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
64
+                    #{listItem}
65
+                  </foreach>
66
+                </when>
67
+              </choose>
68
+            </foreach>
69
+          </trim>
70
+        </if>
71
+      </foreach>
72
+    </where>
73
+  </sql>
74
+  <sql id="Base_Column_List">
75
+    id, warehouse_id, agent_storehouse_id, org_id, del_flag, create_time, bgmxz_tbsj, 
76
+    qccrk_tbsj, hccrk_tbsj, updatetime
77
+  </sql>
78
+  <select id="selectByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouseExample" resultMap="BaseResultMap">
79
+    select
80
+    <if test="distinct">
81
+      distinct
82
+    </if>
83
+    <include refid="Base_Column_List" />
84
+    from business_agent_warehouse
85
+    <if test="_parameter != null">
86
+      <include refid="Example_Where_Clause" />
87
+    </if>
88
+    <if test="orderByClause != null">
89
+      order by ${orderByClause}
90
+    </if>
91
+  </select>
92
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
93
+    select 
94
+    <include refid="Base_Column_List" />
95
+    from business_agent_warehouse
96
+    where id = #{id,jdbcType=INTEGER}
97
+  </select>
98
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
99
+    delete from business_agent_warehouse
100
+    where id = #{id,jdbcType=INTEGER}
101
+  </delete>
102
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouseExample">
103
+    delete from business_agent_warehouse
104
+    <if test="_parameter != null">
105
+      <include refid="Example_Where_Clause" />
106
+    </if>
107
+  </delete>
108
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse">
109
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
110
+      select seq_business_agent_warehouse.nextVal from dual
111
+    </selectKey>
112
+    insert into business_agent_warehouse (id, warehouse_id, agent_storehouse_id, 
113
+      org_id, del_flag, create_time, 
114
+      bgmxz_tbsj, qccrk_tbsj, hccrk_tbsj, 
115
+      updatetime)
116
+    values (#{id,jdbcType=INTEGER}, #{warehouseId,jdbcType=INTEGER}, #{agentStorehouseId,jdbcType=INTEGER},
117
+      #{orgId,jdbcType=INTEGER}, #{delFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
118
+      #{bgmxzTbsj,jdbcType=TIMESTAMP}, #{qccrkTbsj,jdbcType=TIMESTAMP}, #{hccrkTbsj,jdbcType=TIMESTAMP}, 
119
+      #{updatetime,jdbcType=TIMESTAMP})
120
+  </insert>
121
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse">
122
+    insert into business_agent_warehouse
123
+    <trim prefix="(" suffix=")" suffixOverrides=",">
124
+      <if test="id != null">
125
+        id,
126
+      </if>
127
+      <if test="warehouseId != null">
128
+        warehouse_id,
129
+      </if>
130
+      <if test="agentStorehouseId != null">
131
+        agent_storehouse_id,
132
+      </if>
133
+      <if test="orgId != null">
134
+        org_id,
135
+      </if>
136
+      <if test="delFlag != null">
137
+        del_flag,
138
+      </if>
139
+      <if test="createTime != null">
140
+        create_time,
141
+      </if>
142
+      <if test="bgmxzTbsj != null">
143
+        bgmxz_tbsj,
144
+      </if>
145
+      <if test="qccrkTbsj != null">
146
+        qccrk_tbsj,
147
+      </if>
148
+      <if test="hccrkTbsj != null">
149
+        hccrk_tbsj,
150
+      </if>
151
+      <if test="updatetime != null">
152
+        updatetime,
153
+      </if>
154
+    </trim>
155
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
156
+      <if test="id != null">
157
+        #{id,jdbcType=INTEGER},
158
+      </if>
159
+      <if test="warehouseId != null">
160
+        #{warehouseId,jdbcType=INTEGER},
161
+      </if>
162
+      <if test="agentStorehouseId != null">
163
+        #{agentStorehouseId,jdbcType=INTEGER},
164
+      </if>
165
+      <if test="orgId != null">
166
+        #{orgId,jdbcType=INTEGER},
167
+      </if>
168
+      <if test="delFlag != null">
169
+        #{delFlag,jdbcType=INTEGER},
170
+      </if>
171
+      <if test="createTime != null">
172
+        #{createTime,jdbcType=TIMESTAMP},
173
+      </if>
174
+      <if test="bgmxzTbsj != null">
175
+        #{bgmxzTbsj,jdbcType=TIMESTAMP},
176
+      </if>
177
+      <if test="qccrkTbsj != null">
178
+        #{qccrkTbsj,jdbcType=TIMESTAMP},
179
+      </if>
180
+      <if test="hccrkTbsj != null">
181
+        #{hccrkTbsj,jdbcType=TIMESTAMP},
182
+      </if>
183
+      <if test="updatetime != null">
184
+        #{updatetime,jdbcType=TIMESTAMP},
185
+      </if>
186
+    </trim>
187
+  </insert>
188
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouseExample" resultType="java.lang.Integer">
189
+    select count(*) from business_agent_warehouse
190
+    <if test="_parameter != null">
191
+      <include refid="Example_Where_Clause" />
192
+    </if>
193
+  </select>
194
+  <update id="updateByExampleSelective" parameterType="map">
195
+    update business_agent_warehouse
196
+    <set>
197
+      <if test="record.id != null">
198
+        id = #{record.id,jdbcType=INTEGER},
199
+      </if>
200
+      <if test="record.warehouseId != null">
201
+        warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
202
+      </if>
203
+      <if test="record.agentStorehouseId != null">
204
+        agent_storehouse_id = #{record.agentStorehouseId,jdbcType=INTEGER},
205
+      </if>
206
+      <if test="record.orgId != null">
207
+        org_id = #{record.orgId,jdbcType=INTEGER},
208
+      </if>
209
+      <if test="record.delFlag != null">
210
+        del_flag = #{record.delFlag,jdbcType=INTEGER},
211
+      </if>
212
+      <if test="record.createTime != null">
213
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
214
+      </if>
215
+      <if test="record.bgmxzTbsj != null">
216
+        bgmxz_tbsj = #{record.bgmxzTbsj,jdbcType=TIMESTAMP},
217
+      </if>
218
+      <if test="record.qccrkTbsj != null">
219
+        qccrk_tbsj = #{record.qccrkTbsj,jdbcType=TIMESTAMP},
220
+      </if>
221
+      <if test="record.hccrkTbsj != null">
222
+        hccrk_tbsj = #{record.hccrkTbsj,jdbcType=TIMESTAMP},
223
+      </if>
224
+      <if test="record.updatetime != null">
225
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
226
+      </if>
227
+    </set>
228
+    <if test="_parameter != null">
229
+      <include refid="Update_By_Example_Where_Clause" />
230
+    </if>
231
+  </update>
232
+  <update id="updateByExample" parameterType="map">
233
+    update business_agent_warehouse
234
+    set id = #{record.id,jdbcType=INTEGER},
235
+      warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
236
+      agent_storehouse_id = #{record.agentStorehouseId,jdbcType=INTEGER},
237
+      org_id = #{record.orgId,jdbcType=INTEGER},
238
+      del_flag = #{record.delFlag,jdbcType=INTEGER},
239
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
240
+      bgmxz_tbsj = #{record.bgmxzTbsj,jdbcType=TIMESTAMP},
241
+      qccrk_tbsj = #{record.qccrkTbsj,jdbcType=TIMESTAMP},
242
+      hccrk_tbsj = #{record.hccrkTbsj,jdbcType=TIMESTAMP},
243
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
244
+    <if test="_parameter != null">
245
+      <include refid="Update_By_Example_Where_Clause" />
246
+    </if>
247
+  </update>
248
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse">
249
+    update business_agent_warehouse
250
+    <set>
251
+      <if test="warehouseId != null">
252
+        warehouse_id = #{warehouseId,jdbcType=INTEGER},
253
+      </if>
254
+      <if test="agentStorehouseId != null">
255
+        agent_storehouse_id = #{agentStorehouseId,jdbcType=INTEGER},
256
+      </if>
257
+      <if test="orgId != null">
258
+        org_id = #{orgId,jdbcType=INTEGER},
259
+      </if>
260
+      <if test="delFlag != null">
261
+        del_flag = #{delFlag,jdbcType=INTEGER},
262
+      </if>
263
+      <if test="createTime != null">
264
+        create_time = #{createTime,jdbcType=TIMESTAMP},
265
+      </if>
266
+      <if test="bgmxzTbsj != null">
267
+        bgmxz_tbsj = #{bgmxzTbsj,jdbcType=TIMESTAMP},
268
+      </if>
269
+      <if test="qccrkTbsj != null">
270
+        qccrk_tbsj = #{qccrkTbsj,jdbcType=TIMESTAMP},
271
+      </if>
272
+      <if test="hccrkTbsj != null">
273
+        hccrk_tbsj = #{hccrkTbsj,jdbcType=TIMESTAMP},
274
+      </if>
275
+      <if test="updatetime != null">
276
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
277
+      </if>
278
+    </set>
279
+    where id = #{id,jdbcType=INTEGER}
280
+  </update>
281
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse">
282
+    update business_agent_warehouse
283
+    set warehouse_id = #{warehouseId,jdbcType=INTEGER},
284
+      agent_storehouse_id = #{agentStorehouseId,jdbcType=INTEGER},
285
+      org_id = #{orgId,jdbcType=INTEGER},
286
+      del_flag = #{delFlag,jdbcType=INTEGER},
287
+      create_time = #{createTime,jdbcType=TIMESTAMP},
288
+      bgmxz_tbsj = #{bgmxzTbsj,jdbcType=TIMESTAMP},
289
+      qccrk_tbsj = #{qccrkTbsj,jdbcType=TIMESTAMP},
290
+      hccrk_tbsj = #{hccrkTbsj,jdbcType=TIMESTAMP},
291
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
292
+    where id = #{id,jdbcType=INTEGER}
293
+  </update>
294
+  <select id="getAgentStoreWare" parameterType="java.util.Map" resultType="java.util.Map">
295
+    SELECT
296
+		bw.warehouse_id,
297
+		bw.warehouse_name,
298
+		bw.warehouse_code
299
+	FROM
300
+		basic_warehouse bw
301
+	WHERE
302
+		bw.warehouse_id IN (
303
+			SELECT
304
+				warehouse_id
305
+			FROM
306
+				business_agent_warehouse
307
+			WHERE
308
+				org_id = #{orgId,jdbcType=INTEGER} AND
309
+			    agent_storehouse_id in (select id from business_agent_storehouse where storehouse_id = #{agentStorehouseId,jdbcType=INTEGER})
310
+			    AND del_flag=1
311
+		)
312
+    and bw.del_flag = 1
313
+  </select>
314
+  <select id="getWareList" parameterType="java.util.Map" resultType="java.util.Map">
315
+    SELECT
316
+    bware.warehouse_id id,
317
+    bware.storehouse_id,
318
+    bstore.storehouse_name,
319
+    bware.warehouse_id,
320
+    bware.warehouse_name,
321
+    bware.warehouse_status,
322
+    bware.del_flag,
323
+    bware.warehouse_capacity,
324
+    '0' view_state
325
+    FROM
326
+    basic_warehouse bware
327
+    LEFT JOIN basic_storehouse bstore ON bware.storehouse_id = bstore.storehouse_id
328
+    WHERE
329
+    bware.library_type = 1 AND bware.del_flag = 1
330
+    AND bware.depot_id != bware.org_id
331
+    AND bware.org_id = #{orgId,jdbcType=VARCHAR}
332
+    <if test="warehouseName != null">
333
+      AND bware.warehouse_name LIKE #{warehouseName,jdbcType=VARCHAR}
334
+    </if>
335
+    <if test="agentDepotName != null">
336
+      AND bware.storehouse_id = #{agentDepotName,jdbcType=VARCHAR}
337
+    </if>
338
+    UNION ALL
339
+    SELECT
340
+    ware.id,
341
+    bware.storehouse_id,
342
+    bstore.storehouse_name,
343
+    bware.warehouse_id,
344
+    bware.warehouse_name,
345
+    bware.warehouse_status,
346
+    bware.del_flag,
347
+    bware.warehouse_capacity,
348
+    '1' view_state
349
+    FROM
350
+    business_agent_warehouse ware
351
+    LEFT JOIN basic_warehouse bware ON ware.warehouse_id = bware.warehouse_id
352
+    LEFT JOIN basic_storehouse bstore ON bware.storehouse_id = bstore.storehouse_id
353
+    WHERE
354
+    bware.del_flag = 1 AND ware.del_flag = 1
355
+    AND ware.org_id = #{orgId,jdbcType=VARCHAR}
356
+    <if test="warehouseName != null">
357
+      AND bware.warehouse_name LIKE #{warehouseName,jdbcType=VARCHAR}
358
+    </if>
359
+    <if test="storehouseId != null">
360
+      AND bware.storehouse_id = #{storehouseId,jdbcType=VARCHAR}
361
+    </if>
362
+  </select>
363
+  <select id="getWare" parameterType="java.util.Map" resultType="java.util.Map">
364
+    SELECT
365
+        id,
366
+        del_flag
367
+    FROM
368
+        business_agent_warehouse
369
+    WHERE
370
+        warehouse_id = #{warehouseId,jdbcType=VARCHAR}
371
+  </select>
372
+
373
+  <select id="getAgentwareHouseId" parameterType="java.lang.Integer" resultType="java.lang.Integer">
374
+	SELECT
375
+		warehouse_id
376
+	FROM
377
+		business_agent_warehouse
378
+	WHERE
379
+		agent_storehouse_id IN (
380
+			SELECT
381
+				id
382
+			FROM
383
+				business_agent_storehouse
384
+			WHERE
385
+				agent_depot_id IN (
386
+					SELECT
387
+						id
388
+					FROM
389
+						business_agent_depot
390
+					WHERE
391
+						depot_id = #{orgId}
392
+					AND del_flag = 1
393
+				)
394
+			AND del_flag = 1
395
+		)
396
+	AND del_flag = 1
397
+  </select>
398
+  <select id="getWarehouse" parameterType="java.util.Map" resultType="java.util.Map">
399
+    SELECT
400
+        bware.warehouse_id,
401
+        bware.warehouse_name
402
+	FROM
403
+		basic_warehouse bware
404
+	WHERE bware.del_flag = 1
405
+    <if test="orgId != null">
406
+      AND bware.org_id = #{orgId,jdbcType=VARCHAR}
407
+    </if>
408
+    <if test="storehouseId != null">
409
+      AND bware.storehouse_id = #{storehouseId,jdbcType=VARCHAR}
410
+    </if>
411
+    ORDER BY warehouse_id ASC
412
+  </select>
413
+</mapper>

+ 165 - 0
src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgent.java

@@ -0,0 +1,165 @@
1
+package com.chinaitop.depot.agent.basic.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessAgent {
6
+    private Integer id;
7
+
8
+    private String agentName;
9
+
10
+    private String legalPerson;
11
+
12
+    private String creditCode;
13
+
14
+    private String agentNature;
15
+
16
+    private String agentType;
17
+
18
+    private String capacity;
19
+
20
+    private String person;
21
+
22
+    private String credit;
23
+
24
+    private String longitude;
25
+
26
+    private String latitude;
27
+
28
+    private String administrativeArea;
29
+
30
+    private Integer orgId;
31
+
32
+    private Integer delFlag;
33
+
34
+    private Date createTime;
35
+
36
+    private Date updatetime;
37
+
38
+    public Integer getId() {
39
+        return id;
40
+    }
41
+
42
+    public void setId(Integer id) {
43
+        this.id = id;
44
+    }
45
+
46
+    public String getAgentName() {
47
+        return agentName;
48
+    }
49
+
50
+    public void setAgentName(String agentName) {
51
+        this.agentName = agentName == null ? null : agentName.trim();
52
+    }
53
+
54
+    public String getLegalPerson() {
55
+        return legalPerson;
56
+    }
57
+
58
+    public void setLegalPerson(String legalPerson) {
59
+        this.legalPerson = legalPerson == null ? null : legalPerson.trim();
60
+    }
61
+
62
+    public String getCreditCode() {
63
+        return creditCode;
64
+    }
65
+
66
+    public void setCreditCode(String creditCode) {
67
+        this.creditCode = creditCode == null ? null : creditCode.trim();
68
+    }
69
+
70
+    public String getAgentNature() {
71
+        return agentNature;
72
+    }
73
+
74
+    public void setAgentNature(String agentNature) {
75
+        this.agentNature = agentNature == null ? null : agentNature.trim();
76
+    }
77
+
78
+    public String getAgentType() {
79
+        return agentType;
80
+    }
81
+
82
+    public void setAgentType(String agentType) {
83
+        this.agentType = agentType == null ? null : agentType.trim();
84
+    }
85
+
86
+    public String getCapacity() {
87
+        return capacity;
88
+    }
89
+
90
+    public void setCapacity(String capacity) {
91
+        this.capacity = capacity == null ? null : capacity.trim();
92
+    }
93
+
94
+    public String getPerson() {
95
+        return person;
96
+    }
97
+
98
+    public void setPerson(String person) {
99
+        this.person = person == null ? null : person.trim();
100
+    }
101
+
102
+    public String getCredit() {
103
+        return credit;
104
+    }
105
+
106
+    public void setCredit(String credit) {
107
+        this.credit = credit == null ? null : credit.trim();
108
+    }
109
+
110
+    public String getLongitude() {
111
+        return longitude;
112
+    }
113
+
114
+    public void setLongitude(String longitude) {
115
+        this.longitude = longitude == null ? null : longitude.trim();
116
+    }
117
+
118
+    public String getLatitude() {
119
+        return latitude;
120
+    }
121
+
122
+    public void setLatitude(String latitude) {
123
+        this.latitude = latitude == null ? null : latitude.trim();
124
+    }
125
+
126
+    public String getAdministrativeArea() {
127
+        return administrativeArea;
128
+    }
129
+
130
+    public void setAdministrativeArea(String administrativeArea) {
131
+        this.administrativeArea = administrativeArea == null ? null : administrativeArea.trim();
132
+    }
133
+
134
+    public Integer getOrgId() {
135
+        return orgId;
136
+    }
137
+
138
+    public void setOrgId(Integer orgId) {
139
+        this.orgId = orgId;
140
+    }
141
+
142
+    public Integer getDelFlag() {
143
+        return delFlag;
144
+    }
145
+
146
+    public void setDelFlag(Integer delFlag) {
147
+        this.delFlag = delFlag;
148
+    }
149
+
150
+    public Date getCreateTime() {
151
+        return createTime;
152
+    }
153
+
154
+    public void setCreateTime(Date createTime) {
155
+        this.createTime = createTime;
156
+    }
157
+
158
+    public Date getUpdatetime() {
159
+        return updatetime;
160
+    }
161
+
162
+    public void setUpdatetime(Date updatetime) {
163
+        this.updatetime = updatetime;
164
+    }
165
+}

+ 155 - 0
src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentDepot.java

@@ -0,0 +1,155 @@
1
+package com.chinaitop.depot.agent.basic.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessAgentDepot {
6
+    private Integer id;
7
+
8
+    private String agentId;
9
+
10
+    private Integer depotId;
11
+
12
+    private String agentDepotName;
13
+
14
+    private String depotType;
15
+
16
+    private String designStorage;
17
+
18
+    private String address;
19
+
20
+    private String phone;
21
+
22
+    private String longitude;
23
+
24
+    private String latitude;
25
+
26
+    private String administrativeArea;
27
+
28
+    private Integer orgId;
29
+
30
+    private Integer delFlag;
31
+
32
+    private Date createTime;
33
+
34
+    private Date updatetime;
35
+
36
+    public Integer getId() {
37
+        return id;
38
+    }
39
+
40
+    public void setId(Integer id) {
41
+        this.id = id;
42
+    }
43
+
44
+    public String getAgentId() {
45
+        return agentId;
46
+    }
47
+
48
+    public void setAgentId(String agentId) {
49
+        this.agentId = agentId == null ? null : agentId.trim();
50
+    }
51
+
52
+    public Integer getDepotId() {
53
+        return depotId;
54
+    }
55
+
56
+    public void setDepotId(Integer depotId) {
57
+        this.depotId = depotId;
58
+    }
59
+
60
+    public String getAgentDepotName() {
61
+        return agentDepotName;
62
+    }
63
+
64
+    public void setAgentDepotName(String agentDepotName) {
65
+        this.agentDepotName = agentDepotName == null ? null : agentDepotName.trim();
66
+    }
67
+
68
+    public String getDepotType() {
69
+        return depotType;
70
+    }
71
+
72
+    public void setDepotType(String depotType) {
73
+        this.depotType = depotType == null ? null : depotType.trim();
74
+    }
75
+
76
+    public String getDesignStorage() {
77
+        return designStorage;
78
+    }
79
+
80
+    public void setDesignStorage(String designStorage) {
81
+        this.designStorage = designStorage == null ? null : designStorage.trim();
82
+    }
83
+
84
+    public String getAddress() {
85
+        return address;
86
+    }
87
+
88
+    public void setAddress(String address) {
89
+        this.address = address == null ? null : address.trim();
90
+    }
91
+
92
+    public String getPhone() {
93
+        return phone;
94
+    }
95
+
96
+    public void setPhone(String phone) {
97
+        this.phone = phone == null ? null : phone.trim();
98
+    }
99
+
100
+    public String getLongitude() {
101
+        return longitude;
102
+    }
103
+
104
+    public void setLongitude(String longitude) {
105
+        this.longitude = longitude == null ? null : longitude.trim();
106
+    }
107
+
108
+    public String getLatitude() {
109
+        return latitude;
110
+    }
111
+
112
+    public void setLatitude(String latitude) {
113
+        this.latitude = latitude == null ? null : latitude.trim();
114
+    }
115
+
116
+    public String getAdministrativeArea() {
117
+        return administrativeArea;
118
+    }
119
+
120
+    public void setAdministrativeArea(String administrativeArea) {
121
+        this.administrativeArea = administrativeArea == null ? null : administrativeArea.trim();
122
+    }
123
+
124
+    public Integer getOrgId() {
125
+        return orgId;
126
+    }
127
+
128
+    public void setOrgId(Integer orgId) {
129
+        this.orgId = orgId;
130
+    }
131
+
132
+    public Integer getDelFlag() {
133
+        return delFlag;
134
+    }
135
+
136
+    public void setDelFlag(Integer delFlag) {
137
+        this.delFlag = delFlag;
138
+    }
139
+
140
+    public Date getCreateTime() {
141
+        return createTime;
142
+    }
143
+
144
+    public void setCreateTime(Date createTime) {
145
+        this.createTime = createTime;
146
+    }
147
+
148
+    public Date getUpdatetime() {
149
+        return updatetime;
150
+    }
151
+
152
+    public void setUpdatetime(Date updatetime) {
153
+        this.updatetime = updatetime;
154
+    }
155
+}

File diff suppressed because it is too large
+ 1191 - 0
src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentDepotExample.java


File diff suppressed because it is too large
+ 1271 - 0
src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentExample.java


+ 125 - 0
src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentPeople.java

@@ -0,0 +1,125 @@
1
+package com.chinaitop.depot.agent.basic.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessAgentPeople {
6
+    private Integer id;
7
+
8
+    private Integer depotId;
9
+
10
+    private String peopleName;
11
+
12
+    private String gender;
13
+
14
+    private String creditCode;
15
+
16
+    private String idNumber;
17
+
18
+    private String workExperience;
19
+
20
+    private String nativePlace;
21
+
22
+    private String homeAddress;
23
+
24
+    private Integer orgId;
25
+
26
+    private Date createTime;
27
+
28
+    private Date updatetime;
29
+
30
+    public Integer getId() {
31
+        return id;
32
+    }
33
+
34
+    public void setId(Integer id) {
35
+        this.id = id;
36
+    }
37
+
38
+    public Integer getDepotId() {
39
+        return depotId;
40
+    }
41
+
42
+    public void setDepotId(Integer depotId) {
43
+        this.depotId = depotId;
44
+    }
45
+
46
+    public String getPeopleName() {
47
+        return peopleName;
48
+    }
49
+
50
+    public void setPeopleName(String peopleName) {
51
+        this.peopleName = peopleName == null ? null : peopleName.trim();
52
+    }
53
+
54
+    public String getGender() {
55
+        return gender;
56
+    }
57
+
58
+    public void setGender(String gender) {
59
+        this.gender = gender == null ? null : gender.trim();
60
+    }
61
+
62
+    public String getCreditCode() {
63
+        return creditCode;
64
+    }
65
+
66
+    public void setCreditCode(String creditCode) {
67
+        this.creditCode = creditCode == null ? null : creditCode.trim();
68
+    }
69
+
70
+    public String getIdNumber() {
71
+        return idNumber;
72
+    }
73
+
74
+    public void setIdNumber(String idNumber) {
75
+        this.idNumber = idNumber == null ? null : idNumber.trim();
76
+    }
77
+
78
+    public String getWorkExperience() {
79
+        return workExperience;
80
+    }
81
+
82
+    public void setWorkExperience(String workExperience) {
83
+        this.workExperience = workExperience == null ? null : workExperience.trim();
84
+    }
85
+
86
+    public String getNativePlace() {
87
+        return nativePlace;
88
+    }
89
+
90
+    public void setNativePlace(String nativePlace) {
91
+        this.nativePlace = nativePlace == null ? null : nativePlace.trim();
92
+    }
93
+
94
+    public String getHomeAddress() {
95
+        return homeAddress;
96
+    }
97
+
98
+    public void setHomeAddress(String homeAddress) {
99
+        this.homeAddress = homeAddress == null ? null : homeAddress.trim();
100
+    }
101
+
102
+    public Integer getOrgId() {
103
+        return orgId;
104
+    }
105
+
106
+    public void setOrgId(Integer orgId) {
107
+        this.orgId = orgId;
108
+    }
109
+
110
+    public Date getCreateTime() {
111
+        return createTime;
112
+    }
113
+
114
+    public void setCreateTime(Date createTime) {
115
+        this.createTime = createTime;
116
+    }
117
+
118
+    public Date getUpdatetime() {
119
+        return updatetime;
120
+    }
121
+
122
+    public void setUpdatetime(Date updatetime) {
123
+        this.updatetime = updatetime;
124
+    }
125
+}

+ 991 - 0
src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentPeopleExample.java

@@ -0,0 +1,991 @@
1
+package com.chinaitop.depot.agent.basic.model;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.List;
6
+
7
+public class BusinessAgentPeopleExample {
8
+    protected String orderByClause;
9
+
10
+    protected boolean distinct;
11
+
12
+    protected List<Criteria> oredCriteria;
13
+
14
+    public BusinessAgentPeopleExample() {
15
+        oredCriteria = new ArrayList<Criteria>();
16
+    }
17
+
18
+    public void setOrderByClause(String orderByClause) {
19
+        this.orderByClause = orderByClause;
20
+    }
21
+
22
+    public String getOrderByClause() {
23
+        return orderByClause;
24
+    }
25
+
26
+    public void setDistinct(boolean distinct) {
27
+        this.distinct = distinct;
28
+    }
29
+
30
+    public boolean isDistinct() {
31
+        return distinct;
32
+    }
33
+
34
+    public List<Criteria> getOredCriteria() {
35
+        return oredCriteria;
36
+    }
37
+
38
+    public void or(Criteria criteria) {
39
+        oredCriteria.add(criteria);
40
+    }
41
+
42
+    public Criteria or() {
43
+        Criteria criteria = createCriteriaInternal();
44
+        oredCriteria.add(criteria);
45
+        return criteria;
46
+    }
47
+
48
+    public Criteria createCriteria() {
49
+        Criteria criteria = createCriteriaInternal();
50
+        if (oredCriteria.size() == 0) {
51
+            oredCriteria.add(criteria);
52
+        }
53
+        return criteria;
54
+    }
55
+
56
+    protected Criteria createCriteriaInternal() {
57
+        Criteria criteria = new Criteria();
58
+        return criteria;
59
+    }
60
+
61
+    public void clear() {
62
+        oredCriteria.clear();
63
+        orderByClause = null;
64
+        distinct = false;
65
+    }
66
+
67
+    protected abstract static class GeneratedCriteria {
68
+        protected List<Criterion> criteria;
69
+
70
+        protected GeneratedCriteria() {
71
+            super();
72
+            criteria = new ArrayList<Criterion>();
73
+        }
74
+
75
+        public boolean isValid() {
76
+            return criteria.size() > 0;
77
+        }
78
+
79
+        public List<Criterion> getAllCriteria() {
80
+            return criteria;
81
+        }
82
+
83
+        public List<Criterion> getCriteria() {
84
+            return criteria;
85
+        }
86
+
87
+        protected void addCriterion(String condition) {
88
+            if (condition == null) {
89
+                throw new RuntimeException("Value for condition cannot be null");
90
+            }
91
+            criteria.add(new Criterion(condition));
92
+        }
93
+
94
+        protected void addCriterion(String condition, Object value, String property) {
95
+            if (value == null) {
96
+                throw new RuntimeException("Value for " + property + " cannot be null");
97
+            }
98
+            criteria.add(new Criterion(condition, value));
99
+        }
100
+
101
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
102
+            if (value1 == null || value2 == null) {
103
+                throw new RuntimeException("Between values for " + property + " cannot be null");
104
+            }
105
+            criteria.add(new Criterion(condition, value1, value2));
106
+        }
107
+
108
+        public Criteria andIdIsNull() {
109
+            addCriterion("id is null");
110
+            return (Criteria) this;
111
+        }
112
+
113
+        public Criteria andIdIsNotNull() {
114
+            addCriterion("id is not null");
115
+            return (Criteria) this;
116
+        }
117
+
118
+        public Criteria andIdEqualTo(Integer value) {
119
+            addCriterion("id =", value, "id");
120
+            return (Criteria) this;
121
+        }
122
+
123
+        public Criteria andIdNotEqualTo(Integer value) {
124
+            addCriterion("id <>", value, "id");
125
+            return (Criteria) this;
126
+        }
127
+
128
+        public Criteria andIdGreaterThan(Integer value) {
129
+            addCriterion("id >", value, "id");
130
+            return (Criteria) this;
131
+        }
132
+
133
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
134
+            addCriterion("id >=", value, "id");
135
+            return (Criteria) this;
136
+        }
137
+
138
+        public Criteria andIdLessThan(Integer value) {
139
+            addCriterion("id <", value, "id");
140
+            return (Criteria) this;
141
+        }
142
+
143
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
144
+            addCriterion("id <=", value, "id");
145
+            return (Criteria) this;
146
+        }
147
+
148
+        public Criteria andIdIn(List<Integer> values) {
149
+            addCriterion("id in", values, "id");
150
+            return (Criteria) this;
151
+        }
152
+
153
+        public Criteria andIdNotIn(List<Integer> values) {
154
+            addCriterion("id not in", values, "id");
155
+            return (Criteria) this;
156
+        }
157
+
158
+        public Criteria andIdBetween(Integer value1, Integer value2) {
159
+            addCriterion("id between", value1, value2, "id");
160
+            return (Criteria) this;
161
+        }
162
+
163
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
164
+            addCriterion("id not between", value1, value2, "id");
165
+            return (Criteria) this;
166
+        }
167
+
168
+        public Criteria andDepotIdIsNull() {
169
+            addCriterion("depot_id is null");
170
+            return (Criteria) this;
171
+        }
172
+
173
+        public Criteria andDepotIdIsNotNull() {
174
+            addCriterion("depot_id is not null");
175
+            return (Criteria) this;
176
+        }
177
+
178
+        public Criteria andDepotIdEqualTo(Integer value) {
179
+            addCriterion("depot_id =", value, "depotId");
180
+            return (Criteria) this;
181
+        }
182
+
183
+        public Criteria andDepotIdNotEqualTo(Integer value) {
184
+            addCriterion("depot_id <>", value, "depotId");
185
+            return (Criteria) this;
186
+        }
187
+
188
+        public Criteria andDepotIdGreaterThan(Integer value) {
189
+            addCriterion("depot_id >", value, "depotId");
190
+            return (Criteria) this;
191
+        }
192
+
193
+        public Criteria andDepotIdGreaterThanOrEqualTo(Integer value) {
194
+            addCriterion("depot_id >=", value, "depotId");
195
+            return (Criteria) this;
196
+        }
197
+
198
+        public Criteria andDepotIdLessThan(Integer value) {
199
+            addCriterion("depot_id <", value, "depotId");
200
+            return (Criteria) this;
201
+        }
202
+
203
+        public Criteria andDepotIdLessThanOrEqualTo(Integer value) {
204
+            addCriterion("depot_id <=", value, "depotId");
205
+            return (Criteria) this;
206
+        }
207
+
208
+        public Criteria andDepotIdIn(List<Integer> values) {
209
+            addCriterion("depot_id in", values, "depotId");
210
+            return (Criteria) this;
211
+        }
212
+
213
+        public Criteria andDepotIdNotIn(List<Integer> values) {
214
+            addCriterion("depot_id not in", values, "depotId");
215
+            return (Criteria) this;
216
+        }
217
+
218
+        public Criteria andDepotIdBetween(Integer value1, Integer value2) {
219
+            addCriterion("depot_id between", value1, value2, "depotId");
220
+            return (Criteria) this;
221
+        }
222
+
223
+        public Criteria andDepotIdNotBetween(Integer value1, Integer value2) {
224
+            addCriterion("depot_id not between", value1, value2, "depotId");
225
+            return (Criteria) this;
226
+        }
227
+
228
+        public Criteria andPeopleNameIsNull() {
229
+            addCriterion("people_name is null");
230
+            return (Criteria) this;
231
+        }
232
+
233
+        public Criteria andPeopleNameIsNotNull() {
234
+            addCriterion("people_name is not null");
235
+            return (Criteria) this;
236
+        }
237
+
238
+        public Criteria andPeopleNameEqualTo(String value) {
239
+            addCriterion("people_name =", value, "peopleName");
240
+            return (Criteria) this;
241
+        }
242
+
243
+        public Criteria andPeopleNameNotEqualTo(String value) {
244
+            addCriterion("people_name <>", value, "peopleName");
245
+            return (Criteria) this;
246
+        }
247
+
248
+        public Criteria andPeopleNameGreaterThan(String value) {
249
+            addCriterion("people_name >", value, "peopleName");
250
+            return (Criteria) this;
251
+        }
252
+
253
+        public Criteria andPeopleNameGreaterThanOrEqualTo(String value) {
254
+            addCriterion("people_name >=", value, "peopleName");
255
+            return (Criteria) this;
256
+        }
257
+
258
+        public Criteria andPeopleNameLessThan(String value) {
259
+            addCriterion("people_name <", value, "peopleName");
260
+            return (Criteria) this;
261
+        }
262
+
263
+        public Criteria andPeopleNameLessThanOrEqualTo(String value) {
264
+            addCriterion("people_name <=", value, "peopleName");
265
+            return (Criteria) this;
266
+        }
267
+
268
+        public Criteria andPeopleNameLike(String value) {
269
+            addCriterion("people_name like", value, "peopleName");
270
+            return (Criteria) this;
271
+        }
272
+
273
+        public Criteria andPeopleNameNotLike(String value) {
274
+            addCriterion("people_name not like", value, "peopleName");
275
+            return (Criteria) this;
276
+        }
277
+
278
+        public Criteria andPeopleNameIn(List<String> values) {
279
+            addCriterion("people_name in", values, "peopleName");
280
+            return (Criteria) this;
281
+        }
282
+
283
+        public Criteria andPeopleNameNotIn(List<String> values) {
284
+            addCriterion("people_name not in", values, "peopleName");
285
+            return (Criteria) this;
286
+        }
287
+
288
+        public Criteria andPeopleNameBetween(String value1, String value2) {
289
+            addCriterion("people_name between", value1, value2, "peopleName");
290
+            return (Criteria) this;
291
+        }
292
+
293
+        public Criteria andPeopleNameNotBetween(String value1, String value2) {
294
+            addCriterion("people_name not between", value1, value2, "peopleName");
295
+            return (Criteria) this;
296
+        }
297
+
298
+        public Criteria andGenderIsNull() {
299
+            addCriterion("gender is null");
300
+            return (Criteria) this;
301
+        }
302
+
303
+        public Criteria andGenderIsNotNull() {
304
+            addCriterion("gender is not null");
305
+            return (Criteria) this;
306
+        }
307
+
308
+        public Criteria andGenderEqualTo(String value) {
309
+            addCriterion("gender =", value, "gender");
310
+            return (Criteria) this;
311
+        }
312
+
313
+        public Criteria andGenderNotEqualTo(String value) {
314
+            addCriterion("gender <>", value, "gender");
315
+            return (Criteria) this;
316
+        }
317
+
318
+        public Criteria andGenderGreaterThan(String value) {
319
+            addCriterion("gender >", value, "gender");
320
+            return (Criteria) this;
321
+        }
322
+
323
+        public Criteria andGenderGreaterThanOrEqualTo(String value) {
324
+            addCriterion("gender >=", value, "gender");
325
+            return (Criteria) this;
326
+        }
327
+
328
+        public Criteria andGenderLessThan(String value) {
329
+            addCriterion("gender <", value, "gender");
330
+            return (Criteria) this;
331
+        }
332
+
333
+        public Criteria andGenderLessThanOrEqualTo(String value) {
334
+            addCriterion("gender <=", value, "gender");
335
+            return (Criteria) this;
336
+        }
337
+
338
+        public Criteria andGenderLike(String value) {
339
+            addCriterion("gender like", value, "gender");
340
+            return (Criteria) this;
341
+        }
342
+
343
+        public Criteria andGenderNotLike(String value) {
344
+            addCriterion("gender not like", value, "gender");
345
+            return (Criteria) this;
346
+        }
347
+
348
+        public Criteria andGenderIn(List<String> values) {
349
+            addCriterion("gender in", values, "gender");
350
+            return (Criteria) this;
351
+        }
352
+
353
+        public Criteria andGenderNotIn(List<String> values) {
354
+            addCriterion("gender not in", values, "gender");
355
+            return (Criteria) this;
356
+        }
357
+
358
+        public Criteria andGenderBetween(String value1, String value2) {
359
+            addCriterion("gender between", value1, value2, "gender");
360
+            return (Criteria) this;
361
+        }
362
+
363
+        public Criteria andGenderNotBetween(String value1, String value2) {
364
+            addCriterion("gender not between", value1, value2, "gender");
365
+            return (Criteria) this;
366
+        }
367
+
368
+        public Criteria andCreditCodeIsNull() {
369
+            addCriterion("credit_code is null");
370
+            return (Criteria) this;
371
+        }
372
+
373
+        public Criteria andCreditCodeIsNotNull() {
374
+            addCriterion("credit_code is not null");
375
+            return (Criteria) this;
376
+        }
377
+
378
+        public Criteria andCreditCodeEqualTo(String value) {
379
+            addCriterion("credit_code =", value, "creditCode");
380
+            return (Criteria) this;
381
+        }
382
+
383
+        public Criteria andCreditCodeNotEqualTo(String value) {
384
+            addCriterion("credit_code <>", value, "creditCode");
385
+            return (Criteria) this;
386
+        }
387
+
388
+        public Criteria andCreditCodeGreaterThan(String value) {
389
+            addCriterion("credit_code >", value, "creditCode");
390
+            return (Criteria) this;
391
+        }
392
+
393
+        public Criteria andCreditCodeGreaterThanOrEqualTo(String value) {
394
+            addCriterion("credit_code >=", value, "creditCode");
395
+            return (Criteria) this;
396
+        }
397
+
398
+        public Criteria andCreditCodeLessThan(String value) {
399
+            addCriterion("credit_code <", value, "creditCode");
400
+            return (Criteria) this;
401
+        }
402
+
403
+        public Criteria andCreditCodeLessThanOrEqualTo(String value) {
404
+            addCriterion("credit_code <=", value, "creditCode");
405
+            return (Criteria) this;
406
+        }
407
+
408
+        public Criteria andCreditCodeLike(String value) {
409
+            addCriterion("credit_code like", value, "creditCode");
410
+            return (Criteria) this;
411
+        }
412
+
413
+        public Criteria andCreditCodeNotLike(String value) {
414
+            addCriterion("credit_code not like", value, "creditCode");
415
+            return (Criteria) this;
416
+        }
417
+
418
+        public Criteria andCreditCodeIn(List<String> values) {
419
+            addCriterion("credit_code in", values, "creditCode");
420
+            return (Criteria) this;
421
+        }
422
+
423
+        public Criteria andCreditCodeNotIn(List<String> values) {
424
+            addCriterion("credit_code not in", values, "creditCode");
425
+            return (Criteria) this;
426
+        }
427
+
428
+        public Criteria andCreditCodeBetween(String value1, String value2) {
429
+            addCriterion("credit_code between", value1, value2, "creditCode");
430
+            return (Criteria) this;
431
+        }
432
+
433
+        public Criteria andCreditCodeNotBetween(String value1, String value2) {
434
+            addCriterion("credit_code not between", value1, value2, "creditCode");
435
+            return (Criteria) this;
436
+        }
437
+
438
+        public Criteria andIdNumberIsNull() {
439
+            addCriterion("id_number is null");
440
+            return (Criteria) this;
441
+        }
442
+
443
+        public Criteria andIdNumberIsNotNull() {
444
+            addCriterion("id_number is not null");
445
+            return (Criteria) this;
446
+        }
447
+
448
+        public Criteria andIdNumberEqualTo(String value) {
449
+            addCriterion("id_number =", value, "idNumber");
450
+            return (Criteria) this;
451
+        }
452
+
453
+        public Criteria andIdNumberNotEqualTo(String value) {
454
+            addCriterion("id_number <>", value, "idNumber");
455
+            return (Criteria) this;
456
+        }
457
+
458
+        public Criteria andIdNumberGreaterThan(String value) {
459
+            addCriterion("id_number >", value, "idNumber");
460
+            return (Criteria) this;
461
+        }
462
+
463
+        public Criteria andIdNumberGreaterThanOrEqualTo(String value) {
464
+            addCriterion("id_number >=", value, "idNumber");
465
+            return (Criteria) this;
466
+        }
467
+
468
+        public Criteria andIdNumberLessThan(String value) {
469
+            addCriterion("id_number <", value, "idNumber");
470
+            return (Criteria) this;
471
+        }
472
+
473
+        public Criteria andIdNumberLessThanOrEqualTo(String value) {
474
+            addCriterion("id_number <=", value, "idNumber");
475
+            return (Criteria) this;
476
+        }
477
+
478
+        public Criteria andIdNumberLike(String value) {
479
+            addCriterion("id_number like", value, "idNumber");
480
+            return (Criteria) this;
481
+        }
482
+
483
+        public Criteria andIdNumberNotLike(String value) {
484
+            addCriterion("id_number not like", value, "idNumber");
485
+            return (Criteria) this;
486
+        }
487
+
488
+        public Criteria andIdNumberIn(List<String> values) {
489
+            addCriterion("id_number in", values, "idNumber");
490
+            return (Criteria) this;
491
+        }
492
+
493
+        public Criteria andIdNumberNotIn(List<String> values) {
494
+            addCriterion("id_number not in", values, "idNumber");
495
+            return (Criteria) this;
496
+        }
497
+
498
+        public Criteria andIdNumberBetween(String value1, String value2) {
499
+            addCriterion("id_number between", value1, value2, "idNumber");
500
+            return (Criteria) this;
501
+        }
502
+
503
+        public Criteria andIdNumberNotBetween(String value1, String value2) {
504
+            addCriterion("id_number not between", value1, value2, "idNumber");
505
+            return (Criteria) this;
506
+        }
507
+
508
+        public Criteria andWorkExperienceIsNull() {
509
+            addCriterion("work_experience is null");
510
+            return (Criteria) this;
511
+        }
512
+
513
+        public Criteria andWorkExperienceIsNotNull() {
514
+            addCriterion("work_experience is not null");
515
+            return (Criteria) this;
516
+        }
517
+
518
+        public Criteria andWorkExperienceEqualTo(String value) {
519
+            addCriterion("work_experience =", value, "workExperience");
520
+            return (Criteria) this;
521
+        }
522
+
523
+        public Criteria andWorkExperienceNotEqualTo(String value) {
524
+            addCriterion("work_experience <>", value, "workExperience");
525
+            return (Criteria) this;
526
+        }
527
+
528
+        public Criteria andWorkExperienceGreaterThan(String value) {
529
+            addCriterion("work_experience >", value, "workExperience");
530
+            return (Criteria) this;
531
+        }
532
+
533
+        public Criteria andWorkExperienceGreaterThanOrEqualTo(String value) {
534
+            addCriterion("work_experience >=", value, "workExperience");
535
+            return (Criteria) this;
536
+        }
537
+
538
+        public Criteria andWorkExperienceLessThan(String value) {
539
+            addCriterion("work_experience <", value, "workExperience");
540
+            return (Criteria) this;
541
+        }
542
+
543
+        public Criteria andWorkExperienceLessThanOrEqualTo(String value) {
544
+            addCriterion("work_experience <=", value, "workExperience");
545
+            return (Criteria) this;
546
+        }
547
+
548
+        public Criteria andWorkExperienceLike(String value) {
549
+            addCriterion("work_experience like", value, "workExperience");
550
+            return (Criteria) this;
551
+        }
552
+
553
+        public Criteria andWorkExperienceNotLike(String value) {
554
+            addCriterion("work_experience not like", value, "workExperience");
555
+            return (Criteria) this;
556
+        }
557
+
558
+        public Criteria andWorkExperienceIn(List<String> values) {
559
+            addCriterion("work_experience in", values, "workExperience");
560
+            return (Criteria) this;
561
+        }
562
+
563
+        public Criteria andWorkExperienceNotIn(List<String> values) {
564
+            addCriterion("work_experience not in", values, "workExperience");
565
+            return (Criteria) this;
566
+        }
567
+
568
+        public Criteria andWorkExperienceBetween(String value1, String value2) {
569
+            addCriterion("work_experience between", value1, value2, "workExperience");
570
+            return (Criteria) this;
571
+        }
572
+
573
+        public Criteria andWorkExperienceNotBetween(String value1, String value2) {
574
+            addCriterion("work_experience not between", value1, value2, "workExperience");
575
+            return (Criteria) this;
576
+        }
577
+
578
+        public Criteria andNativePlaceIsNull() {
579
+            addCriterion("native_place is null");
580
+            return (Criteria) this;
581
+        }
582
+
583
+        public Criteria andNativePlaceIsNotNull() {
584
+            addCriterion("native_place is not null");
585
+            return (Criteria) this;
586
+        }
587
+
588
+        public Criteria andNativePlaceEqualTo(String value) {
589
+            addCriterion("native_place =", value, "nativePlace");
590
+            return (Criteria) this;
591
+        }
592
+
593
+        public Criteria andNativePlaceNotEqualTo(String value) {
594
+            addCriterion("native_place <>", value, "nativePlace");
595
+            return (Criteria) this;
596
+        }
597
+
598
+        public Criteria andNativePlaceGreaterThan(String value) {
599
+            addCriterion("native_place >", value, "nativePlace");
600
+            return (Criteria) this;
601
+        }
602
+
603
+        public Criteria andNativePlaceGreaterThanOrEqualTo(String value) {
604
+            addCriterion("native_place >=", value, "nativePlace");
605
+            return (Criteria) this;
606
+        }
607
+
608
+        public Criteria andNativePlaceLessThan(String value) {
609
+            addCriterion("native_place <", value, "nativePlace");
610
+            return (Criteria) this;
611
+        }
612
+
613
+        public Criteria andNativePlaceLessThanOrEqualTo(String value) {
614
+            addCriterion("native_place <=", value, "nativePlace");
615
+            return (Criteria) this;
616
+        }
617
+
618
+        public Criteria andNativePlaceLike(String value) {
619
+            addCriterion("native_place like", value, "nativePlace");
620
+            return (Criteria) this;
621
+        }
622
+
623
+        public Criteria andNativePlaceNotLike(String value) {
624
+            addCriterion("native_place not like", value, "nativePlace");
625
+            return (Criteria) this;
626
+        }
627
+
628
+        public Criteria andNativePlaceIn(List<String> values) {
629
+            addCriterion("native_place in", values, "nativePlace");
630
+            return (Criteria) this;
631
+        }
632
+
633
+        public Criteria andNativePlaceNotIn(List<String> values) {
634
+            addCriterion("native_place not in", values, "nativePlace");
635
+            return (Criteria) this;
636
+        }
637
+
638
+        public Criteria andNativePlaceBetween(String value1, String value2) {
639
+            addCriterion("native_place between", value1, value2, "nativePlace");
640
+            return (Criteria) this;
641
+        }
642
+
643
+        public Criteria andNativePlaceNotBetween(String value1, String value2) {
644
+            addCriterion("native_place not between", value1, value2, "nativePlace");
645
+            return (Criteria) this;
646
+        }
647
+
648
+        public Criteria andHomeAddressIsNull() {
649
+            addCriterion("home_address is null");
650
+            return (Criteria) this;
651
+        }
652
+
653
+        public Criteria andHomeAddressIsNotNull() {
654
+            addCriterion("home_address is not null");
655
+            return (Criteria) this;
656
+        }
657
+
658
+        public Criteria andHomeAddressEqualTo(String value) {
659
+            addCriterion("home_address =", value, "homeAddress");
660
+            return (Criteria) this;
661
+        }
662
+
663
+        public Criteria andHomeAddressNotEqualTo(String value) {
664
+            addCriterion("home_address <>", value, "homeAddress");
665
+            return (Criteria) this;
666
+        }
667
+
668
+        public Criteria andHomeAddressGreaterThan(String value) {
669
+            addCriterion("home_address >", value, "homeAddress");
670
+            return (Criteria) this;
671
+        }
672
+
673
+        public Criteria andHomeAddressGreaterThanOrEqualTo(String value) {
674
+            addCriterion("home_address >=", value, "homeAddress");
675
+            return (Criteria) this;
676
+        }
677
+
678
+        public Criteria andHomeAddressLessThan(String value) {
679
+            addCriterion("home_address <", value, "homeAddress");
680
+            return (Criteria) this;
681
+        }
682
+
683
+        public Criteria andHomeAddressLessThanOrEqualTo(String value) {
684
+            addCriterion("home_address <=", value, "homeAddress");
685
+            return (Criteria) this;
686
+        }
687
+
688
+        public Criteria andHomeAddressLike(String value) {
689
+            addCriterion("home_address like", value, "homeAddress");
690
+            return (Criteria) this;
691
+        }
692
+
693
+        public Criteria andHomeAddressNotLike(String value) {
694
+            addCriterion("home_address not like", value, "homeAddress");
695
+            return (Criteria) this;
696
+        }
697
+
698
+        public Criteria andHomeAddressIn(List<String> values) {
699
+            addCriterion("home_address in", values, "homeAddress");
700
+            return (Criteria) this;
701
+        }
702
+
703
+        public Criteria andHomeAddressNotIn(List<String> values) {
704
+            addCriterion("home_address not in", values, "homeAddress");
705
+            return (Criteria) this;
706
+        }
707
+
708
+        public Criteria andHomeAddressBetween(String value1, String value2) {
709
+            addCriterion("home_address between", value1, value2, "homeAddress");
710
+            return (Criteria) this;
711
+        }
712
+
713
+        public Criteria andHomeAddressNotBetween(String value1, String value2) {
714
+            addCriterion("home_address not between", value1, value2, "homeAddress");
715
+            return (Criteria) this;
716
+        }
717
+
718
+        public Criteria andOrgIdIsNull() {
719
+            addCriterion("org_id is null");
720
+            return (Criteria) this;
721
+        }
722
+
723
+        public Criteria andOrgIdIsNotNull() {
724
+            addCriterion("org_id is not null");
725
+            return (Criteria) this;
726
+        }
727
+
728
+        public Criteria andOrgIdEqualTo(Integer value) {
729
+            addCriterion("org_id =", value, "orgId");
730
+            return (Criteria) this;
731
+        }
732
+
733
+        public Criteria andOrgIdNotEqualTo(Integer value) {
734
+            addCriterion("org_id <>", value, "orgId");
735
+            return (Criteria) this;
736
+        }
737
+
738
+        public Criteria andOrgIdGreaterThan(Integer value) {
739
+            addCriterion("org_id >", value, "orgId");
740
+            return (Criteria) this;
741
+        }
742
+
743
+        public Criteria andOrgIdGreaterThanOrEqualTo(Integer value) {
744
+            addCriterion("org_id >=", value, "orgId");
745
+            return (Criteria) this;
746
+        }
747
+
748
+        public Criteria andOrgIdLessThan(Integer value) {
749
+            addCriterion("org_id <", value, "orgId");
750
+            return (Criteria) this;
751
+        }
752
+
753
+        public Criteria andOrgIdLessThanOrEqualTo(Integer value) {
754
+            addCriterion("org_id <=", value, "orgId");
755
+            return (Criteria) this;
756
+        }
757
+
758
+        public Criteria andOrgIdIn(List<Integer> values) {
759
+            addCriterion("org_id in", values, "orgId");
760
+            return (Criteria) this;
761
+        }
762
+
763
+        public Criteria andOrgIdNotIn(List<Integer> values) {
764
+            addCriterion("org_id not in", values, "orgId");
765
+            return (Criteria) this;
766
+        }
767
+
768
+        public Criteria andOrgIdBetween(Integer value1, Integer value2) {
769
+            addCriterion("org_id between", value1, value2, "orgId");
770
+            return (Criteria) this;
771
+        }
772
+
773
+        public Criteria andOrgIdNotBetween(Integer value1, Integer value2) {
774
+            addCriterion("org_id not between", value1, value2, "orgId");
775
+            return (Criteria) this;
776
+        }
777
+
778
+        public Criteria andCreateTimeIsNull() {
779
+            addCriterion("create_time is null");
780
+            return (Criteria) this;
781
+        }
782
+
783
+        public Criteria andCreateTimeIsNotNull() {
784
+            addCriterion("create_time is not null");
785
+            return (Criteria) this;
786
+        }
787
+
788
+        public Criteria andCreateTimeEqualTo(Date value) {
789
+            addCriterion("create_time =", value, "createTime");
790
+            return (Criteria) this;
791
+        }
792
+
793
+        public Criteria andCreateTimeNotEqualTo(Date value) {
794
+            addCriterion("create_time <>", value, "createTime");
795
+            return (Criteria) this;
796
+        }
797
+
798
+        public Criteria andCreateTimeGreaterThan(Date value) {
799
+            addCriterion("create_time >", value, "createTime");
800
+            return (Criteria) this;
801
+        }
802
+
803
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
804
+            addCriterion("create_time >=", value, "createTime");
805
+            return (Criteria) this;
806
+        }
807
+
808
+        public Criteria andCreateTimeLessThan(Date value) {
809
+            addCriterion("create_time <", value, "createTime");
810
+            return (Criteria) this;
811
+        }
812
+
813
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
814
+            addCriterion("create_time <=", value, "createTime");
815
+            return (Criteria) this;
816
+        }
817
+
818
+        public Criteria andCreateTimeIn(List<Date> values) {
819
+            addCriterion("create_time in", values, "createTime");
820
+            return (Criteria) this;
821
+        }
822
+
823
+        public Criteria andCreateTimeNotIn(List<Date> values) {
824
+            addCriterion("create_time not in", values, "createTime");
825
+            return (Criteria) this;
826
+        }
827
+
828
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
829
+            addCriterion("create_time between", value1, value2, "createTime");
830
+            return (Criteria) this;
831
+        }
832
+
833
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
834
+            addCriterion("create_time not between", value1, value2, "createTime");
835
+            return (Criteria) this;
836
+        }
837
+
838
+        public Criteria andUpdatetimeIsNull() {
839
+            addCriterion("updatetime is null");
840
+            return (Criteria) this;
841
+        }
842
+
843
+        public Criteria andUpdatetimeIsNotNull() {
844
+            addCriterion("updatetime is not null");
845
+            return (Criteria) this;
846
+        }
847
+
848
+        public Criteria andUpdatetimeEqualTo(Date value) {
849
+            addCriterion("updatetime =", value, "updatetime");
850
+            return (Criteria) this;
851
+        }
852
+
853
+        public Criteria andUpdatetimeNotEqualTo(Date value) {
854
+            addCriterion("updatetime <>", value, "updatetime");
855
+            return (Criteria) this;
856
+        }
857
+
858
+        public Criteria andUpdatetimeGreaterThan(Date value) {
859
+            addCriterion("updatetime >", value, "updatetime");
860
+            return (Criteria) this;
861
+        }
862
+
863
+        public Criteria andUpdatetimeGreaterThanOrEqualTo(Date value) {
864
+            addCriterion("updatetime >=", value, "updatetime");
865
+            return (Criteria) this;
866
+        }
867
+
868
+        public Criteria andUpdatetimeLessThan(Date value) {
869
+            addCriterion("updatetime <", value, "updatetime");
870
+            return (Criteria) this;
871
+        }
872
+
873
+        public Criteria andUpdatetimeLessThanOrEqualTo(Date value) {
874
+            addCriterion("updatetime <=", value, "updatetime");
875
+            return (Criteria) this;
876
+        }
877
+
878
+        public Criteria andUpdatetimeIn(List<Date> values) {
879
+            addCriterion("updatetime in", values, "updatetime");
880
+            return (Criteria) this;
881
+        }
882
+
883
+        public Criteria andUpdatetimeNotIn(List<Date> values) {
884
+            addCriterion("updatetime not in", values, "updatetime");
885
+            return (Criteria) this;
886
+        }
887
+
888
+        public Criteria andUpdatetimeBetween(Date value1, Date value2) {
889
+            addCriterion("updatetime between", value1, value2, "updatetime");
890
+            return (Criteria) this;
891
+        }
892
+
893
+        public Criteria andUpdatetimeNotBetween(Date value1, Date value2) {
894
+            addCriterion("updatetime not between", value1, value2, "updatetime");
895
+            return (Criteria) this;
896
+        }
897
+    }
898
+
899
+    public static class Criteria extends GeneratedCriteria {
900
+
901
+        protected Criteria() {
902
+            super();
903
+        }
904
+    }
905
+
906
+    public static class Criterion {
907
+        private String condition;
908
+
909
+        private Object value;
910
+
911
+        private Object secondValue;
912
+
913
+        private boolean noValue;
914
+
915
+        private boolean singleValue;
916
+
917
+        private boolean betweenValue;
918
+
919
+        private boolean listValue;
920
+
921
+        private String typeHandler;
922
+
923
+        public String getCondition() {
924
+            return condition;
925
+        }
926
+
927
+        public Object getValue() {
928
+            return value;
929
+        }
930
+
931
+        public Object getSecondValue() {
932
+            return secondValue;
933
+        }
934
+
935
+        public boolean isNoValue() {
936
+            return noValue;
937
+        }
938
+
939
+        public boolean isSingleValue() {
940
+            return singleValue;
941
+        }
942
+
943
+        public boolean isBetweenValue() {
944
+            return betweenValue;
945
+        }
946
+
947
+        public boolean isListValue() {
948
+            return listValue;
949
+        }
950
+
951
+        public String getTypeHandler() {
952
+            return typeHandler;
953
+        }
954
+
955
+        protected Criterion(String condition) {
956
+            super();
957
+            this.condition = condition;
958
+            this.typeHandler = null;
959
+            this.noValue = true;
960
+        }
961
+
962
+        protected Criterion(String condition, Object value, String typeHandler) {
963
+            super();
964
+            this.condition = condition;
965
+            this.value = value;
966
+            this.typeHandler = typeHandler;
967
+            if (value instanceof List<?>) {
968
+                this.listValue = true;
969
+            } else {
970
+                this.singleValue = true;
971
+            }
972
+        }
973
+
974
+        protected Criterion(String condition, Object value) {
975
+            this(condition, value, null);
976
+        }
977
+
978
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
979
+            super();
980
+            this.condition = condition;
981
+            this.value = value;
982
+            this.secondValue = secondValue;
983
+            this.typeHandler = typeHandler;
984
+            this.betweenValue = true;
985
+        }
986
+
987
+        protected Criterion(String condition, Object value, Object secondValue) {
988
+            this(condition, value, secondValue, null);
989
+        }
990
+    }
991
+}

+ 65 - 0
src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentStorehouse.java

@@ -0,0 +1,65 @@
1
+package com.chinaitop.depot.agent.basic.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessAgentStorehouse {
6
+    private Integer id;
7
+
8
+    private Integer storehouseId;
9
+
10
+    private Integer agentDepotId;
11
+
12
+    private Integer orgId;
13
+
14
+    private Integer delFlag;
15
+
16
+    private Date createTime;
17
+
18
+    public Integer getId() {
19
+        return id;
20
+    }
21
+
22
+    public void setId(Integer id) {
23
+        this.id = id;
24
+    }
25
+
26
+    public Integer getStorehouseId() {
27
+        return storehouseId;
28
+    }
29
+
30
+    public void setStorehouseId(Integer storehouseId) {
31
+        this.storehouseId = storehouseId;
32
+    }
33
+
34
+    public Integer getAgentDepotId() {
35
+        return agentDepotId;
36
+    }
37
+
38
+    public void setAgentDepotId(Integer agentDepotId) {
39
+        this.agentDepotId = agentDepotId;
40
+    }
41
+
42
+    public Integer getOrgId() {
43
+        return orgId;
44
+    }
45
+
46
+    public void setOrgId(Integer orgId) {
47
+        this.orgId = orgId;
48
+    }
49
+
50
+    public Integer getDelFlag() {
51
+        return delFlag;
52
+    }
53
+
54
+    public void setDelFlag(Integer delFlag) {
55
+        this.delFlag = delFlag;
56
+    }
57
+
58
+    public Date getCreateTime() {
59
+        return createTime;
60
+    }
61
+
62
+    public void setCreateTime(Date createTime) {
63
+        this.createTime = createTime;
64
+    }
65
+}

+ 561 - 0
src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentStorehouseExample.java

@@ -0,0 +1,561 @@
1
+package com.chinaitop.depot.agent.basic.model;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.List;
6
+
7
+public class BusinessAgentStorehouseExample {
8
+    protected String orderByClause;
9
+
10
+    protected boolean distinct;
11
+
12
+    protected List<Criteria> oredCriteria;
13
+
14
+    public BusinessAgentStorehouseExample() {
15
+        oredCriteria = new ArrayList<Criteria>();
16
+    }
17
+
18
+    public void setOrderByClause(String orderByClause) {
19
+        this.orderByClause = orderByClause;
20
+    }
21
+
22
+    public String getOrderByClause() {
23
+        return orderByClause;
24
+    }
25
+
26
+    public void setDistinct(boolean distinct) {
27
+        this.distinct = distinct;
28
+    }
29
+
30
+    public boolean isDistinct() {
31
+        return distinct;
32
+    }
33
+
34
+    public List<Criteria> getOredCriteria() {
35
+        return oredCriteria;
36
+    }
37
+
38
+    public void or(Criteria criteria) {
39
+        oredCriteria.add(criteria);
40
+    }
41
+
42
+    public Criteria or() {
43
+        Criteria criteria = createCriteriaInternal();
44
+        oredCriteria.add(criteria);
45
+        return criteria;
46
+    }
47
+
48
+    public Criteria createCriteria() {
49
+        Criteria criteria = createCriteriaInternal();
50
+        if (oredCriteria.size() == 0) {
51
+            oredCriteria.add(criteria);
52
+        }
53
+        return criteria;
54
+    }
55
+
56
+    protected Criteria createCriteriaInternal() {
57
+        Criteria criteria = new Criteria();
58
+        return criteria;
59
+    }
60
+
61
+    public void clear() {
62
+        oredCriteria.clear();
63
+        orderByClause = null;
64
+        distinct = false;
65
+    }
66
+
67
+    protected abstract static class GeneratedCriteria {
68
+        protected List<Criterion> criteria;
69
+
70
+        protected GeneratedCriteria() {
71
+            super();
72
+            criteria = new ArrayList<Criterion>();
73
+        }
74
+
75
+        public boolean isValid() {
76
+            return criteria.size() > 0;
77
+        }
78
+
79
+        public List<Criterion> getAllCriteria() {
80
+            return criteria;
81
+        }
82
+
83
+        public List<Criterion> getCriteria() {
84
+            return criteria;
85
+        }
86
+
87
+        protected void addCriterion(String condition) {
88
+            if (condition == null) {
89
+                throw new RuntimeException("Value for condition cannot be null");
90
+            }
91
+            criteria.add(new Criterion(condition));
92
+        }
93
+
94
+        protected void addCriterion(String condition, Object value, String property) {
95
+            if (value == null) {
96
+                throw new RuntimeException("Value for " + property + " cannot be null");
97
+            }
98
+            criteria.add(new Criterion(condition, value));
99
+        }
100
+
101
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
102
+            if (value1 == null || value2 == null) {
103
+                throw new RuntimeException("Between values for " + property + " cannot be null");
104
+            }
105
+            criteria.add(new Criterion(condition, value1, value2));
106
+        }
107
+
108
+        public Criteria andIdIsNull() {
109
+            addCriterion("id is null");
110
+            return (Criteria) this;
111
+        }
112
+
113
+        public Criteria andIdIsNotNull() {
114
+            addCriterion("id is not null");
115
+            return (Criteria) this;
116
+        }
117
+
118
+        public Criteria andIdEqualTo(Integer value) {
119
+            addCriterion("id =", value, "id");
120
+            return (Criteria) this;
121
+        }
122
+
123
+        public Criteria andIdNotEqualTo(Integer value) {
124
+            addCriterion("id <>", value, "id");
125
+            return (Criteria) this;
126
+        }
127
+
128
+        public Criteria andIdGreaterThan(Integer value) {
129
+            addCriterion("id >", value, "id");
130
+            return (Criteria) this;
131
+        }
132
+
133
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
134
+            addCriterion("id >=", value, "id");
135
+            return (Criteria) this;
136
+        }
137
+
138
+        public Criteria andIdLessThan(Integer value) {
139
+            addCriterion("id <", value, "id");
140
+            return (Criteria) this;
141
+        }
142
+
143
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
144
+            addCriterion("id <=", value, "id");
145
+            return (Criteria) this;
146
+        }
147
+
148
+        public Criteria andIdIn(List<Integer> values) {
149
+            addCriterion("id in", values, "id");
150
+            return (Criteria) this;
151
+        }
152
+
153
+        public Criteria andIdNotIn(List<Integer> values) {
154
+            addCriterion("id not in", values, "id");
155
+            return (Criteria) this;
156
+        }
157
+
158
+        public Criteria andIdBetween(Integer value1, Integer value2) {
159
+            addCriterion("id between", value1, value2, "id");
160
+            return (Criteria) this;
161
+        }
162
+
163
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
164
+            addCriterion("id not between", value1, value2, "id");
165
+            return (Criteria) this;
166
+        }
167
+
168
+        public Criteria andStorehouseIdIsNull() {
169
+            addCriterion("storehouse_id is null");
170
+            return (Criteria) this;
171
+        }
172
+
173
+        public Criteria andStorehouseIdIsNotNull() {
174
+            addCriterion("storehouse_id is not null");
175
+            return (Criteria) this;
176
+        }
177
+
178
+        public Criteria andStorehouseIdEqualTo(Integer value) {
179
+            addCriterion("storehouse_id =", value, "storehouseId");
180
+            return (Criteria) this;
181
+        }
182
+
183
+        public Criteria andStorehouseIdNotEqualTo(Integer value) {
184
+            addCriterion("storehouse_id <>", value, "storehouseId");
185
+            return (Criteria) this;
186
+        }
187
+
188
+        public Criteria andStorehouseIdGreaterThan(Integer value) {
189
+            addCriterion("storehouse_id >", value, "storehouseId");
190
+            return (Criteria) this;
191
+        }
192
+
193
+        public Criteria andStorehouseIdGreaterThanOrEqualTo(Integer value) {
194
+            addCriterion("storehouse_id >=", value, "storehouseId");
195
+            return (Criteria) this;
196
+        }
197
+
198
+        public Criteria andStorehouseIdLessThan(Integer value) {
199
+            addCriterion("storehouse_id <", value, "storehouseId");
200
+            return (Criteria) this;
201
+        }
202
+
203
+        public Criteria andStorehouseIdLessThanOrEqualTo(Integer value) {
204
+            addCriterion("storehouse_id <=", value, "storehouseId");
205
+            return (Criteria) this;
206
+        }
207
+
208
+        public Criteria andStorehouseIdIn(List<Integer> values) {
209
+            addCriterion("storehouse_id in", values, "storehouseId");
210
+            return (Criteria) this;
211
+        }
212
+
213
+        public Criteria andStorehouseIdNotIn(List<Integer> values) {
214
+            addCriterion("storehouse_id not in", values, "storehouseId");
215
+            return (Criteria) this;
216
+        }
217
+
218
+        public Criteria andStorehouseIdBetween(Integer value1, Integer value2) {
219
+            addCriterion("storehouse_id between", value1, value2, "storehouseId");
220
+            return (Criteria) this;
221
+        }
222
+
223
+        public Criteria andStorehouseIdNotBetween(Integer value1, Integer value2) {
224
+            addCriterion("storehouse_id not between", value1, value2, "storehouseId");
225
+            return (Criteria) this;
226
+        }
227
+
228
+        public Criteria andAgentDepotIdIsNull() {
229
+            addCriterion("agent_depot_id is null");
230
+            return (Criteria) this;
231
+        }
232
+
233
+        public Criteria andAgentDepotIdIsNotNull() {
234
+            addCriterion("agent_depot_id is not null");
235
+            return (Criteria) this;
236
+        }
237
+
238
+        public Criteria andAgentDepotIdEqualTo(Integer value) {
239
+            addCriterion("agent_depot_id =", value, "agentDepotId");
240
+            return (Criteria) this;
241
+        }
242
+
243
+        public Criteria andAgentDepotIdNotEqualTo(Integer value) {
244
+            addCriterion("agent_depot_id <>", value, "agentDepotId");
245
+            return (Criteria) this;
246
+        }
247
+
248
+        public Criteria andAgentDepotIdGreaterThan(Integer value) {
249
+            addCriterion("agent_depot_id >", value, "agentDepotId");
250
+            return (Criteria) this;
251
+        }
252
+
253
+        public Criteria andAgentDepotIdGreaterThanOrEqualTo(Integer value) {
254
+            addCriterion("agent_depot_id >=", value, "agentDepotId");
255
+            return (Criteria) this;
256
+        }
257
+
258
+        public Criteria andAgentDepotIdLessThan(Integer value) {
259
+            addCriterion("agent_depot_id <", value, "agentDepotId");
260
+            return (Criteria) this;
261
+        }
262
+
263
+        public Criteria andAgentDepotIdLessThanOrEqualTo(Integer value) {
264
+            addCriterion("agent_depot_id <=", value, "agentDepotId");
265
+            return (Criteria) this;
266
+        }
267
+
268
+        public Criteria andAgentDepotIdIn(List<Integer> values) {
269
+            addCriterion("agent_depot_id in", values, "agentDepotId");
270
+            return (Criteria) this;
271
+        }
272
+
273
+        public Criteria andAgentDepotIdNotIn(List<Integer> values) {
274
+            addCriterion("agent_depot_id not in", values, "agentDepotId");
275
+            return (Criteria) this;
276
+        }
277
+
278
+        public Criteria andAgentDepotIdBetween(Integer value1, Integer value2) {
279
+            addCriterion("agent_depot_id between", value1, value2, "agentDepotId");
280
+            return (Criteria) this;
281
+        }
282
+
283
+        public Criteria andAgentDepotIdNotBetween(Integer value1, Integer value2) {
284
+            addCriterion("agent_depot_id not between", value1, value2, "agentDepotId");
285
+            return (Criteria) this;
286
+        }
287
+
288
+        public Criteria andOrgIdIsNull() {
289
+            addCriterion("org_id is null");
290
+            return (Criteria) this;
291
+        }
292
+
293
+        public Criteria andOrgIdIsNotNull() {
294
+            addCriterion("org_id is not null");
295
+            return (Criteria) this;
296
+        }
297
+
298
+        public Criteria andOrgIdEqualTo(Integer value) {
299
+            addCriterion("org_id =", value, "orgId");
300
+            return (Criteria) this;
301
+        }
302
+
303
+        public Criteria andOrgIdNotEqualTo(Integer value) {
304
+            addCriterion("org_id <>", value, "orgId");
305
+            return (Criteria) this;
306
+        }
307
+
308
+        public Criteria andOrgIdGreaterThan(Integer value) {
309
+            addCriterion("org_id >", value, "orgId");
310
+            return (Criteria) this;
311
+        }
312
+
313
+        public Criteria andOrgIdGreaterThanOrEqualTo(Integer value) {
314
+            addCriterion("org_id >=", value, "orgId");
315
+            return (Criteria) this;
316
+        }
317
+
318
+        public Criteria andOrgIdLessThan(Integer value) {
319
+            addCriterion("org_id <", value, "orgId");
320
+            return (Criteria) this;
321
+        }
322
+
323
+        public Criteria andOrgIdLessThanOrEqualTo(Integer value) {
324
+            addCriterion("org_id <=", value, "orgId");
325
+            return (Criteria) this;
326
+        }
327
+
328
+        public Criteria andOrgIdIn(List<Integer> values) {
329
+            addCriterion("org_id in", values, "orgId");
330
+            return (Criteria) this;
331
+        }
332
+
333
+        public Criteria andOrgIdNotIn(List<Integer> values) {
334
+            addCriterion("org_id not in", values, "orgId");
335
+            return (Criteria) this;
336
+        }
337
+
338
+        public Criteria andOrgIdBetween(Integer value1, Integer value2) {
339
+            addCriterion("org_id between", value1, value2, "orgId");
340
+            return (Criteria) this;
341
+        }
342
+
343
+        public Criteria andOrgIdNotBetween(Integer value1, Integer value2) {
344
+            addCriterion("org_id not between", value1, value2, "orgId");
345
+            return (Criteria) this;
346
+        }
347
+
348
+        public Criteria andDelFlagIsNull() {
349
+            addCriterion("del_flag is null");
350
+            return (Criteria) this;
351
+        }
352
+
353
+        public Criteria andDelFlagIsNotNull() {
354
+            addCriterion("del_flag is not null");
355
+            return (Criteria) this;
356
+        }
357
+
358
+        public Criteria andDelFlagEqualTo(Integer value) {
359
+            addCriterion("del_flag =", value, "delFlag");
360
+            return (Criteria) this;
361
+        }
362
+
363
+        public Criteria andDelFlagNotEqualTo(Integer value) {
364
+            addCriterion("del_flag <>", value, "delFlag");
365
+            return (Criteria) this;
366
+        }
367
+
368
+        public Criteria andDelFlagGreaterThan(Integer value) {
369
+            addCriterion("del_flag >", value, "delFlag");
370
+            return (Criteria) this;
371
+        }
372
+
373
+        public Criteria andDelFlagGreaterThanOrEqualTo(Integer value) {
374
+            addCriterion("del_flag >=", value, "delFlag");
375
+            return (Criteria) this;
376
+        }
377
+
378
+        public Criteria andDelFlagLessThan(Integer value) {
379
+            addCriterion("del_flag <", value, "delFlag");
380
+            return (Criteria) this;
381
+        }
382
+
383
+        public Criteria andDelFlagLessThanOrEqualTo(Integer value) {
384
+            addCriterion("del_flag <=", value, "delFlag");
385
+            return (Criteria) this;
386
+        }
387
+
388
+        public Criteria andDelFlagIn(List<Integer> values) {
389
+            addCriterion("del_flag in", values, "delFlag");
390
+            return (Criteria) this;
391
+        }
392
+
393
+        public Criteria andDelFlagNotIn(List<Integer> values) {
394
+            addCriterion("del_flag not in", values, "delFlag");
395
+            return (Criteria) this;
396
+        }
397
+
398
+        public Criteria andDelFlagBetween(Integer value1, Integer value2) {
399
+            addCriterion("del_flag between", value1, value2, "delFlag");
400
+            return (Criteria) this;
401
+        }
402
+
403
+        public Criteria andDelFlagNotBetween(Integer value1, Integer value2) {
404
+            addCriterion("del_flag not between", value1, value2, "delFlag");
405
+            return (Criteria) this;
406
+        }
407
+
408
+        public Criteria andCreateTimeIsNull() {
409
+            addCriterion("create_time is null");
410
+            return (Criteria) this;
411
+        }
412
+
413
+        public Criteria andCreateTimeIsNotNull() {
414
+            addCriterion("create_time is not null");
415
+            return (Criteria) this;
416
+        }
417
+
418
+        public Criteria andCreateTimeEqualTo(Date value) {
419
+            addCriterion("create_time =", value, "createTime");
420
+            return (Criteria) this;
421
+        }
422
+
423
+        public Criteria andCreateTimeNotEqualTo(Date value) {
424
+            addCriterion("create_time <>", value, "createTime");
425
+            return (Criteria) this;
426
+        }
427
+
428
+        public Criteria andCreateTimeGreaterThan(Date value) {
429
+            addCriterion("create_time >", value, "createTime");
430
+            return (Criteria) this;
431
+        }
432
+
433
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
434
+            addCriterion("create_time >=", value, "createTime");
435
+            return (Criteria) this;
436
+        }
437
+
438
+        public Criteria andCreateTimeLessThan(Date value) {
439
+            addCriterion("create_time <", value, "createTime");
440
+            return (Criteria) this;
441
+        }
442
+
443
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
444
+            addCriterion("create_time <=", value, "createTime");
445
+            return (Criteria) this;
446
+        }
447
+
448
+        public Criteria andCreateTimeIn(List<Date> values) {
449
+            addCriterion("create_time in", values, "createTime");
450
+            return (Criteria) this;
451
+        }
452
+
453
+        public Criteria andCreateTimeNotIn(List<Date> values) {
454
+            addCriterion("create_time not in", values, "createTime");
455
+            return (Criteria) this;
456
+        }
457
+
458
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
459
+            addCriterion("create_time between", value1, value2, "createTime");
460
+            return (Criteria) this;
461
+        }
462
+
463
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
464
+            addCriterion("create_time not between", value1, value2, "createTime");
465
+            return (Criteria) this;
466
+        }
467
+    }
468
+
469
+    public static class Criteria extends GeneratedCriteria {
470
+
471
+        protected Criteria() {
472
+            super();
473
+        }
474
+    }
475
+
476
+    public static class Criterion {
477
+        private String condition;
478
+
479
+        private Object value;
480
+
481
+        private Object secondValue;
482
+
483
+        private boolean noValue;
484
+
485
+        private boolean singleValue;
486
+
487
+        private boolean betweenValue;
488
+
489
+        private boolean listValue;
490
+
491
+        private String typeHandler;
492
+
493
+        public String getCondition() {
494
+            return condition;
495
+        }
496
+
497
+        public Object getValue() {
498
+            return value;
499
+        }
500
+
501
+        public Object getSecondValue() {
502
+            return secondValue;
503
+        }
504
+
505
+        public boolean isNoValue() {
506
+            return noValue;
507
+        }
508
+
509
+        public boolean isSingleValue() {
510
+            return singleValue;
511
+        }
512
+
513
+        public boolean isBetweenValue() {
514
+            return betweenValue;
515
+        }
516
+
517
+        public boolean isListValue() {
518
+            return listValue;
519
+        }
520
+
521
+        public String getTypeHandler() {
522
+            return typeHandler;
523
+        }
524
+
525
+        protected Criterion(String condition) {
526
+            super();
527
+            this.condition = condition;
528
+            this.typeHandler = null;
529
+            this.noValue = true;
530
+        }
531
+
532
+        protected Criterion(String condition, Object value, String typeHandler) {
533
+            super();
534
+            this.condition = condition;
535
+            this.value = value;
536
+            this.typeHandler = typeHandler;
537
+            if (value instanceof List<?>) {
538
+                this.listValue = true;
539
+            } else {
540
+                this.singleValue = true;
541
+            }
542
+        }
543
+
544
+        protected Criterion(String condition, Object value) {
545
+            this(condition, value, null);
546
+        }
547
+
548
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
549
+            super();
550
+            this.condition = condition;
551
+            this.value = value;
552
+            this.secondValue = secondValue;
553
+            this.typeHandler = typeHandler;
554
+            this.betweenValue = true;
555
+        }
556
+
557
+        protected Criterion(String condition, Object value, Object secondValue) {
558
+            this(condition, value, secondValue, null);
559
+        }
560
+    }
561
+}

+ 125 - 0
src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentTank.java

@@ -0,0 +1,125 @@
1
+package com.chinaitop.depot.agent.basic.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessAgentTank {
6
+    private Integer id;
7
+
8
+    private Integer depotId;
9
+
10
+    private String tankNumber;
11
+
12
+    private String designStorage;
13
+
14
+    private String designYear;
15
+
16
+    private String treasuryBonds;
17
+
18
+    private String enableDate;
19
+
20
+    private String state;
21
+
22
+    private String keeper;
23
+
24
+    private Integer orgId;
25
+
26
+    private Date createTime;
27
+
28
+    private Date updatetime;
29
+
30
+    public Integer getId() {
31
+        return id;
32
+    }
33
+
34
+    public void setId(Integer id) {
35
+        this.id = id;
36
+    }
37
+
38
+    public Integer getDepotId() {
39
+        return depotId;
40
+    }
41
+
42
+    public void setDepotId(Integer depotId) {
43
+        this.depotId = depotId;
44
+    }
45
+
46
+    public String getTankNumber() {
47
+        return tankNumber;
48
+    }
49
+
50
+    public void setTankNumber(String tankNumber) {
51
+        this.tankNumber = tankNumber == null ? null : tankNumber.trim();
52
+    }
53
+
54
+    public String getDesignStorage() {
55
+        return designStorage;
56
+    }
57
+
58
+    public void setDesignStorage(String designStorage) {
59
+        this.designStorage = designStorage == null ? null : designStorage.trim();
60
+    }
61
+
62
+    public String getDesignYear() {
63
+        return designYear;
64
+    }
65
+
66
+    public void setDesignYear(String designYear) {
67
+        this.designYear = designYear == null ? null : designYear.trim();
68
+    }
69
+
70
+    public String getTreasuryBonds() {
71
+        return treasuryBonds;
72
+    }
73
+
74
+    public void setTreasuryBonds(String treasuryBonds) {
75
+        this.treasuryBonds = treasuryBonds == null ? null : treasuryBonds.trim();
76
+    }
77
+
78
+    public String getEnableDate() {
79
+        return enableDate;
80
+    }
81
+
82
+    public void setEnableDate(String enableDate) {
83
+        this.enableDate = enableDate == null ? null : enableDate.trim();
84
+    }
85
+
86
+    public String getState() {
87
+        return state;
88
+    }
89
+
90
+    public void setState(String state) {
91
+        this.state = state == null ? null : state.trim();
92
+    }
93
+
94
+    public String getKeeper() {
95
+        return keeper;
96
+    }
97
+
98
+    public void setKeeper(String keeper) {
99
+        this.keeper = keeper == null ? null : keeper.trim();
100
+    }
101
+
102
+    public Integer getOrgId() {
103
+        return orgId;
104
+    }
105
+
106
+    public void setOrgId(Integer orgId) {
107
+        this.orgId = orgId;
108
+    }
109
+
110
+    public Date getCreateTime() {
111
+        return createTime;
112
+    }
113
+
114
+    public void setCreateTime(Date createTime) {
115
+        this.createTime = createTime;
116
+    }
117
+
118
+    public Date getUpdatetime() {
119
+        return updatetime;
120
+    }
121
+
122
+    public void setUpdatetime(Date updatetime) {
123
+        this.updatetime = updatetime;
124
+    }
125
+}

+ 991 - 0
src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentTankExample.java

@@ -0,0 +1,991 @@
1
+package com.chinaitop.depot.agent.basic.model;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.List;
6
+
7
+public class BusinessAgentTankExample {
8
+    protected String orderByClause;
9
+
10
+    protected boolean distinct;
11
+
12
+    protected List<Criteria> oredCriteria;
13
+
14
+    public BusinessAgentTankExample() {
15
+        oredCriteria = new ArrayList<Criteria>();
16
+    }
17
+
18
+    public void setOrderByClause(String orderByClause) {
19
+        this.orderByClause = orderByClause;
20
+    }
21
+
22
+    public String getOrderByClause() {
23
+        return orderByClause;
24
+    }
25
+
26
+    public void setDistinct(boolean distinct) {
27
+        this.distinct = distinct;
28
+    }
29
+
30
+    public boolean isDistinct() {
31
+        return distinct;
32
+    }
33
+
34
+    public List<Criteria> getOredCriteria() {
35
+        return oredCriteria;
36
+    }
37
+
38
+    public void or(Criteria criteria) {
39
+        oredCriteria.add(criteria);
40
+    }
41
+
42
+    public Criteria or() {
43
+        Criteria criteria = createCriteriaInternal();
44
+        oredCriteria.add(criteria);
45
+        return criteria;
46
+    }
47
+
48
+    public Criteria createCriteria() {
49
+        Criteria criteria = createCriteriaInternal();
50
+        if (oredCriteria.size() == 0) {
51
+            oredCriteria.add(criteria);
52
+        }
53
+        return criteria;
54
+    }
55
+
56
+    protected Criteria createCriteriaInternal() {
57
+        Criteria criteria = new Criteria();
58
+        return criteria;
59
+    }
60
+
61
+    public void clear() {
62
+        oredCriteria.clear();
63
+        orderByClause = null;
64
+        distinct = false;
65
+    }
66
+
67
+    protected abstract static class GeneratedCriteria {
68
+        protected List<Criterion> criteria;
69
+
70
+        protected GeneratedCriteria() {
71
+            super();
72
+            criteria = new ArrayList<Criterion>();
73
+        }
74
+
75
+        public boolean isValid() {
76
+            return criteria.size() > 0;
77
+        }
78
+
79
+        public List<Criterion> getAllCriteria() {
80
+            return criteria;
81
+        }
82
+
83
+        public List<Criterion> getCriteria() {
84
+            return criteria;
85
+        }
86
+
87
+        protected void addCriterion(String condition) {
88
+            if (condition == null) {
89
+                throw new RuntimeException("Value for condition cannot be null");
90
+            }
91
+            criteria.add(new Criterion(condition));
92
+        }
93
+
94
+        protected void addCriterion(String condition, Object value, String property) {
95
+            if (value == null) {
96
+                throw new RuntimeException("Value for " + property + " cannot be null");
97
+            }
98
+            criteria.add(new Criterion(condition, value));
99
+        }
100
+
101
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
102
+            if (value1 == null || value2 == null) {
103
+                throw new RuntimeException("Between values for " + property + " cannot be null");
104
+            }
105
+            criteria.add(new Criterion(condition, value1, value2));
106
+        }
107
+
108
+        public Criteria andIdIsNull() {
109
+            addCriterion("id is null");
110
+            return (Criteria) this;
111
+        }
112
+
113
+        public Criteria andIdIsNotNull() {
114
+            addCriterion("id is not null");
115
+            return (Criteria) this;
116
+        }
117
+
118
+        public Criteria andIdEqualTo(Integer value) {
119
+            addCriterion("id =", value, "id");
120
+            return (Criteria) this;
121
+        }
122
+
123
+        public Criteria andIdNotEqualTo(Integer value) {
124
+            addCriterion("id <>", value, "id");
125
+            return (Criteria) this;
126
+        }
127
+
128
+        public Criteria andIdGreaterThan(Integer value) {
129
+            addCriterion("id >", value, "id");
130
+            return (Criteria) this;
131
+        }
132
+
133
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
134
+            addCriterion("id >=", value, "id");
135
+            return (Criteria) this;
136
+        }
137
+
138
+        public Criteria andIdLessThan(Integer value) {
139
+            addCriterion("id <", value, "id");
140
+            return (Criteria) this;
141
+        }
142
+
143
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
144
+            addCriterion("id <=", value, "id");
145
+            return (Criteria) this;
146
+        }
147
+
148
+        public Criteria andIdIn(List<Integer> values) {
149
+            addCriterion("id in", values, "id");
150
+            return (Criteria) this;
151
+        }
152
+
153
+        public Criteria andIdNotIn(List<Integer> values) {
154
+            addCriterion("id not in", values, "id");
155
+            return (Criteria) this;
156
+        }
157
+
158
+        public Criteria andIdBetween(Integer value1, Integer value2) {
159
+            addCriterion("id between", value1, value2, "id");
160
+            return (Criteria) this;
161
+        }
162
+
163
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
164
+            addCriterion("id not between", value1, value2, "id");
165
+            return (Criteria) this;
166
+        }
167
+
168
+        public Criteria andDepotIdIsNull() {
169
+            addCriterion("depot_id is null");
170
+            return (Criteria) this;
171
+        }
172
+
173
+        public Criteria andDepotIdIsNotNull() {
174
+            addCriterion("depot_id is not null");
175
+            return (Criteria) this;
176
+        }
177
+
178
+        public Criteria andDepotIdEqualTo(Integer value) {
179
+            addCriterion("depot_id =", value, "depotId");
180
+            return (Criteria) this;
181
+        }
182
+
183
+        public Criteria andDepotIdNotEqualTo(Integer value) {
184
+            addCriterion("depot_id <>", value, "depotId");
185
+            return (Criteria) this;
186
+        }
187
+
188
+        public Criteria andDepotIdGreaterThan(Integer value) {
189
+            addCriterion("depot_id >", value, "depotId");
190
+            return (Criteria) this;
191
+        }
192
+
193
+        public Criteria andDepotIdGreaterThanOrEqualTo(Integer value) {
194
+            addCriterion("depot_id >=", value, "depotId");
195
+            return (Criteria) this;
196
+        }
197
+
198
+        public Criteria andDepotIdLessThan(Integer value) {
199
+            addCriterion("depot_id <", value, "depotId");
200
+            return (Criteria) this;
201
+        }
202
+
203
+        public Criteria andDepotIdLessThanOrEqualTo(Integer value) {
204
+            addCriterion("depot_id <=", value, "depotId");
205
+            return (Criteria) this;
206
+        }
207
+
208
+        public Criteria andDepotIdIn(List<Integer> values) {
209
+            addCriterion("depot_id in", values, "depotId");
210
+            return (Criteria) this;
211
+        }
212
+
213
+        public Criteria andDepotIdNotIn(List<Integer> values) {
214
+            addCriterion("depot_id not in", values, "depotId");
215
+            return (Criteria) this;
216
+        }
217
+
218
+        public Criteria andDepotIdBetween(Integer value1, Integer value2) {
219
+            addCriterion("depot_id between", value1, value2, "depotId");
220
+            return (Criteria) this;
221
+        }
222
+
223
+        public Criteria andDepotIdNotBetween(Integer value1, Integer value2) {
224
+            addCriterion("depot_id not between", value1, value2, "depotId");
225
+            return (Criteria) this;
226
+        }
227
+
228
+        public Criteria andTankNumberIsNull() {
229
+            addCriterion("tank_number is null");
230
+            return (Criteria) this;
231
+        }
232
+
233
+        public Criteria andTankNumberIsNotNull() {
234
+            addCriterion("tank_number is not null");
235
+            return (Criteria) this;
236
+        }
237
+
238
+        public Criteria andTankNumberEqualTo(String value) {
239
+            addCriterion("tank_number =", value, "tankNumber");
240
+            return (Criteria) this;
241
+        }
242
+
243
+        public Criteria andTankNumberNotEqualTo(String value) {
244
+            addCriterion("tank_number <>", value, "tankNumber");
245
+            return (Criteria) this;
246
+        }
247
+
248
+        public Criteria andTankNumberGreaterThan(String value) {
249
+            addCriterion("tank_number >", value, "tankNumber");
250
+            return (Criteria) this;
251
+        }
252
+
253
+        public Criteria andTankNumberGreaterThanOrEqualTo(String value) {
254
+            addCriterion("tank_number >=", value, "tankNumber");
255
+            return (Criteria) this;
256
+        }
257
+
258
+        public Criteria andTankNumberLessThan(String value) {
259
+            addCriterion("tank_number <", value, "tankNumber");
260
+            return (Criteria) this;
261
+        }
262
+
263
+        public Criteria andTankNumberLessThanOrEqualTo(String value) {
264
+            addCriterion("tank_number <=", value, "tankNumber");
265
+            return (Criteria) this;
266
+        }
267
+
268
+        public Criteria andTankNumberLike(String value) {
269
+            addCriterion("tank_number like", value, "tankNumber");
270
+            return (Criteria) this;
271
+        }
272
+
273
+        public Criteria andTankNumberNotLike(String value) {
274
+            addCriterion("tank_number not like", value, "tankNumber");
275
+            return (Criteria) this;
276
+        }
277
+
278
+        public Criteria andTankNumberIn(List<String> values) {
279
+            addCriterion("tank_number in", values, "tankNumber");
280
+            return (Criteria) this;
281
+        }
282
+
283
+        public Criteria andTankNumberNotIn(List<String> values) {
284
+            addCriterion("tank_number not in", values, "tankNumber");
285
+            return (Criteria) this;
286
+        }
287
+
288
+        public Criteria andTankNumberBetween(String value1, String value2) {
289
+            addCriterion("tank_number between", value1, value2, "tankNumber");
290
+            return (Criteria) this;
291
+        }
292
+
293
+        public Criteria andTankNumberNotBetween(String value1, String value2) {
294
+            addCriterion("tank_number not between", value1, value2, "tankNumber");
295
+            return (Criteria) this;
296
+        }
297
+
298
+        public Criteria andDesignStorageIsNull() {
299
+            addCriterion("design_storage is null");
300
+            return (Criteria) this;
301
+        }
302
+
303
+        public Criteria andDesignStorageIsNotNull() {
304
+            addCriterion("design_storage is not null");
305
+            return (Criteria) this;
306
+        }
307
+
308
+        public Criteria andDesignStorageEqualTo(String value) {
309
+            addCriterion("design_storage =", value, "designStorage");
310
+            return (Criteria) this;
311
+        }
312
+
313
+        public Criteria andDesignStorageNotEqualTo(String value) {
314
+            addCriterion("design_storage <>", value, "designStorage");
315
+            return (Criteria) this;
316
+        }
317
+
318
+        public Criteria andDesignStorageGreaterThan(String value) {
319
+            addCriterion("design_storage >", value, "designStorage");
320
+            return (Criteria) this;
321
+        }
322
+
323
+        public Criteria andDesignStorageGreaterThanOrEqualTo(String value) {
324
+            addCriterion("design_storage >=", value, "designStorage");
325
+            return (Criteria) this;
326
+        }
327
+
328
+        public Criteria andDesignStorageLessThan(String value) {
329
+            addCriterion("design_storage <", value, "designStorage");
330
+            return (Criteria) this;
331
+        }
332
+
333
+        public Criteria andDesignStorageLessThanOrEqualTo(String value) {
334
+            addCriterion("design_storage <=", value, "designStorage");
335
+            return (Criteria) this;
336
+        }
337
+
338
+        public Criteria andDesignStorageLike(String value) {
339
+            addCriterion("design_storage like", value, "designStorage");
340
+            return (Criteria) this;
341
+        }
342
+
343
+        public Criteria andDesignStorageNotLike(String value) {
344
+            addCriterion("design_storage not like", value, "designStorage");
345
+            return (Criteria) this;
346
+        }
347
+
348
+        public Criteria andDesignStorageIn(List<String> values) {
349
+            addCriterion("design_storage in", values, "designStorage");
350
+            return (Criteria) this;
351
+        }
352
+
353
+        public Criteria andDesignStorageNotIn(List<String> values) {
354
+            addCriterion("design_storage not in", values, "designStorage");
355
+            return (Criteria) this;
356
+        }
357
+
358
+        public Criteria andDesignStorageBetween(String value1, String value2) {
359
+            addCriterion("design_storage between", value1, value2, "designStorage");
360
+            return (Criteria) this;
361
+        }
362
+
363
+        public Criteria andDesignStorageNotBetween(String value1, String value2) {
364
+            addCriterion("design_storage not between", value1, value2, "designStorage");
365
+            return (Criteria) this;
366
+        }
367
+
368
+        public Criteria andDesignYearIsNull() {
369
+            addCriterion("design_year is null");
370
+            return (Criteria) this;
371
+        }
372
+
373
+        public Criteria andDesignYearIsNotNull() {
374
+            addCriterion("design_year is not null");
375
+            return (Criteria) this;
376
+        }
377
+
378
+        public Criteria andDesignYearEqualTo(String value) {
379
+            addCriterion("design_year =", value, "designYear");
380
+            return (Criteria) this;
381
+        }
382
+
383
+        public Criteria andDesignYearNotEqualTo(String value) {
384
+            addCriterion("design_year <>", value, "designYear");
385
+            return (Criteria) this;
386
+        }
387
+
388
+        public Criteria andDesignYearGreaterThan(String value) {
389
+            addCriterion("design_year >", value, "designYear");
390
+            return (Criteria) this;
391
+        }
392
+
393
+        public Criteria andDesignYearGreaterThanOrEqualTo(String value) {
394
+            addCriterion("design_year >=", value, "designYear");
395
+            return (Criteria) this;
396
+        }
397
+
398
+        public Criteria andDesignYearLessThan(String value) {
399
+            addCriterion("design_year <", value, "designYear");
400
+            return (Criteria) this;
401
+        }
402
+
403
+        public Criteria andDesignYearLessThanOrEqualTo(String value) {
404
+            addCriterion("design_year <=", value, "designYear");
405
+            return (Criteria) this;
406
+        }
407
+
408
+        public Criteria andDesignYearLike(String value) {
409
+            addCriterion("design_year like", value, "designYear");
410
+            return (Criteria) this;
411
+        }
412
+
413
+        public Criteria andDesignYearNotLike(String value) {
414
+            addCriterion("design_year not like", value, "designYear");
415
+            return (Criteria) this;
416
+        }
417
+
418
+        public Criteria andDesignYearIn(List<String> values) {
419
+            addCriterion("design_year in", values, "designYear");
420
+            return (Criteria) this;
421
+        }
422
+
423
+        public Criteria andDesignYearNotIn(List<String> values) {
424
+            addCriterion("design_year not in", values, "designYear");
425
+            return (Criteria) this;
426
+        }
427
+
428
+        public Criteria andDesignYearBetween(String value1, String value2) {
429
+            addCriterion("design_year between", value1, value2, "designYear");
430
+            return (Criteria) this;
431
+        }
432
+
433
+        public Criteria andDesignYearNotBetween(String value1, String value2) {
434
+            addCriterion("design_year not between", value1, value2, "designYear");
435
+            return (Criteria) this;
436
+        }
437
+
438
+        public Criteria andTreasuryBondsIsNull() {
439
+            addCriterion("treasury_bonds is null");
440
+            return (Criteria) this;
441
+        }
442
+
443
+        public Criteria andTreasuryBondsIsNotNull() {
444
+            addCriterion("treasury_bonds is not null");
445
+            return (Criteria) this;
446
+        }
447
+
448
+        public Criteria andTreasuryBondsEqualTo(String value) {
449
+            addCriterion("treasury_bonds =", value, "treasuryBonds");
450
+            return (Criteria) this;
451
+        }
452
+
453
+        public Criteria andTreasuryBondsNotEqualTo(String value) {
454
+            addCriterion("treasury_bonds <>", value, "treasuryBonds");
455
+            return (Criteria) this;
456
+        }
457
+
458
+        public Criteria andTreasuryBondsGreaterThan(String value) {
459
+            addCriterion("treasury_bonds >", value, "treasuryBonds");
460
+            return (Criteria) this;
461
+        }
462
+
463
+        public Criteria andTreasuryBondsGreaterThanOrEqualTo(String value) {
464
+            addCriterion("treasury_bonds >=", value, "treasuryBonds");
465
+            return (Criteria) this;
466
+        }
467
+
468
+        public Criteria andTreasuryBondsLessThan(String value) {
469
+            addCriterion("treasury_bonds <", value, "treasuryBonds");
470
+            return (Criteria) this;
471
+        }
472
+
473
+        public Criteria andTreasuryBondsLessThanOrEqualTo(String value) {
474
+            addCriterion("treasury_bonds <=", value, "treasuryBonds");
475
+            return (Criteria) this;
476
+        }
477
+
478
+        public Criteria andTreasuryBondsLike(String value) {
479
+            addCriterion("treasury_bonds like", value, "treasuryBonds");
480
+            return (Criteria) this;
481
+        }
482
+
483
+        public Criteria andTreasuryBondsNotLike(String value) {
484
+            addCriterion("treasury_bonds not like", value, "treasuryBonds");
485
+            return (Criteria) this;
486
+        }
487
+
488
+        public Criteria andTreasuryBondsIn(List<String> values) {
489
+            addCriterion("treasury_bonds in", values, "treasuryBonds");
490
+            return (Criteria) this;
491
+        }
492
+
493
+        public Criteria andTreasuryBondsNotIn(List<String> values) {
494
+            addCriterion("treasury_bonds not in", values, "treasuryBonds");
495
+            return (Criteria) this;
496
+        }
497
+
498
+        public Criteria andTreasuryBondsBetween(String value1, String value2) {
499
+            addCriterion("treasury_bonds between", value1, value2, "treasuryBonds");
500
+            return (Criteria) this;
501
+        }
502
+
503
+        public Criteria andTreasuryBondsNotBetween(String value1, String value2) {
504
+            addCriterion("treasury_bonds not between", value1, value2, "treasuryBonds");
505
+            return (Criteria) this;
506
+        }
507
+
508
+        public Criteria andEnableDateIsNull() {
509
+            addCriterion("enable_date is null");
510
+            return (Criteria) this;
511
+        }
512
+
513
+        public Criteria andEnableDateIsNotNull() {
514
+            addCriterion("enable_date is not null");
515
+            return (Criteria) this;
516
+        }
517
+
518
+        public Criteria andEnableDateEqualTo(String value) {
519
+            addCriterion("enable_date =", value, "enableDate");
520
+            return (Criteria) this;
521
+        }
522
+
523
+        public Criteria andEnableDateNotEqualTo(String value) {
524
+            addCriterion("enable_date <>", value, "enableDate");
525
+            return (Criteria) this;
526
+        }
527
+
528
+        public Criteria andEnableDateGreaterThan(String value) {
529
+            addCriterion("enable_date >", value, "enableDate");
530
+            return (Criteria) this;
531
+        }
532
+
533
+        public Criteria andEnableDateGreaterThanOrEqualTo(String value) {
534
+            addCriterion("enable_date >=", value, "enableDate");
535
+            return (Criteria) this;
536
+        }
537
+
538
+        public Criteria andEnableDateLessThan(String value) {
539
+            addCriterion("enable_date <", value, "enableDate");
540
+            return (Criteria) this;
541
+        }
542
+
543
+        public Criteria andEnableDateLessThanOrEqualTo(String value) {
544
+            addCriterion("enable_date <=", value, "enableDate");
545
+            return (Criteria) this;
546
+        }
547
+
548
+        public Criteria andEnableDateLike(String value) {
549
+            addCriterion("enable_date like", value, "enableDate");
550
+            return (Criteria) this;
551
+        }
552
+
553
+        public Criteria andEnableDateNotLike(String value) {
554
+            addCriterion("enable_date not like", value, "enableDate");
555
+            return (Criteria) this;
556
+        }
557
+
558
+        public Criteria andEnableDateIn(List<String> values) {
559
+            addCriterion("enable_date in", values, "enableDate");
560
+            return (Criteria) this;
561
+        }
562
+
563
+        public Criteria andEnableDateNotIn(List<String> values) {
564
+            addCriterion("enable_date not in", values, "enableDate");
565
+            return (Criteria) this;
566
+        }
567
+
568
+        public Criteria andEnableDateBetween(String value1, String value2) {
569
+            addCriterion("enable_date between", value1, value2, "enableDate");
570
+            return (Criteria) this;
571
+        }
572
+
573
+        public Criteria andEnableDateNotBetween(String value1, String value2) {
574
+            addCriterion("enable_date not between", value1, value2, "enableDate");
575
+            return (Criteria) this;
576
+        }
577
+
578
+        public Criteria andStateIsNull() {
579
+            addCriterion("state is null");
580
+            return (Criteria) this;
581
+        }
582
+
583
+        public Criteria andStateIsNotNull() {
584
+            addCriterion("state is not null");
585
+            return (Criteria) this;
586
+        }
587
+
588
+        public Criteria andStateEqualTo(String value) {
589
+            addCriterion("state =", value, "state");
590
+            return (Criteria) this;
591
+        }
592
+
593
+        public Criteria andStateNotEqualTo(String value) {
594
+            addCriterion("state <>", value, "state");
595
+            return (Criteria) this;
596
+        }
597
+
598
+        public Criteria andStateGreaterThan(String value) {
599
+            addCriterion("state >", value, "state");
600
+            return (Criteria) this;
601
+        }
602
+
603
+        public Criteria andStateGreaterThanOrEqualTo(String value) {
604
+            addCriterion("state >=", value, "state");
605
+            return (Criteria) this;
606
+        }
607
+
608
+        public Criteria andStateLessThan(String value) {
609
+            addCriterion("state <", value, "state");
610
+            return (Criteria) this;
611
+        }
612
+
613
+        public Criteria andStateLessThanOrEqualTo(String value) {
614
+            addCriterion("state <=", value, "state");
615
+            return (Criteria) this;
616
+        }
617
+
618
+        public Criteria andStateLike(String value) {
619
+            addCriterion("state like", value, "state");
620
+            return (Criteria) this;
621
+        }
622
+
623
+        public Criteria andStateNotLike(String value) {
624
+            addCriterion("state not like", value, "state");
625
+            return (Criteria) this;
626
+        }
627
+
628
+        public Criteria andStateIn(List<String> values) {
629
+            addCriterion("state in", values, "state");
630
+            return (Criteria) this;
631
+        }
632
+
633
+        public Criteria andStateNotIn(List<String> values) {
634
+            addCriterion("state not in", values, "state");
635
+            return (Criteria) this;
636
+        }
637
+
638
+        public Criteria andStateBetween(String value1, String value2) {
639
+            addCriterion("state between", value1, value2, "state");
640
+            return (Criteria) this;
641
+        }
642
+
643
+        public Criteria andStateNotBetween(String value1, String value2) {
644
+            addCriterion("state not between", value1, value2, "state");
645
+            return (Criteria) this;
646
+        }
647
+
648
+        public Criteria andKeeperIsNull() {
649
+            addCriterion("keeper is null");
650
+            return (Criteria) this;
651
+        }
652
+
653
+        public Criteria andKeeperIsNotNull() {
654
+            addCriterion("keeper is not null");
655
+            return (Criteria) this;
656
+        }
657
+
658
+        public Criteria andKeeperEqualTo(String value) {
659
+            addCriterion("keeper =", value, "keeper");
660
+            return (Criteria) this;
661
+        }
662
+
663
+        public Criteria andKeeperNotEqualTo(String value) {
664
+            addCriterion("keeper <>", value, "keeper");
665
+            return (Criteria) this;
666
+        }
667
+
668
+        public Criteria andKeeperGreaterThan(String value) {
669
+            addCriterion("keeper >", value, "keeper");
670
+            return (Criteria) this;
671
+        }
672
+
673
+        public Criteria andKeeperGreaterThanOrEqualTo(String value) {
674
+            addCriterion("keeper >=", value, "keeper");
675
+            return (Criteria) this;
676
+        }
677
+
678
+        public Criteria andKeeperLessThan(String value) {
679
+            addCriterion("keeper <", value, "keeper");
680
+            return (Criteria) this;
681
+        }
682
+
683
+        public Criteria andKeeperLessThanOrEqualTo(String value) {
684
+            addCriterion("keeper <=", value, "keeper");
685
+            return (Criteria) this;
686
+        }
687
+
688
+        public Criteria andKeeperLike(String value) {
689
+            addCriterion("keeper like", value, "keeper");
690
+            return (Criteria) this;
691
+        }
692
+
693
+        public Criteria andKeeperNotLike(String value) {
694
+            addCriterion("keeper not like", value, "keeper");
695
+            return (Criteria) this;
696
+        }
697
+
698
+        public Criteria andKeeperIn(List<String> values) {
699
+            addCriterion("keeper in", values, "keeper");
700
+            return (Criteria) this;
701
+        }
702
+
703
+        public Criteria andKeeperNotIn(List<String> values) {
704
+            addCriterion("keeper not in", values, "keeper");
705
+            return (Criteria) this;
706
+        }
707
+
708
+        public Criteria andKeeperBetween(String value1, String value2) {
709
+            addCriterion("keeper between", value1, value2, "keeper");
710
+            return (Criteria) this;
711
+        }
712
+
713
+        public Criteria andKeeperNotBetween(String value1, String value2) {
714
+            addCriterion("keeper not between", value1, value2, "keeper");
715
+            return (Criteria) this;
716
+        }
717
+
718
+        public Criteria andOrgIdIsNull() {
719
+            addCriterion("org_id is null");
720
+            return (Criteria) this;
721
+        }
722
+
723
+        public Criteria andOrgIdIsNotNull() {
724
+            addCriterion("org_id is not null");
725
+            return (Criteria) this;
726
+        }
727
+
728
+        public Criteria andOrgIdEqualTo(Integer value) {
729
+            addCriterion("org_id =", value, "orgId");
730
+            return (Criteria) this;
731
+        }
732
+
733
+        public Criteria andOrgIdNotEqualTo(Integer value) {
734
+            addCriterion("org_id <>", value, "orgId");
735
+            return (Criteria) this;
736
+        }
737
+
738
+        public Criteria andOrgIdGreaterThan(Integer value) {
739
+            addCriterion("org_id >", value, "orgId");
740
+            return (Criteria) this;
741
+        }
742
+
743
+        public Criteria andOrgIdGreaterThanOrEqualTo(Integer value) {
744
+            addCriterion("org_id >=", value, "orgId");
745
+            return (Criteria) this;
746
+        }
747
+
748
+        public Criteria andOrgIdLessThan(Integer value) {
749
+            addCriterion("org_id <", value, "orgId");
750
+            return (Criteria) this;
751
+        }
752
+
753
+        public Criteria andOrgIdLessThanOrEqualTo(Integer value) {
754
+            addCriterion("org_id <=", value, "orgId");
755
+            return (Criteria) this;
756
+        }
757
+
758
+        public Criteria andOrgIdIn(List<Integer> values) {
759
+            addCriterion("org_id in", values, "orgId");
760
+            return (Criteria) this;
761
+        }
762
+
763
+        public Criteria andOrgIdNotIn(List<Integer> values) {
764
+            addCriterion("org_id not in", values, "orgId");
765
+            return (Criteria) this;
766
+        }
767
+
768
+        public Criteria andOrgIdBetween(Integer value1, Integer value2) {
769
+            addCriterion("org_id between", value1, value2, "orgId");
770
+            return (Criteria) this;
771
+        }
772
+
773
+        public Criteria andOrgIdNotBetween(Integer value1, Integer value2) {
774
+            addCriterion("org_id not between", value1, value2, "orgId");
775
+            return (Criteria) this;
776
+        }
777
+
778
+        public Criteria andCreateTimeIsNull() {
779
+            addCriterion("create_time is null");
780
+            return (Criteria) this;
781
+        }
782
+
783
+        public Criteria andCreateTimeIsNotNull() {
784
+            addCriterion("create_time is not null");
785
+            return (Criteria) this;
786
+        }
787
+
788
+        public Criteria andCreateTimeEqualTo(Date value) {
789
+            addCriterion("create_time =", value, "createTime");
790
+            return (Criteria) this;
791
+        }
792
+
793
+        public Criteria andCreateTimeNotEqualTo(Date value) {
794
+            addCriterion("create_time <>", value, "createTime");
795
+            return (Criteria) this;
796
+        }
797
+
798
+        public Criteria andCreateTimeGreaterThan(Date value) {
799
+            addCriterion("create_time >", value, "createTime");
800
+            return (Criteria) this;
801
+        }
802
+
803
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
804
+            addCriterion("create_time >=", value, "createTime");
805
+            return (Criteria) this;
806
+        }
807
+
808
+        public Criteria andCreateTimeLessThan(Date value) {
809
+            addCriterion("create_time <", value, "createTime");
810
+            return (Criteria) this;
811
+        }
812
+
813
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
814
+            addCriterion("create_time <=", value, "createTime");
815
+            return (Criteria) this;
816
+        }
817
+
818
+        public Criteria andCreateTimeIn(List<Date> values) {
819
+            addCriterion("create_time in", values, "createTime");
820
+            return (Criteria) this;
821
+        }
822
+
823
+        public Criteria andCreateTimeNotIn(List<Date> values) {
824
+            addCriterion("create_time not in", values, "createTime");
825
+            return (Criteria) this;
826
+        }
827
+
828
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
829
+            addCriterion("create_time between", value1, value2, "createTime");
830
+            return (Criteria) this;
831
+        }
832
+
833
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
834
+            addCriterion("create_time not between", value1, value2, "createTime");
835
+            return (Criteria) this;
836
+        }
837
+
838
+        public Criteria andUpdatetimeIsNull() {
839
+            addCriterion("updatetime is null");
840
+            return (Criteria) this;
841
+        }
842
+
843
+        public Criteria andUpdatetimeIsNotNull() {
844
+            addCriterion("updatetime is not null");
845
+            return (Criteria) this;
846
+        }
847
+
848
+        public Criteria andUpdatetimeEqualTo(Date value) {
849
+            addCriterion("updatetime =", value, "updatetime");
850
+            return (Criteria) this;
851
+        }
852
+
853
+        public Criteria andUpdatetimeNotEqualTo(Date value) {
854
+            addCriterion("updatetime <>", value, "updatetime");
855
+            return (Criteria) this;
856
+        }
857
+
858
+        public Criteria andUpdatetimeGreaterThan(Date value) {
859
+            addCriterion("updatetime >", value, "updatetime");
860
+            return (Criteria) this;
861
+        }
862
+
863
+        public Criteria andUpdatetimeGreaterThanOrEqualTo(Date value) {
864
+            addCriterion("updatetime >=", value, "updatetime");
865
+            return (Criteria) this;
866
+        }
867
+
868
+        public Criteria andUpdatetimeLessThan(Date value) {
869
+            addCriterion("updatetime <", value, "updatetime");
870
+            return (Criteria) this;
871
+        }
872
+
873
+        public Criteria andUpdatetimeLessThanOrEqualTo(Date value) {
874
+            addCriterion("updatetime <=", value, "updatetime");
875
+            return (Criteria) this;
876
+        }
877
+
878
+        public Criteria andUpdatetimeIn(List<Date> values) {
879
+            addCriterion("updatetime in", values, "updatetime");
880
+            return (Criteria) this;
881
+        }
882
+
883
+        public Criteria andUpdatetimeNotIn(List<Date> values) {
884
+            addCriterion("updatetime not in", values, "updatetime");
885
+            return (Criteria) this;
886
+        }
887
+
888
+        public Criteria andUpdatetimeBetween(Date value1, Date value2) {
889
+            addCriterion("updatetime between", value1, value2, "updatetime");
890
+            return (Criteria) this;
891
+        }
892
+
893
+        public Criteria andUpdatetimeNotBetween(Date value1, Date value2) {
894
+            addCriterion("updatetime not between", value1, value2, "updatetime");
895
+            return (Criteria) this;
896
+        }
897
+    }
898
+
899
+    public static class Criteria extends GeneratedCriteria {
900
+
901
+        protected Criteria() {
902
+            super();
903
+        }
904
+    }
905
+
906
+    public static class Criterion {
907
+        private String condition;
908
+
909
+        private Object value;
910
+
911
+        private Object secondValue;
912
+
913
+        private boolean noValue;
914
+
915
+        private boolean singleValue;
916
+
917
+        private boolean betweenValue;
918
+
919
+        private boolean listValue;
920
+
921
+        private String typeHandler;
922
+
923
+        public String getCondition() {
924
+            return condition;
925
+        }
926
+
927
+        public Object getValue() {
928
+            return value;
929
+        }
930
+
931
+        public Object getSecondValue() {
932
+            return secondValue;
933
+        }
934
+
935
+        public boolean isNoValue() {
936
+            return noValue;
937
+        }
938
+
939
+        public boolean isSingleValue() {
940
+            return singleValue;
941
+        }
942
+
943
+        public boolean isBetweenValue() {
944
+            return betweenValue;
945
+        }
946
+
947
+        public boolean isListValue() {
948
+            return listValue;
949
+        }
950
+
951
+        public String getTypeHandler() {
952
+            return typeHandler;
953
+        }
954
+
955
+        protected Criterion(String condition) {
956
+            super();
957
+            this.condition = condition;
958
+            this.typeHandler = null;
959
+            this.noValue = true;
960
+        }
961
+
962
+        protected Criterion(String condition, Object value, String typeHandler) {
963
+            super();
964
+            this.condition = condition;
965
+            this.value = value;
966
+            this.typeHandler = typeHandler;
967
+            if (value instanceof List<?>) {
968
+                this.listValue = true;
969
+            } else {
970
+                this.singleValue = true;
971
+            }
972
+        }
973
+
974
+        protected Criterion(String condition, Object value) {
975
+            this(condition, value, null);
976
+        }
977
+
978
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
979
+            super();
980
+            this.condition = condition;
981
+            this.value = value;
982
+            this.secondValue = secondValue;
983
+            this.typeHandler = typeHandler;
984
+            this.betweenValue = true;
985
+        }
986
+
987
+        protected Criterion(String condition, Object value, Object secondValue) {
988
+            this(condition, value, secondValue, null);
989
+        }
990
+    }
991
+}

+ 185 - 0
src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentWarehouse.java

@@ -0,0 +1,185 @@
1
+package com.chinaitop.depot.agent.basic.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessAgentWarehouse {
6
+    private Integer id;
7
+
8
+    private Integer warehouseId;
9
+
10
+    private Integer agentStorehouseId;
11
+
12
+    private Integer orgId;
13
+
14
+    private Integer delFlag;
15
+
16
+    private Date createTime;
17
+
18
+    private Date bgmxzTbsj;
19
+
20
+    private Date qccrkTbsj;
21
+
22
+    private Date hccrkTbsj;
23
+
24
+    private Date updatetime;
25
+
26
+    /**
27
+     * 
28
+     * @return id 
29
+     */
30
+    public Integer getId() {
31
+        return id;
32
+    }
33
+
34
+    /**
35
+     * 
36
+     * @param id 
37
+     */
38
+    public void setId(Integer id) {
39
+        this.id = id;
40
+    }
41
+
42
+    /**
43
+     * 已有货位id
44
+     * @return warehouse_id 已有货位id
45
+     */
46
+    public Integer getWarehouseId() {
47
+        return warehouseId;
48
+    }
49
+
50
+    /**
51
+     * 已有货位id
52
+     * @param warehouseId 已有货位id
53
+     */
54
+    public void setWarehouseId(Integer warehouseId) {
55
+        this.warehouseId = warehouseId;
56
+    }
57
+
58
+    /**
59
+     * 代储仓房id
60
+     * @return agent_storehouse_id 代储仓房id
61
+     */
62
+    public Integer getAgentStorehouseId() {
63
+        return agentStorehouseId;
64
+    }
65
+
66
+    /**
67
+     * 代储仓房id
68
+     * @param agentStorehouseId 代储仓房id
69
+     */
70
+    public void setAgentStorehouseId(Integer agentStorehouseId) {
71
+        this.agentStorehouseId = agentStorehouseId;
72
+    }
73
+
74
+    /**
75
+     * 组织机构id
76
+     * @return org_id 组织机构id
77
+     */
78
+    public Integer getOrgId() {
79
+        return orgId;
80
+    }
81
+
82
+    /**
83
+     * 组织机构id
84
+     * @param orgId 组织机构id
85
+     */
86
+    public void setOrgId(Integer orgId) {
87
+        this.orgId = orgId;
88
+    }
89
+
90
+    /**
91
+     * 删除状态(1.正常,2.删除)
92
+     * @return del_flag 删除状态(1.正常,2.删除)
93
+     */
94
+    public Integer getDelFlag() {
95
+        return delFlag;
96
+    }
97
+
98
+    /**
99
+     * 删除状态(1.正常,2.删除)
100
+     * @param delFlag 删除状态(1.正常,2.删除)
101
+     */
102
+    public void setDelFlag(Integer delFlag) {
103
+        this.delFlag = delFlag;
104
+    }
105
+
106
+    /**
107
+     * 创建时间
108
+     * @return create_time 创建时间
109
+     */
110
+    public Date getCreateTime() {
111
+        return createTime;
112
+    }
113
+
114
+    /**
115
+     * 创建时间
116
+     * @param createTime 创建时间
117
+     */
118
+    public void setCreateTime(Date createTime) {
119
+        this.createTime = createTime;
120
+    }
121
+
122
+    /**
123
+     * 保管明细账最后同步时间
124
+     * @return bgmxz_tbsj 保管明细账最后同步时间
125
+     */
126
+    public Date getBgmxzTbsj() {
127
+        return bgmxzTbsj;
128
+    }
129
+
130
+    /**
131
+     * 保管明细账最后同步时间
132
+     * @param bgmxzTbsj 保管明细账最后同步时间
133
+     */
134
+    public void setBgmxzTbsj(Date bgmxzTbsj) {
135
+        this.bgmxzTbsj = bgmxzTbsj;
136
+    }
137
+
138
+    /**
139
+     * 汽车出入库最后同步时间
140
+     * @return qccrk_tbsj 汽车出入库最后同步时间
141
+     */
142
+    public Date getQccrkTbsj() {
143
+        return qccrkTbsj;
144
+    }
145
+
146
+    /**
147
+     * 汽车出入库最后同步时间
148
+     * @param qccrkTbsj 汽车出入库最后同步时间
149
+     */
150
+    public void setQccrkTbsj(Date qccrkTbsj) {
151
+        this.qccrkTbsj = qccrkTbsj;
152
+    }
153
+
154
+    /**
155
+     * 火车出入库最后同步时间
156
+     * @return hccrk_tbsj 火车出入库最后同步时间
157
+     */
158
+    public Date getHccrkTbsj() {
159
+        return hccrkTbsj;
160
+    }
161
+
162
+    /**
163
+     * 火车出入库最后同步时间
164
+     * @param hccrkTbsj 火车出入库最后同步时间
165
+     */
166
+    public void setHccrkTbsj(Date hccrkTbsj) {
167
+        this.hccrkTbsj = hccrkTbsj;
168
+    }
169
+
170
+    /**
171
+     * 
172
+     * @return updatetime 
173
+     */
174
+    public Date getUpdatetime() {
175
+        return updatetime;
176
+    }
177
+
178
+    /**
179
+     * 
180
+     * @param updatetime 
181
+     */
182
+    public void setUpdatetime(Date updatetime) {
183
+        this.updatetime = updatetime;
184
+    }
185
+}

+ 819 - 0
src/main/java/com/chinaitop/depot/agent/basic/model/BusinessAgentWarehouseExample.java

@@ -0,0 +1,819 @@
1
+package com.chinaitop.depot.agent.basic.model;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.List;
6
+
7
+public class BusinessAgentWarehouseExample {
8
+    /**
9
+     * business_agent_warehouse
10
+     */
11
+    protected String orderByClause;
12
+
13
+    /**
14
+     * business_agent_warehouse
15
+     */
16
+    protected boolean distinct;
17
+
18
+    /**
19
+     * business_agent_warehouse
20
+     */
21
+    protected List<Criteria> oredCriteria;
22
+
23
+    public BusinessAgentWarehouseExample() {
24
+        oredCriteria = new ArrayList<Criteria>();
25
+    }
26
+
27
+    public void setOrderByClause(String orderByClause) {
28
+        this.orderByClause = orderByClause;
29
+    }
30
+
31
+    public String getOrderByClause() {
32
+        return orderByClause;
33
+    }
34
+
35
+    public void setDistinct(boolean distinct) {
36
+        this.distinct = distinct;
37
+    }
38
+
39
+    public boolean isDistinct() {
40
+        return distinct;
41
+    }
42
+
43
+    public List<Criteria> getOredCriteria() {
44
+        return oredCriteria;
45
+    }
46
+
47
+    public void or(Criteria criteria) {
48
+        oredCriteria.add(criteria);
49
+    }
50
+
51
+    public Criteria or() {
52
+        Criteria criteria = createCriteriaInternal();
53
+        oredCriteria.add(criteria);
54
+        return criteria;
55
+    }
56
+
57
+    public Criteria createCriteria() {
58
+        Criteria criteria = createCriteriaInternal();
59
+        if (oredCriteria.size() == 0) {
60
+            oredCriteria.add(criteria);
61
+        }
62
+        return criteria;
63
+    }
64
+
65
+    protected Criteria createCriteriaInternal() {
66
+        Criteria criteria = new Criteria();
67
+        return criteria;
68
+    }
69
+
70
+    public void clear() {
71
+        oredCriteria.clear();
72
+        orderByClause = null;
73
+        distinct = false;
74
+    }
75
+
76
+    /**
77
+     * business_agent_warehouse 2019-09-19
78
+     */
79
+    protected abstract static class GeneratedCriteria {
80
+        protected List<Criterion> criteria;
81
+
82
+        protected GeneratedCriteria() {
83
+            super();
84
+            criteria = new ArrayList<Criterion>();
85
+        }
86
+
87
+        public boolean isValid() {
88
+            return criteria.size() > 0;
89
+        }
90
+
91
+        public List<Criterion> getAllCriteria() {
92
+            return criteria;
93
+        }
94
+
95
+        public List<Criterion> getCriteria() {
96
+            return criteria;
97
+        }
98
+
99
+        protected void addCriterion(String condition) {
100
+            if (condition == null) {
101
+                throw new RuntimeException("Value for condition cannot be null");
102
+            }
103
+            criteria.add(new Criterion(condition));
104
+        }
105
+
106
+        protected void addCriterion(String condition, Object value, String property) {
107
+            if (value == null) {
108
+                throw new RuntimeException("Value for " + property + " cannot be null");
109
+            }
110
+            criteria.add(new Criterion(condition, value));
111
+        }
112
+
113
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
114
+            if (value1 == null || value2 == null) {
115
+                throw new RuntimeException("Between values for " + property + " cannot be null");
116
+            }
117
+            criteria.add(new Criterion(condition, value1, value2));
118
+        }
119
+
120
+        public Criteria andIdIsNull() {
121
+            addCriterion("id is null");
122
+            return (Criteria) this;
123
+        }
124
+
125
+        public Criteria andIdIsNotNull() {
126
+            addCriterion("id is not null");
127
+            return (Criteria) this;
128
+        }
129
+
130
+        public Criteria andIdEqualTo(Integer value) {
131
+            addCriterion("id =", value, "id");
132
+            return (Criteria) this;
133
+        }
134
+
135
+        public Criteria andIdNotEqualTo(Integer value) {
136
+            addCriterion("id <>", value, "id");
137
+            return (Criteria) this;
138
+        }
139
+
140
+        public Criteria andIdGreaterThan(Integer value) {
141
+            addCriterion("id >", value, "id");
142
+            return (Criteria) this;
143
+        }
144
+
145
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
146
+            addCriterion("id >=", value, "id");
147
+            return (Criteria) this;
148
+        }
149
+
150
+        public Criteria andIdLessThan(Integer value) {
151
+            addCriterion("id <", value, "id");
152
+            return (Criteria) this;
153
+        }
154
+
155
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
156
+            addCriterion("id <=", value, "id");
157
+            return (Criteria) this;
158
+        }
159
+
160
+        public Criteria andIdIn(List<Integer> values) {
161
+            addCriterion("id in", values, "id");
162
+            return (Criteria) this;
163
+        }
164
+
165
+        public Criteria andIdNotIn(List<Integer> values) {
166
+            addCriterion("id not in", values, "id");
167
+            return (Criteria) this;
168
+        }
169
+
170
+        public Criteria andIdBetween(Integer value1, Integer value2) {
171
+            addCriterion("id between", value1, value2, "id");
172
+            return (Criteria) this;
173
+        }
174
+
175
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
176
+            addCriterion("id not between", value1, value2, "id");
177
+            return (Criteria) this;
178
+        }
179
+
180
+        public Criteria andWarehouseIdIsNull() {
181
+            addCriterion("warehouse_id is null");
182
+            return (Criteria) this;
183
+        }
184
+
185
+        public Criteria andWarehouseIdIsNotNull() {
186
+            addCriterion("warehouse_id is not null");
187
+            return (Criteria) this;
188
+        }
189
+
190
+        public Criteria andWarehouseIdEqualTo(Integer value) {
191
+            addCriterion("warehouse_id =", value, "warehouseId");
192
+            return (Criteria) this;
193
+        }
194
+
195
+        public Criteria andWarehouseIdNotEqualTo(Integer value) {
196
+            addCriterion("warehouse_id <>", value, "warehouseId");
197
+            return (Criteria) this;
198
+        }
199
+
200
+        public Criteria andWarehouseIdGreaterThan(Integer value) {
201
+            addCriterion("warehouse_id >", value, "warehouseId");
202
+            return (Criteria) this;
203
+        }
204
+
205
+        public Criteria andWarehouseIdGreaterThanOrEqualTo(Integer value) {
206
+            addCriterion("warehouse_id >=", value, "warehouseId");
207
+            return (Criteria) this;
208
+        }
209
+
210
+        public Criteria andWarehouseIdLessThan(Integer value) {
211
+            addCriterion("warehouse_id <", value, "warehouseId");
212
+            return (Criteria) this;
213
+        }
214
+
215
+        public Criteria andWarehouseIdLessThanOrEqualTo(Integer value) {
216
+            addCriterion("warehouse_id <=", value, "warehouseId");
217
+            return (Criteria) this;
218
+        }
219
+
220
+        public Criteria andWarehouseIdIn(List<Integer> values) {
221
+            addCriterion("warehouse_id in", values, "warehouseId");
222
+            return (Criteria) this;
223
+        }
224
+
225
+        public Criteria andWarehouseIdNotIn(List<Integer> values) {
226
+            addCriterion("warehouse_id not in", values, "warehouseId");
227
+            return (Criteria) this;
228
+        }
229
+
230
+        public Criteria andWarehouseIdBetween(Integer value1, Integer value2) {
231
+            addCriterion("warehouse_id between", value1, value2, "warehouseId");
232
+            return (Criteria) this;
233
+        }
234
+
235
+        public Criteria andWarehouseIdNotBetween(Integer value1, Integer value2) {
236
+            addCriterion("warehouse_id not between", value1, value2, "warehouseId");
237
+            return (Criteria) this;
238
+        }
239
+
240
+        public Criteria andAgentStorehouseIdIsNull() {
241
+            addCriterion("agent_storehouse_id is null");
242
+            return (Criteria) this;
243
+        }
244
+
245
+        public Criteria andAgentStorehouseIdIsNotNull() {
246
+            addCriterion("agent_storehouse_id is not null");
247
+            return (Criteria) this;
248
+        }
249
+
250
+        public Criteria andAgentStorehouseIdEqualTo(Integer value) {
251
+            addCriterion("agent_storehouse_id =", value, "agentStorehouseId");
252
+            return (Criteria) this;
253
+        }
254
+
255
+        public Criteria andAgentStorehouseIdNotEqualTo(Integer value) {
256
+            addCriterion("agent_storehouse_id <>", value, "agentStorehouseId");
257
+            return (Criteria) this;
258
+        }
259
+
260
+        public Criteria andAgentStorehouseIdGreaterThan(Integer value) {
261
+            addCriterion("agent_storehouse_id >", value, "agentStorehouseId");
262
+            return (Criteria) this;
263
+        }
264
+
265
+        public Criteria andAgentStorehouseIdGreaterThanOrEqualTo(Integer value) {
266
+            addCriterion("agent_storehouse_id >=", value, "agentStorehouseId");
267
+            return (Criteria) this;
268
+        }
269
+
270
+        public Criteria andAgentStorehouseIdLessThan(Integer value) {
271
+            addCriterion("agent_storehouse_id <", value, "agentStorehouseId");
272
+            return (Criteria) this;
273
+        }
274
+
275
+        public Criteria andAgentStorehouseIdLessThanOrEqualTo(Integer value) {
276
+            addCriterion("agent_storehouse_id <=", value, "agentStorehouseId");
277
+            return (Criteria) this;
278
+        }
279
+
280
+        public Criteria andAgentStorehouseIdIn(List<Integer> values) {
281
+            addCriterion("agent_storehouse_id in", values, "agentStorehouseId");
282
+            return (Criteria) this;
283
+        }
284
+
285
+        public Criteria andAgentStorehouseIdNotIn(List<Integer> values) {
286
+            addCriterion("agent_storehouse_id not in", values, "agentStorehouseId");
287
+            return (Criteria) this;
288
+        }
289
+
290
+        public Criteria andAgentStorehouseIdBetween(Integer value1, Integer value2) {
291
+            addCriterion("agent_storehouse_id between", value1, value2, "agentStorehouseId");
292
+            return (Criteria) this;
293
+        }
294
+
295
+        public Criteria andAgentStorehouseIdNotBetween(Integer value1, Integer value2) {
296
+            addCriterion("agent_storehouse_id not between", value1, value2, "agentStorehouseId");
297
+            return (Criteria) this;
298
+        }
299
+
300
+        public Criteria andOrgIdIsNull() {
301
+            addCriterion("org_id is null");
302
+            return (Criteria) this;
303
+        }
304
+
305
+        public Criteria andOrgIdIsNotNull() {
306
+            addCriterion("org_id is not null");
307
+            return (Criteria) this;
308
+        }
309
+
310
+        public Criteria andOrgIdEqualTo(Integer value) {
311
+            addCriterion("org_id =", value, "orgId");
312
+            return (Criteria) this;
313
+        }
314
+
315
+        public Criteria andOrgIdNotEqualTo(Integer value) {
316
+            addCriterion("org_id <>", value, "orgId");
317
+            return (Criteria) this;
318
+        }
319
+
320
+        public Criteria andOrgIdGreaterThan(Integer value) {
321
+            addCriterion("org_id >", value, "orgId");
322
+            return (Criteria) this;
323
+        }
324
+
325
+        public Criteria andOrgIdGreaterThanOrEqualTo(Integer value) {
326
+            addCriterion("org_id >=", value, "orgId");
327
+            return (Criteria) this;
328
+        }
329
+
330
+        public Criteria andOrgIdLessThan(Integer value) {
331
+            addCriterion("org_id <", value, "orgId");
332
+            return (Criteria) this;
333
+        }
334
+
335
+        public Criteria andOrgIdLessThanOrEqualTo(Integer value) {
336
+            addCriterion("org_id <=", value, "orgId");
337
+            return (Criteria) this;
338
+        }
339
+
340
+        public Criteria andOrgIdIn(List<Integer> values) {
341
+            addCriterion("org_id in", values, "orgId");
342
+            return (Criteria) this;
343
+        }
344
+
345
+        public Criteria andOrgIdNotIn(List<Integer> values) {
346
+            addCriterion("org_id not in", values, "orgId");
347
+            return (Criteria) this;
348
+        }
349
+
350
+        public Criteria andOrgIdBetween(Integer value1, Integer value2) {
351
+            addCriterion("org_id between", value1, value2, "orgId");
352
+            return (Criteria) this;
353
+        }
354
+
355
+        public Criteria andOrgIdNotBetween(Integer value1, Integer value2) {
356
+            addCriterion("org_id not between", value1, value2, "orgId");
357
+            return (Criteria) this;
358
+        }
359
+
360
+        public Criteria andDelFlagIsNull() {
361
+            addCriterion("del_flag is null");
362
+            return (Criteria) this;
363
+        }
364
+
365
+        public Criteria andDelFlagIsNotNull() {
366
+            addCriterion("del_flag is not null");
367
+            return (Criteria) this;
368
+        }
369
+
370
+        public Criteria andDelFlagEqualTo(Integer value) {
371
+            addCriterion("del_flag =", value, "delFlag");
372
+            return (Criteria) this;
373
+        }
374
+
375
+        public Criteria andDelFlagNotEqualTo(Integer value) {
376
+            addCriterion("del_flag <>", value, "delFlag");
377
+            return (Criteria) this;
378
+        }
379
+
380
+        public Criteria andDelFlagGreaterThan(Integer value) {
381
+            addCriterion("del_flag >", value, "delFlag");
382
+            return (Criteria) this;
383
+        }
384
+
385
+        public Criteria andDelFlagGreaterThanOrEqualTo(Integer value) {
386
+            addCriterion("del_flag >=", value, "delFlag");
387
+            return (Criteria) this;
388
+        }
389
+
390
+        public Criteria andDelFlagLessThan(Integer value) {
391
+            addCriterion("del_flag <", value, "delFlag");
392
+            return (Criteria) this;
393
+        }
394
+
395
+        public Criteria andDelFlagLessThanOrEqualTo(Integer value) {
396
+            addCriterion("del_flag <=", value, "delFlag");
397
+            return (Criteria) this;
398
+        }
399
+
400
+        public Criteria andDelFlagIn(List<Integer> values) {
401
+            addCriterion("del_flag in", values, "delFlag");
402
+            return (Criteria) this;
403
+        }
404
+
405
+        public Criteria andDelFlagNotIn(List<Integer> values) {
406
+            addCriterion("del_flag not in", values, "delFlag");
407
+            return (Criteria) this;
408
+        }
409
+
410
+        public Criteria andDelFlagBetween(Integer value1, Integer value2) {
411
+            addCriterion("del_flag between", value1, value2, "delFlag");
412
+            return (Criteria) this;
413
+        }
414
+
415
+        public Criteria andDelFlagNotBetween(Integer value1, Integer value2) {
416
+            addCriterion("del_flag not between", value1, value2, "delFlag");
417
+            return (Criteria) this;
418
+        }
419
+
420
+        public Criteria andCreateTimeIsNull() {
421
+            addCriterion("create_time is null");
422
+            return (Criteria) this;
423
+        }
424
+
425
+        public Criteria andCreateTimeIsNotNull() {
426
+            addCriterion("create_time is not null");
427
+            return (Criteria) this;
428
+        }
429
+
430
+        public Criteria andCreateTimeEqualTo(Date value) {
431
+            addCriterion("create_time =", value, "createTime");
432
+            return (Criteria) this;
433
+        }
434
+
435
+        public Criteria andCreateTimeNotEqualTo(Date value) {
436
+            addCriterion("create_time <>", value, "createTime");
437
+            return (Criteria) this;
438
+        }
439
+
440
+        public Criteria andCreateTimeGreaterThan(Date value) {
441
+            addCriterion("create_time >", value, "createTime");
442
+            return (Criteria) this;
443
+        }
444
+
445
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
446
+            addCriterion("create_time >=", value, "createTime");
447
+            return (Criteria) this;
448
+        }
449
+
450
+        public Criteria andCreateTimeLessThan(Date value) {
451
+            addCriterion("create_time <", value, "createTime");
452
+            return (Criteria) this;
453
+        }
454
+
455
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
456
+            addCriterion("create_time <=", value, "createTime");
457
+            return (Criteria) this;
458
+        }
459
+
460
+        public Criteria andCreateTimeIn(List<Date> values) {
461
+            addCriterion("create_time in", values, "createTime");
462
+            return (Criteria) this;
463
+        }
464
+
465
+        public Criteria andCreateTimeNotIn(List<Date> values) {
466
+            addCriterion("create_time not in", values, "createTime");
467
+            return (Criteria) this;
468
+        }
469
+
470
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
471
+            addCriterion("create_time between", value1, value2, "createTime");
472
+            return (Criteria) this;
473
+        }
474
+
475
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
476
+            addCriterion("create_time not between", value1, value2, "createTime");
477
+            return (Criteria) this;
478
+        }
479
+
480
+        public Criteria andBgmxzTbsjIsNull() {
481
+            addCriterion("bgmxz_tbsj is null");
482
+            return (Criteria) this;
483
+        }
484
+
485
+        public Criteria andBgmxzTbsjIsNotNull() {
486
+            addCriterion("bgmxz_tbsj is not null");
487
+            return (Criteria) this;
488
+        }
489
+
490
+        public Criteria andBgmxzTbsjEqualTo(Date value) {
491
+            addCriterion("bgmxz_tbsj =", value, "bgmxzTbsj");
492
+            return (Criteria) this;
493
+        }
494
+
495
+        public Criteria andBgmxzTbsjNotEqualTo(Date value) {
496
+            addCriterion("bgmxz_tbsj <>", value, "bgmxzTbsj");
497
+            return (Criteria) this;
498
+        }
499
+
500
+        public Criteria andBgmxzTbsjGreaterThan(Date value) {
501
+            addCriterion("bgmxz_tbsj >", value, "bgmxzTbsj");
502
+            return (Criteria) this;
503
+        }
504
+
505
+        public Criteria andBgmxzTbsjGreaterThanOrEqualTo(Date value) {
506
+            addCriterion("bgmxz_tbsj >=", value, "bgmxzTbsj");
507
+            return (Criteria) this;
508
+        }
509
+
510
+        public Criteria andBgmxzTbsjLessThan(Date value) {
511
+            addCriterion("bgmxz_tbsj <", value, "bgmxzTbsj");
512
+            return (Criteria) this;
513
+        }
514
+
515
+        public Criteria andBgmxzTbsjLessThanOrEqualTo(Date value) {
516
+            addCriterion("bgmxz_tbsj <=", value, "bgmxzTbsj");
517
+            return (Criteria) this;
518
+        }
519
+
520
+        public Criteria andBgmxzTbsjIn(List<Date> values) {
521
+            addCriterion("bgmxz_tbsj in", values, "bgmxzTbsj");
522
+            return (Criteria) this;
523
+        }
524
+
525
+        public Criteria andBgmxzTbsjNotIn(List<Date> values) {
526
+            addCriterion("bgmxz_tbsj not in", values, "bgmxzTbsj");
527
+            return (Criteria) this;
528
+        }
529
+
530
+        public Criteria andBgmxzTbsjBetween(Date value1, Date value2) {
531
+            addCriterion("bgmxz_tbsj between", value1, value2, "bgmxzTbsj");
532
+            return (Criteria) this;
533
+        }
534
+
535
+        public Criteria andBgmxzTbsjNotBetween(Date value1, Date value2) {
536
+            addCriterion("bgmxz_tbsj not between", value1, value2, "bgmxzTbsj");
537
+            return (Criteria) this;
538
+        }
539
+
540
+        public Criteria andQccrkTbsjIsNull() {
541
+            addCriterion("qccrk_tbsj is null");
542
+            return (Criteria) this;
543
+        }
544
+
545
+        public Criteria andQccrkTbsjIsNotNull() {
546
+            addCriterion("qccrk_tbsj is not null");
547
+            return (Criteria) this;
548
+        }
549
+
550
+        public Criteria andQccrkTbsjEqualTo(Date value) {
551
+            addCriterion("qccrk_tbsj =", value, "qccrkTbsj");
552
+            return (Criteria) this;
553
+        }
554
+
555
+        public Criteria andQccrkTbsjNotEqualTo(Date value) {
556
+            addCriterion("qccrk_tbsj <>", value, "qccrkTbsj");
557
+            return (Criteria) this;
558
+        }
559
+
560
+        public Criteria andQccrkTbsjGreaterThan(Date value) {
561
+            addCriterion("qccrk_tbsj >", value, "qccrkTbsj");
562
+            return (Criteria) this;
563
+        }
564
+
565
+        public Criteria andQccrkTbsjGreaterThanOrEqualTo(Date value) {
566
+            addCriterion("qccrk_tbsj >=", value, "qccrkTbsj");
567
+            return (Criteria) this;
568
+        }
569
+
570
+        public Criteria andQccrkTbsjLessThan(Date value) {
571
+            addCriterion("qccrk_tbsj <", value, "qccrkTbsj");
572
+            return (Criteria) this;
573
+        }
574
+
575
+        public Criteria andQccrkTbsjLessThanOrEqualTo(Date value) {
576
+            addCriterion("qccrk_tbsj <=", value, "qccrkTbsj");
577
+            return (Criteria) this;
578
+        }
579
+
580
+        public Criteria andQccrkTbsjIn(List<Date> values) {
581
+            addCriterion("qccrk_tbsj in", values, "qccrkTbsj");
582
+            return (Criteria) this;
583
+        }
584
+
585
+        public Criteria andQccrkTbsjNotIn(List<Date> values) {
586
+            addCriterion("qccrk_tbsj not in", values, "qccrkTbsj");
587
+            return (Criteria) this;
588
+        }
589
+
590
+        public Criteria andQccrkTbsjBetween(Date value1, Date value2) {
591
+            addCriterion("qccrk_tbsj between", value1, value2, "qccrkTbsj");
592
+            return (Criteria) this;
593
+        }
594
+
595
+        public Criteria andQccrkTbsjNotBetween(Date value1, Date value2) {
596
+            addCriterion("qccrk_tbsj not between", value1, value2, "qccrkTbsj");
597
+            return (Criteria) this;
598
+        }
599
+
600
+        public Criteria andHccrkTbsjIsNull() {
601
+            addCriterion("hccrk_tbsj is null");
602
+            return (Criteria) this;
603
+        }
604
+
605
+        public Criteria andHccrkTbsjIsNotNull() {
606
+            addCriterion("hccrk_tbsj is not null");
607
+            return (Criteria) this;
608
+        }
609
+
610
+        public Criteria andHccrkTbsjEqualTo(Date value) {
611
+            addCriterion("hccrk_tbsj =", value, "hccrkTbsj");
612
+            return (Criteria) this;
613
+        }
614
+
615
+        public Criteria andHccrkTbsjNotEqualTo(Date value) {
616
+            addCriterion("hccrk_tbsj <>", value, "hccrkTbsj");
617
+            return (Criteria) this;
618
+        }
619
+
620
+        public Criteria andHccrkTbsjGreaterThan(Date value) {
621
+            addCriterion("hccrk_tbsj >", value, "hccrkTbsj");
622
+            return (Criteria) this;
623
+        }
624
+
625
+        public Criteria andHccrkTbsjGreaterThanOrEqualTo(Date value) {
626
+            addCriterion("hccrk_tbsj >=", value, "hccrkTbsj");
627
+            return (Criteria) this;
628
+        }
629
+
630
+        public Criteria andHccrkTbsjLessThan(Date value) {
631
+            addCriterion("hccrk_tbsj <", value, "hccrkTbsj");
632
+            return (Criteria) this;
633
+        }
634
+
635
+        public Criteria andHccrkTbsjLessThanOrEqualTo(Date value) {
636
+            addCriterion("hccrk_tbsj <=", value, "hccrkTbsj");
637
+            return (Criteria) this;
638
+        }
639
+
640
+        public Criteria andHccrkTbsjIn(List<Date> values) {
641
+            addCriterion("hccrk_tbsj in", values, "hccrkTbsj");
642
+            return (Criteria) this;
643
+        }
644
+
645
+        public Criteria andHccrkTbsjNotIn(List<Date> values) {
646
+            addCriterion("hccrk_tbsj not in", values, "hccrkTbsj");
647
+            return (Criteria) this;
648
+        }
649
+
650
+        public Criteria andHccrkTbsjBetween(Date value1, Date value2) {
651
+            addCriterion("hccrk_tbsj between", value1, value2, "hccrkTbsj");
652
+            return (Criteria) this;
653
+        }
654
+
655
+        public Criteria andHccrkTbsjNotBetween(Date value1, Date value2) {
656
+            addCriterion("hccrk_tbsj not between", value1, value2, "hccrkTbsj");
657
+            return (Criteria) this;
658
+        }
659
+
660
+        public Criteria andUpdatetimeIsNull() {
661
+            addCriterion("updatetime is null");
662
+            return (Criteria) this;
663
+        }
664
+
665
+        public Criteria andUpdatetimeIsNotNull() {
666
+            addCriterion("updatetime is not null");
667
+            return (Criteria) this;
668
+        }
669
+
670
+        public Criteria andUpdatetimeEqualTo(Date value) {
671
+            addCriterion("updatetime =", value, "updatetime");
672
+            return (Criteria) this;
673
+        }
674
+
675
+        public Criteria andUpdatetimeNotEqualTo(Date value) {
676
+            addCriterion("updatetime <>", value, "updatetime");
677
+            return (Criteria) this;
678
+        }
679
+
680
+        public Criteria andUpdatetimeGreaterThan(Date value) {
681
+            addCriterion("updatetime >", value, "updatetime");
682
+            return (Criteria) this;
683
+        }
684
+
685
+        public Criteria andUpdatetimeGreaterThanOrEqualTo(Date value) {
686
+            addCriterion("updatetime >=", value, "updatetime");
687
+            return (Criteria) this;
688
+        }
689
+
690
+        public Criteria andUpdatetimeLessThan(Date value) {
691
+            addCriterion("updatetime <", value, "updatetime");
692
+            return (Criteria) this;
693
+        }
694
+
695
+        public Criteria andUpdatetimeLessThanOrEqualTo(Date value) {
696
+            addCriterion("updatetime <=", value, "updatetime");
697
+            return (Criteria) this;
698
+        }
699
+
700
+        public Criteria andUpdatetimeIn(List<Date> values) {
701
+            addCriterion("updatetime in", values, "updatetime");
702
+            return (Criteria) this;
703
+        }
704
+
705
+        public Criteria andUpdatetimeNotIn(List<Date> values) {
706
+            addCriterion("updatetime not in", values, "updatetime");
707
+            return (Criteria) this;
708
+        }
709
+
710
+        public Criteria andUpdatetimeBetween(Date value1, Date value2) {
711
+            addCriterion("updatetime between", value1, value2, "updatetime");
712
+            return (Criteria) this;
713
+        }
714
+
715
+        public Criteria andUpdatetimeNotBetween(Date value1, Date value2) {
716
+            addCriterion("updatetime not between", value1, value2, "updatetime");
717
+            return (Criteria) this;
718
+        }
719
+    }
720
+
721
+    /**
722
+     * business_agent_warehouse
723
+     */
724
+    public static class Criteria extends GeneratedCriteria {
725
+
726
+        protected Criteria() {
727
+            super();
728
+        }
729
+    }
730
+
731
+    /**
732
+     * business_agent_warehouse 2019-09-19
733
+     */
734
+    public static class Criterion {
735
+        private String condition;
736
+
737
+        private Object value;
738
+
739
+        private Object secondValue;
740
+
741
+        private boolean noValue;
742
+
743
+        private boolean singleValue;
744
+
745
+        private boolean betweenValue;
746
+
747
+        private boolean listValue;
748
+
749
+        private String typeHandler;
750
+
751
+        public String getCondition() {
752
+            return condition;
753
+        }
754
+
755
+        public Object getValue() {
756
+            return value;
757
+        }
758
+
759
+        public Object getSecondValue() {
760
+            return secondValue;
761
+        }
762
+
763
+        public boolean isNoValue() {
764
+            return noValue;
765
+        }
766
+
767
+        public boolean isSingleValue() {
768
+            return singleValue;
769
+        }
770
+
771
+        public boolean isBetweenValue() {
772
+            return betweenValue;
773
+        }
774
+
775
+        public boolean isListValue() {
776
+            return listValue;
777
+        }
778
+
779
+        public String getTypeHandler() {
780
+            return typeHandler;
781
+        }
782
+
783
+        protected Criterion(String condition) {
784
+            super();
785
+            this.condition = condition;
786
+            this.typeHandler = null;
787
+            this.noValue = true;
788
+        }
789
+
790
+        protected Criterion(String condition, Object value, String typeHandler) {
791
+            super();
792
+            this.condition = condition;
793
+            this.value = value;
794
+            this.typeHandler = typeHandler;
795
+            if (value instanceof List<?>) {
796
+                this.listValue = true;
797
+            } else {
798
+                this.singleValue = true;
799
+            }
800
+        }
801
+
802
+        protected Criterion(String condition, Object value) {
803
+            this(condition, value, null);
804
+        }
805
+
806
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
807
+            super();
808
+            this.condition = condition;
809
+            this.value = value;
810
+            this.secondValue = secondValue;
811
+            this.typeHandler = typeHandler;
812
+            this.betweenValue = true;
813
+        }
814
+
815
+        protected Criterion(String condition, Object value, Object secondValue) {
816
+            this(condition, value, secondValue, null);
817
+        }
818
+    }
819
+}

+ 54 - 0
src/main/java/com/chinaitop/depot/agent/basic/service/agentDepotService.java

@@ -0,0 +1,54 @@
1
+package com.chinaitop.depot.agent.basic.service;
2
+
3
+import com.chinaitop.depot.agent.basic.model.*;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepot;
5
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepotExample;
6
+
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+public interface agentDepotService {
11
+
12
+    /**
13
+     * 查询代储点信息记录
14
+     * @param map
15
+     * @return
16
+     */
17
+    List<BusinessAgentDepot> getAgentDepotList(BusinessAgentDepotExample map);
18
+
19
+    List<BusinessAgentDepot> getAgentList(Map<String, Object> map);
20
+
21
+    List<Map<String,Object>> getDepotLaoList(Map<String, Object> map);
22
+
23
+    List<Map<String,Object>> getDepot(Map<String, Object> map);
24
+
25
+    void add(BusinessAgentDepot user);
26
+
27
+    void update(BusinessAgentDepot user);
28
+
29
+    void updateByPrimaryKeySelective(BusinessAgentDepot user);
30
+
31
+    void updateDeleteById(Integer id,Integer delFlag);
32
+
33
+    BusinessAgentDepot findById(Integer id);
34
+
35
+    /**
36
+     * 查找所有粮库
37
+     * @param map
38
+     * @return
39
+     */
40
+    List<Map<String, Object>> getDepotList(Map<String, Object> map);
41
+
42
+    /**
43
+     * 导入
44
+     *
45
+     * @param list
46
+     * @param orgId
47
+     * @return
48
+     */
49
+    String importData(List<List<String>> list, Integer orgId);
50
+
51
+    List<Integer> getAgentHouseId(Integer orgId);
52
+    //查询是否已经存在库信息
53
+    List<BusinessAgentDepot> selectIdNum(BusinessAgentDepotExample example);
54
+}

+ 24 - 0
src/main/java/com/chinaitop/depot/agent/basic/service/agentPeopleService.java

@@ -0,0 +1,24 @@
1
+package com.chinaitop.depot.agent.basic.service;
2
+
3
+import com.chinaitop.depot.agent.basic.model.BusinessAgentPeople;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentPeopleExample;
5
+
6
+import java.util.List;
7
+
8
+public interface agentPeopleService {
9
+
10
+    /**
11
+     * 查询代储点信息记录
12
+     * @param map
13
+     * @return
14
+     */
15
+    List<BusinessAgentPeople> getAgentList(BusinessAgentPeopleExample map);
16
+
17
+    void add(BusinessAgentPeople user);
18
+
19
+    void update(BusinessAgentPeople user);
20
+
21
+    void updateDeleteById(Integer id);
22
+
23
+    BusinessAgentPeople findById(Integer id);
24
+}

+ 37 - 0
src/main/java/com/chinaitop/depot/agent/basic/service/agentService.java

@@ -0,0 +1,37 @@
1
+package com.chinaitop.depot.agent.basic.service;
2
+
3
+import com.chinaitop.depot.agent.basic.model.BusinessAgent;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentExample;
5
+
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+public interface agentService {
10
+
11
+    /**
12
+     * 查询代储点信息记录
13
+     * @param map
14
+     * @return
15
+     */
16
+    List<BusinessAgent> getAgentList(BusinessAgentExample map);
17
+
18
+    void add(BusinessAgent user);
19
+
20
+    void update(BusinessAgent user);
21
+
22
+    void updateDeleteById(Integer id);
23
+
24
+    BusinessAgent findById(Integer id);
25
+
26
+    /**
27
+     * 导入
28
+     *
29
+     * @param list
30
+     * @param orgId
31
+     * @return
32
+     */
33
+    String importData(List<List<String>> list, Integer orgId);
34
+
35
+    Map<String,Object> getNameId(Map<String,Object> map);
36
+
37
+}

+ 28 - 0
src/main/java/com/chinaitop/depot/agent/basic/service/agentStoreWareService.java

@@ -0,0 +1,28 @@
1
+package com.chinaitop.depot.agent.basic.service;
2
+
3
+
4
+
5
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse;
6
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouseExample;
7
+
8
+import java.util.List;
9
+import java.util.Map;
10
+
11
+public interface agentStoreWareService {
12
+
13
+	List<Map<String, Object>> getAgentStoreWare(Map<String, Object> map);
14
+
15
+	void addWareHouse(BusinessAgentWarehouse user);
16
+
17
+	List<Map<String, Object>> getWareList(Map<String, Object> map);
18
+
19
+	List<Map<String, Object>> getWare(Map<String, Object> map);
20
+
21
+	void removeAgentWare(Integer wareId,Integer delFlag);
22
+
23
+	List<BusinessAgentWarehouse> getWareDataList(BusinessAgentWarehouseExample example);
24
+
25
+	List<Integer> getAgentwareHouseId(Integer orgId);
26
+
27
+	Map<String, Object> getWarehouse(Integer unitId, Integer storehouseId);
28
+}

+ 31 - 0
src/main/java/com/chinaitop/depot/agent/basic/service/agentStorehouseService.java

@@ -0,0 +1,31 @@
1
+package com.chinaitop.depot.agent.basic.service;
2
+
3
+
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouse;
5
+import com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouseExample;
6
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse;
7
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouseExample;
8
+
9
+import java.util.List;
10
+import java.util.Map;
11
+
12
+public interface agentStorehouseService {
13
+
14
+	List<Map<String, Object>> getAgentStorehouse(Map<String, Object> map);
15
+
16
+	void updateStoreDeleteById(Integer id,Integer delFlag);
17
+
18
+	void add(BusinessAgentStorehouse user);
19
+
20
+	List<Map<String, Object>> getStorehouseList(Map<String, Object> map);
21
+
22
+	List<Map<String, Object>> getStoreList(Map<String, Object> map);
23
+
24
+	List<Map<String, Object>> getDepotToStoreList(Map<String, Object> map);
25
+
26
+	List<Map<String, Object>> getAgentStoreInfo(Map<String, Object> map);
27
+
28
+	List<Map<String, Object>> getStore(Map<String, Object> map);
29
+
30
+	List<BusinessAgentStorehouse> getStoreDataList(BusinessAgentStorehouseExample example);
31
+}

+ 33 - 0
src/main/java/com/chinaitop/depot/agent/basic/service/agentTankService.java

@@ -0,0 +1,33 @@
1
+package com.chinaitop.depot.agent.basic.service;
2
+
3
+import com.chinaitop.depot.agent.basic.model.BusinessAgentTank;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentTankExample;
5
+
6
+import java.util.List;
7
+
8
+public interface agentTankService {
9
+
10
+    /**
11
+     * 查询代储点信息记录
12
+     * @param map
13
+     * @return
14
+     */
15
+    List<BusinessAgentTank> getAgentList(BusinessAgentTankExample map);
16
+
17
+    void add(BusinessAgentTank user);
18
+
19
+    void update(BusinessAgentTank user);
20
+
21
+    void updateDeleteById(Integer id);
22
+
23
+    BusinessAgentTank findById(Integer id);
24
+
25
+    /**
26
+     * 导入
27
+     *
28
+     * @param list
29
+     * @param orgId
30
+     * @return
31
+     */
32
+    String importData(List<List<String>> list, Integer orgId);
33
+}

+ 218 - 0
src/main/java/com/chinaitop/depot/agent/basic/service/impl/AgentDepotServiceImpl.java

@@ -0,0 +1,218 @@
1
+package com.chinaitop.depot.agent.basic.service.impl;
2
+
3
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentDepotMapper;
4
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentMapper;
5
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentStorehouseMapper;
6
+import com.chinaitop.depot.agent.basic.model.*;
7
+import com.chinaitop.depot.agent.basic.service.agentDepotService;
8
+import com.chinaitop.utils.ParameterUtil;
9
+import com.github.pagehelper.PageHelper;
10
+import org.springframework.stereotype.Service;
11
+
12
+import javax.annotation.Resource;
13
+import java.util.Date;
14
+import java.util.List;
15
+import java.util.Map;
16
+
17
+@Service
18
+public class AgentDepotServiceImpl implements agentDepotService {
19
+
20
+    @Resource
21
+    private BusinessAgentDepotMapper BusinessAgentDepotMapper;
22
+
23
+    @Resource
24
+    private BusinessAgentMapper BusinessAgentMapper;
25
+
26
+    @Resource
27
+    private BusinessAgentStorehouseMapper businessAgentStorehouseMapper;
28
+
29
+    /**
30
+     * 查询仓储处作业记录
31
+     * * @param map
32
+     * @return
33
+     */
34
+    @Override
35
+    public List<BusinessAgentDepot> getAgentDepotList(BusinessAgentDepotExample map) {
36
+        return BusinessAgentDepotMapper.selectByExample(map);
37
+    }
38
+
39
+    @Override
40
+    public List<BusinessAgentDepot> getAgentList(Map<String, Object> map) {
41
+        return BusinessAgentDepotMapper.getByExample(map);
42
+    }
43
+
44
+    @Override
45
+    public List<Map<String,Object>> getDepotLaoList(Map<String, Object> map) {
46
+        return BusinessAgentDepotMapper.getDepotLaoList(map);
47
+    }
48
+
49
+    @Override
50
+    public List<Map<String, Object>> getDepotList(Map<String, Object> map) {
51
+        return BusinessAgentDepotMapper.getDepotList(map);
52
+    }
53
+
54
+    @Override
55
+    public void add(BusinessAgentDepot agent) {
56
+        BusinessAgentDepotMapper.insert(agent);
57
+    }
58
+
59
+    @Override
60
+    public void update(BusinessAgentDepot camera) {
61
+        BusinessAgentDepotMapper.updateByPrimaryKey(camera);
62
+    }
63
+
64
+    @Override
65
+    public void updateByPrimaryKeySelective(BusinessAgentDepot camera) {
66
+        BusinessAgentDepotMapper.updateByPrimaryKeySelective(camera);
67
+    }
68
+
69
+    @Override
70
+    public void updateDeleteById(Integer depotId,Integer delFlag) {
71
+        BusinessAgentDepot businessAgentDepot = new BusinessAgentDepot();
72
+        businessAgentDepot.setId(depotId);
73
+        businessAgentDepot.setDelFlag(delFlag);
74
+        BusinessAgentDepotMapper.updateByPrimaryKeySelective(businessAgentDepot);
75
+    }
76
+
77
+    @Override
78
+    public List<Map<String, Object>> getDepot(Map<String, Object> map) {
79
+        return BusinessAgentDepotMapper.getDepot(map);
80
+    }
81
+
82
+    @Override
83
+    public BusinessAgentDepot findById(Integer id) {
84
+        return BusinessAgentDepotMapper.selectByPrimaryKey(id);
85
+    }
86
+
87
+    @Override
88
+    public List<BusinessAgentDepot> selectIdNum(BusinessAgentDepotExample example) {
89
+        return BusinessAgentDepotMapper.selectByExample(example);
90
+    }
91
+
92
+    @Override
93
+    public String importData(List<List<String>> list, Integer orgId) {
94
+        Date date = new Date();
95
+        BusinessAgentDepot agent = null;
96
+
97
+        String msg = "";
98
+        int len = 0;
99
+
100
+        for (int i = 0; i < list.size(); i++) {
101
+            List<String> revList = list.get(i);
102
+
103
+            for (int j = 0; j < revList.size(); j++) {
104
+                switch(j) {
105
+                    case 0:
106
+                        //库点名称
107
+                        agent = new BusinessAgentDepot();
108
+                        if (revList.get(j) != null && !"".equals(revList.get(j))) {
109
+                            len = revList.get(j).length();
110
+                            if (len > 30) {
111
+                                msg = "第 "+(i+1)+" 行第 1 列的值的长度不能超过30!";
112
+                                return msg;
113
+                            }
114
+                            agent.setAgentDepotName(revList.get(j));
115
+                        }
116
+                        agent.setCreateTime(date);//修改时间
117
+                        agent.setOrgId(orgId);
118
+                        break;
119
+                    case 1:
120
+                        //代储点名称
121
+                        if (revList.get(j) != null && !"".equals(revList.get(j))) {
122
+
123
+                            BusinessAgentExample example = new BusinessAgentExample();
124
+                            BusinessAgentExample.Criteria criteria = example.createCriteria();
125
+                            criteria.andOrgIdEqualTo(orgId);
126
+                            criteria.andAgentNameEqualTo(revList.get(j));
127
+                            List<BusinessAgent> agentList = BusinessAgentMapper.selectByExample(example);
128
+                            if(agentList.size() == 0){
129
+                                msg = "第 "+(i+1)+" 行第 2 列的值的代储点相关信息没有找到,请确定是否有!";
130
+                                return msg;
131
+                            }
132
+
133
+                            agent.setAgentId(agentList.get(0).getId().toString());
134
+                        }
135
+                        break;
136
+                    case 2:
137
+                        //库点类别
138
+                        if (revList.get(j) != null && !"".equals(revList.get(j))) {
139
+                            len = revList.get(j).length();
140
+                            if (len > 30) {
141
+                                msg = "第 "+(i+1)+" 行第 3 列的值的长度不能超过30!";
142
+                                return msg;
143
+                            }
144
+                        }
145
+                        agent.setDepotType(revList.get(j));
146
+                        break;
147
+                    case 3:
148
+                        //设计仓容
149
+                        if (revList.get(j) != null && !"".equals(revList.get(j))) {
150
+                            len = revList.get(j).length();
151
+                            if (len > 30) {
152
+                                msg = "第 "+(i+1)+" 行第 4 列的值的长度不能超过30!";
153
+                                return msg;
154
+                            }
155
+                        }
156
+                        agent.setDesignStorage(revList.get(j));
157
+                        break;
158
+                    case 4:
159
+                        //地址
160
+                        len = revList.get(j).length();
161
+                        if (len > 20) {
162
+                            msg = "第 "+(i+1)+" 行第 5 列的值的长度不能超过20!";
163
+                            return msg;
164
+                        }
165
+                        agent.setAddress(revList.get(j));
166
+                        break;
167
+                    case 5:
168
+                        //电话
169
+                        len = revList.get(j).length();
170
+                        if (len > 20) {
171
+                            msg = "第 "+(i+1)+" 行第 6 列的值的长度不能超过20!";
172
+                            return msg;
173
+                        }
174
+                        agent.setPhone(revList.get(j));
175
+                        break;
176
+                    case 6:
177
+                        //经度
178
+                        len = revList.get(j).length();
179
+                        if (len > 20) {
180
+                            msg = "第 "+(i+1)+" 行第 7 列的值的长度不能超过20!";
181
+                            return msg;
182
+                        }
183
+                        agent.setLongitude(revList.get(j));
184
+                        break;
185
+                    case 7:
186
+                        //纬度
187
+                        len = revList.get(j).length();
188
+                        if (len > 20) {
189
+                            msg = "第 "+(i+1)+" 行第 8 列的值的长度不能超过20!";
190
+                            return msg;
191
+                        }
192
+                        agent.setLatitude(revList.get(j));
193
+                        break;
194
+                    case 8:
195
+                        //所属行政区划
196
+                        len = revList.get(j).length();
197
+                        if (len > 20) {
198
+                            msg = "第 "+(i+1)+" 行第 9 列的值的长度不能超过20!";
199
+                            return msg;
200
+                        }
201
+                        agent.setAdministrativeArea(revList.get(j));
202
+                        break;
203
+                    default :
204
+                        break;
205
+                }
206
+            }
207
+            agent.setDelFlag(1);
208
+            agent.setDepotId(0);
209
+            BusinessAgentDepotMapper.insert(agent);
210
+        }
211
+        return msg;
212
+    }
213
+
214
+    @Override
215
+    public List<Integer> getAgentHouseId(Integer orgId) {
216
+        return businessAgentStorehouseMapper.getAgentHouseId(orgId);
217
+    }
218
+}

+ 47 - 0
src/main/java/com/chinaitop/depot/agent/basic/service/impl/AgentPeopleServiceImpl.java

@@ -0,0 +1,47 @@
1
+package com.chinaitop.depot.agent.basic.service.impl;
2
+
3
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentPeopleMapper;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentPeople;
5
+import com.chinaitop.depot.agent.basic.model.BusinessAgentPeopleExample;
6
+import com.chinaitop.depot.agent.basic.service.agentPeopleService;
7
+import org.springframework.stereotype.Service;
8
+
9
+import javax.annotation.Resource;
10
+import java.util.List;
11
+
12
+@Service
13
+public class AgentPeopleServiceImpl implements agentPeopleService {
14
+
15
+    @Resource
16
+    private BusinessAgentPeopleMapper BusinessAgentPeopleMapper;
17
+
18
+    /**
19
+     * 查询仓储处作业记录
20
+     * * @param map
21
+     * @return
22
+     */
23
+    @Override
24
+    public List<BusinessAgentPeople> getAgentList(BusinessAgentPeopleExample map) {
25
+        return BusinessAgentPeopleMapper.selectByExample(map);
26
+    }
27
+
28
+    @Override
29
+    public void add(BusinessAgentPeople agent) {
30
+        BusinessAgentPeopleMapper.insert(agent);
31
+    }
32
+
33
+    @Override
34
+    public void update(BusinessAgentPeople camera) {
35
+        BusinessAgentPeopleMapper.updateByPrimaryKey(camera);
36
+    }
37
+
38
+    @Override
39
+    public void updateDeleteById(Integer agentId) {
40
+        BusinessAgentPeopleMapper.deleteByPrimaryKey(agentId);
41
+    }
42
+
43
+    @Override
44
+    public BusinessAgentPeople findById(Integer id) {
45
+        return BusinessAgentPeopleMapper.selectByPrimaryKey(id);
46
+    }
47
+}

+ 191 - 0
src/main/java/com/chinaitop/depot/agent/basic/service/impl/AgentServiceImpl.java

@@ -0,0 +1,191 @@
1
+package com.chinaitop.depot.agent.basic.service.impl;
2
+
3
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentMapper;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgent;
5
+import com.chinaitop.depot.agent.basic.model.BusinessAgentExample;
6
+import com.chinaitop.depot.agent.basic.service.agentService;
7
+import org.springframework.stereotype.Service;
8
+
9
+import javax.annotation.Resource;
10
+import java.util.Date;
11
+import java.util.List;
12
+import java.util.Map;
13
+
14
+@Service
15
+public class AgentServiceImpl implements agentService {
16
+
17
+    @Resource
18
+    private BusinessAgentMapper BusinessAgentMapper;
19
+
20
+    /**
21
+     * 查询仓储处作业记录
22
+     * * @param map
23
+     * @return
24
+     */
25
+    @Override
26
+    public List<BusinessAgent> getAgentList(BusinessAgentExample map) {
27
+        return BusinessAgentMapper.selectByExample(map);
28
+    }
29
+
30
+    @Override
31
+    public void add(BusinessAgent agent) {
32
+        BusinessAgentMapper.insert(agent);
33
+    }
34
+
35
+    @Override
36
+    public void update(BusinessAgent camera) {
37
+        BusinessAgentMapper.updateByPrimaryKey(camera);
38
+    }
39
+
40
+    @Override
41
+    public void updateDeleteById(Integer agentId) {
42
+        BusinessAgent businessAgent = new BusinessAgent();
43
+        businessAgent.setId(agentId);
44
+        businessAgent.setDelFlag(2);
45
+        BusinessAgentMapper.updateByPrimaryKeySelective(businessAgent);
46
+    }
47
+
48
+    @Override
49
+    public BusinessAgent findById(Integer id) {
50
+        return BusinessAgentMapper.selectByPrimaryKey(id);
51
+    }
52
+
53
+    @Override
54
+    public Map<String,Object> getNameId(Map<String,Object> map) {
55
+        return BusinessAgentMapper.getNameId(map);
56
+    }
57
+
58
+    @Override
59
+    public String importData(List<List<String>> list, Integer orgId) {
60
+        Date date = new Date();
61
+        BusinessAgent agent = null;
62
+
63
+        String msg = "";
64
+        int len = 0;
65
+
66
+        for (int i = 0; i < list.size(); i++) {
67
+            List<String> revList = list.get(i);
68
+
69
+            for (int j = 0; j < revList.size(); j++) {
70
+                switch(j) {
71
+                    case 0:
72
+                        //代储点名称
73
+                        agent = new BusinessAgent();
74
+                        if (revList.get(j) != null && !"".equals(revList.get(j))) {
75
+                            len = revList.get(j).length();
76
+                            if (len > 30) {
77
+                                msg = "第 "+(i+1)+" 行第 1 列的值的长度不能超过30!";
78
+                                return msg;
79
+                            }
80
+                            agent.setAgentName(revList.get(j));
81
+                        }
82
+                        agent.setCreateTime(date);//修改时间
83
+                        agent.setOrgId(orgId);
84
+                        break;
85
+                    case 1:
86
+                        //法定代表人
87
+                        if (revList.get(j) != null && !"".equals(revList.get(j))) {
88
+                            len = revList.get(j).length();
89
+                            if (len > 30) {
90
+                                msg = "第 "+(i+1)+" 行第 2 列的值的长度不能超过30!";
91
+                                return msg;
92
+                            }
93
+                        }
94
+                        agent.setLegalPerson(revList.get(j));
95
+                        break;
96
+                    case 2:
97
+                        //统一社会信用代码
98
+                        if (revList.get(j) != null && !"".equals(revList.get(j))) {
99
+                            len = revList.get(j).length();
100
+                            if (len > 30) {
101
+                                msg = "第 "+(i+1)+" 行第 3 列的值的长度不能超过30!";
102
+                                return msg;
103
+                            }
104
+                        }
105
+                        agent.setCreditCode(revList.get(j));
106
+                        break;
107
+                    case 3:
108
+                        //代储点性质
109
+                        len = revList.get(j).length();
110
+                        if (len > 20) {
111
+                            msg = "第 "+(i+1)+" 行第 4 列的值的长度不能超过20!";
112
+                            return msg;
113
+                        }
114
+                        agent.setAgentNature(revList.get(j));
115
+                        break;
116
+                    case 4:
117
+                        //代储点类型
118
+                        len = revList.get(j).length();
119
+                        if (len > 20) {
120
+                            msg = "第 "+(i+1)+" 行第 5 列的值的长度不能超过20!";
121
+                            return msg;
122
+                        }
123
+                        agent.setAgentType(revList.get(j));
124
+                        break;
125
+                    case 5:
126
+                        //仓容
127
+                        len = revList.get(j).length();
128
+                        if (len > 20) {
129
+                            msg = "第 "+(i+1)+" 行第 5 列的值的长度不能超过20!";
130
+                            return msg;
131
+                        }
132
+                        agent.setCapacity(revList.get(j));
133
+                        break;
134
+                    case 6:
135
+                        //人员
136
+                        len = revList.get(j).length();
137
+                        if (len > 20) {
138
+                            msg = "第 "+(i+1)+" 行第 5 列的值的长度不能超过20!";
139
+                            return msg;
140
+                        }
141
+                        agent.setPerson(revList.get(j));
142
+                        break;
143
+                    case 7:
144
+                        //信用
145
+                        len = revList.get(j).length();
146
+                        if (len > 20) {
147
+                            msg = "第 "+(i+1)+" 行第 5 列的值的长度不能超过20!";
148
+                            return msg;
149
+                        }
150
+                        agent.setCredit(revList.get(j));
151
+                        break;
152
+                    case 8:
153
+                        //经度
154
+                        len = revList.get(j).length();
155
+                        if (len > 100) {
156
+                            msg = "第 "+(i+1)+" 行第 5 列的值的长度不能超过100!";
157
+                            return msg;
158
+                        }
159
+                        agent.setLongitude(revList.get(j));
160
+                        break;
161
+                    case 9:
162
+                        //维度
163
+                        len = revList.get(j).length();
164
+                        if (len > 100) {
165
+                            msg = "第 "+(i+1)+" 行第 5 列的值的长度不能超过100!";
166
+                            return msg;
167
+                        }
168
+                        agent.setLatitude(revList.get(j));
169
+                        break;
170
+                    case 10:
171
+                        //所属行政区划
172
+                        if (revList.get(j) != null && !"".equals(revList.get(j))) {
173
+                            len = revList.get(j).length();
174
+                            if (len > 50) {
175
+                                msg = "第 "+(i+1)+" 行第 11 列的值的长度不能超过50!";
176
+                                return msg;
177
+                            }
178
+                        }
179
+                        agent.setAdministrativeArea(revList.get(j));
180
+                        break;
181
+                    default :
182
+                        break;
183
+                }
184
+
185
+            }
186
+            agent.setDelFlag(1);
187
+            BusinessAgentMapper.insert(agent);
188
+        }
189
+        return msg;
190
+    }
191
+}

+ 86 - 0
src/main/java/com/chinaitop/depot/agent/basic/service/impl/AgentStoreWareServiceImpl.java

@@ -0,0 +1,86 @@
1
+package com.chinaitop.depot.agent.basic.service.impl;
2
+
3
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentWarehouseMapper;
4
+import com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouse;
5
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse;
6
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouseExample;
7
+import com.chinaitop.depot.agent.basic.service.agentStoreWareService;
8
+
9
+import com.chinaitop.utils.ParameterUtil;
10
+import org.springframework.stereotype.Service;
11
+
12
+import java.util.ArrayList;
13
+import java.util.HashMap;
14
+import java.util.List;
15
+import java.util.Map;
16
+
17
+import javax.annotation.Resource;
18
+
19
+
20
+@Service
21
+public class AgentStoreWareServiceImpl implements agentStoreWareService {
22
+
23
+    @Resource
24
+    private BusinessAgentWarehouseMapper businessAgentWarehouseMapper;
25
+
26
+    //
27
+	@Override
28
+	public List<Map<String, Object>> getAgentStoreWare(Map<String, Object> map) {
29
+		// TODO Auto-generated method stub
30
+		return businessAgentWarehouseMapper.getAgentStoreWare(map);
31
+	}
32
+
33
+	@Override
34
+	public void addWareHouse(BusinessAgentWarehouse warehouse) {
35
+		businessAgentWarehouseMapper.insert(warehouse);
36
+	}
37
+
38
+	@Override
39
+	public List<Map<String, Object>> getWareList(Map<String, Object> map) {
40
+		return businessAgentWarehouseMapper.getWareList(map);
41
+	}
42
+
43
+	@Override
44
+	public List<Map<String, Object>> getWare(Map<String, Object> map) {
45
+		return businessAgentWarehouseMapper.getWare(map);
46
+	}
47
+
48
+	@Override
49
+	public void removeAgentWare(Integer wareId,Integer delFlag) {
50
+		BusinessAgentWarehouse businessAgentWarehouse = new BusinessAgentWarehouse();
51
+		businessAgentWarehouse.setId(wareId);
52
+		businessAgentWarehouse.setDelFlag(delFlag);
53
+		businessAgentWarehouseMapper.updateByPrimaryKeySelective(businessAgentWarehouse);
54
+	}
55
+
56
+	@Override
57
+	public List<BusinessAgentWarehouse> getWareDataList(BusinessAgentWarehouseExample example) {
58
+		return businessAgentWarehouseMapper.selectByExample(example);
59
+	}
60
+
61
+	@Override
62
+	public List<Integer> getAgentwareHouseId(Integer orgId) {
63
+		// TODO Auto-generated method stub
64
+		return businessAgentWarehouseMapper.getAgentwareHouseId(orgId);
65
+	}
66
+
67
+	@Override
68
+	public Map<String, Object> getWarehouse(Integer unitId, Integer storehouseId) {
69
+		Map<String, Object> mapData = new HashMap<String, Object>();
70
+
71
+		Map<String,Object> map = new HashMap<>();
72
+		if(ParameterUtil.isnotnull(unitId)){
73
+			map.put("orgId",unitId);
74
+		}
75
+		if(ParameterUtil.isnotnull(storehouseId)){
76
+			map.put("storehouseId",storehouseId);
77
+		}
78
+
79
+		List<Map<String, Object>> list = businessAgentWarehouseMapper.getWarehouse(map); //获取库点下的某个仓房中的的货位
80
+		//处理驼峰命名大写问题
81
+		List<Map<String, Object>> listDatas = ParameterUtil.slashCapitals(list);
82
+		mapData.put("wareList", listDatas); //货位下拉列表集合
83
+
84
+		return mapData;
85
+	}
86
+}

+ 76 - 0
src/main/java/com/chinaitop/depot/agent/basic/service/impl/AgentStorehouseServiceImpl.java

@@ -0,0 +1,76 @@
1
+package com.chinaitop.depot.agent.basic.service.impl;
2
+
3
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentStorehouseMapper;
4
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentWarehouseMapper;
5
+import com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouse;
6
+import com.chinaitop.depot.agent.basic.model.BusinessAgentStorehouseExample;
7
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse;
8
+import com.chinaitop.depot.agent.basic.service.agentStorehouseService;
9
+
10
+import org.springframework.stereotype.Service;
11
+
12
+import java.util.List;
13
+import java.util.Map;
14
+
15
+import javax.annotation.Resource;
16
+
17
+
18
+@Service
19
+public class AgentStorehouseServiceImpl implements agentStorehouseService {
20
+
21
+    @Resource
22
+    private BusinessAgentStorehouseMapper businessAgentStorehouseMapper;
23
+
24
+    @Resource
25
+    private BusinessAgentWarehouseMapper businessAgentWarehouseMapper;
26
+
27
+    
28
+    //获取仓房信息
29
+	@Override
30
+	public List<Map<String, Object>> getAgentStorehouse(Map<String, Object> map) {
31
+		// TODO Auto-generated method stub
32
+		return businessAgentStorehouseMapper.getAgentStorehouse(map);
33
+	}
34
+
35
+	public void updateStoreDeleteById(Integer storeId,Integer delFlag) {
36
+		BusinessAgentStorehouse businessAgentStorehouse = new BusinessAgentStorehouse();
37
+		businessAgentStorehouse.setId(storeId);
38
+		businessAgentStorehouse.setDelFlag(delFlag);
39
+		businessAgentStorehouseMapper.updateByPrimaryKeySelective(businessAgentStorehouse);
40
+	}
41
+
42
+	@Override
43
+	public void add(BusinessAgentStorehouse storehouse) {
44
+		businessAgentStorehouseMapper.insert(storehouse);
45
+	}
46
+
47
+	@Override
48
+	public List<Map<String, Object>> getStorehouseList(Map<String, Object> map) {
49
+		return businessAgentStorehouseMapper.getStorehouseList(map);
50
+	}
51
+
52
+	@Override
53
+	public List<Map<String, Object>> getStoreList(Map<String, Object> map) {
54
+		return businessAgentStorehouseMapper.getStoreList(map);
55
+	}
56
+
57
+	@Override
58
+	public List<Map<String, Object>> getAgentStoreInfo(Map<String, Object> map) {
59
+		return businessAgentStorehouseMapper.getAgentStoreInfo(map);
60
+	}
61
+
62
+	@Override
63
+	public List<Map<String, Object>> getDepotToStoreList(Map<String, Object> map) {
64
+		return businessAgentStorehouseMapper.getDepotToStoreList(map);
65
+	}
66
+
67
+	@Override
68
+	public List<Map<String, Object>> getStore(Map<String, Object> map) {
69
+		return businessAgentStorehouseMapper.getStore(map);
70
+	}
71
+
72
+	@Override
73
+	public List<BusinessAgentStorehouse> getStoreDataList(BusinessAgentStorehouseExample example) {
74
+		return businessAgentStorehouseMapper.selectByExample(example);
75
+	}
76
+}

+ 188 - 0
src/main/java/com/chinaitop/depot/agent/basic/service/impl/AgentTankServiceImpl.java

@@ -0,0 +1,188 @@
1
+package com.chinaitop.depot.agent.basic.service.impl;
2
+
3
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentDepotMapper;
4
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentTankMapper;
5
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepot;
6
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepotExample;
7
+import com.chinaitop.depot.agent.basic.model.BusinessAgentTank;
8
+import com.chinaitop.depot.agent.basic.model.BusinessAgentTankExample;
9
+import com.chinaitop.depot.agent.basic.service.agentTankService;
10
+import org.springframework.stereotype.Service;
11
+
12
+import javax.annotation.Resource;
13
+import java.util.Date;
14
+import java.util.List;
15
+
16
+@Service
17
+public class AgentTankServiceImpl implements agentTankService {
18
+
19
+    @Resource
20
+    private BusinessAgentTankMapper BusinessAgentTankMapper;
21
+
22
+    @Resource
23
+    private BusinessAgentDepotMapper BusinessAgentDepotMapper;
24
+
25
+    /**
26
+     * 查询仓储处作业记录
27
+     * * @param map
28
+     * @return
29
+     */
30
+    @Override
31
+    public List<BusinessAgentTank> getAgentList(BusinessAgentTankExample map) {
32
+        return BusinessAgentTankMapper.selectByExample(map);
33
+    }
34
+
35
+    @Override
36
+    public void add(BusinessAgentTank agent) {
37
+        BusinessAgentTankMapper.insert(agent);
38
+    }
39
+
40
+    @Override
41
+    public void update(BusinessAgentTank camera) {
42
+        BusinessAgentTankMapper.updateByPrimaryKey(camera);
43
+    }
44
+
45
+    @Override
46
+    public void updateDeleteById(Integer agentId) {
47
+        BusinessAgentTankMapper.deleteByPrimaryKey(agentId);
48
+    }
49
+
50
+    @Override
51
+    public BusinessAgentTank findById(Integer id) {
52
+        return BusinessAgentTankMapper.selectByPrimaryKey(id);
53
+    }
54
+
55
+    @Override
56
+    public String importData(List<List<String>> list, Integer orgId) {
57
+        Date date = new Date();
58
+        BusinessAgentTank agent = null;
59
+
60
+        String msg = "";
61
+        int len = 0;
62
+
63
+        for (int i = 0; i < list.size(); i++) {
64
+            List<String> revList = list.get(i);
65
+
66
+            for (int j = 0; j < revList.size(); j++) {
67
+                switch(j) {
68
+                    case 0:
69
+                        //粮库名称
70
+                        agent = new BusinessAgentTank();
71
+                        if (revList.get(j) != null && !"".equals(revList.get(j))) {
72
+
73
+                            //根据粮库名称查询出来相关的粮库id
74
+                            BusinessAgentDepotExample example = new BusinessAgentDepotExample();
75
+                            BusinessAgentDepotExample.Criteria criteria = example.createCriteria();
76
+                            criteria.andOrgIdEqualTo(orgId);
77
+                            criteria.andDelFlagEqualTo(1);//未删除
78
+                            criteria.andAgentDepotNameEqualTo(revList.get(j));
79
+                            List<BusinessAgentDepot> agentList = BusinessAgentDepotMapper.selectByExample(example);
80
+                            if(agentList.size() == 0){
81
+                                msg = "第 "+(i+1)+" 行第 1 列的值的粮库相关信息没有找到,请确定是否有!";
82
+                                return msg;
83
+                            }
84
+
85
+                            agent.setDepotId(agentList.get(0).getId());
86
+                        }
87
+                        break;
88
+                    case 1:
89
+                        //油罐编号
90
+                        if (revList.get(j) != null && !"".equals(revList.get(j))) {
91
+                            len = revList.get(j).length();
92
+                            if (len > 30) {
93
+                                msg = "第 "+(i+1)+" 行第 2 列的值的长度不能超过30!";
94
+                                return msg;
95
+                            }
96
+                            agent.setTankNumber(revList.get(j));
97
+                        }
98
+                        agent.setCreateTime(date);//修改时间
99
+                        agent.setOrgId(orgId);
100
+                        break;
101
+                    case 2:
102
+                        //设计容量
103
+                        if (revList.get(j) != null && !"".equals(revList.get(j))) {
104
+                            len = revList.get(j).length();
105
+                            if (len > 30) {
106
+                                msg = "第 "+(i+1)+" 行第 3 列的值的长度不能超过30!";
107
+                                return msg;
108
+                            }
109
+                        }
110
+                        agent.setDesignStorage(revList.get(j));
111
+                        break;
112
+                    case 3:
113
+                        //设计年限
114
+                        if (revList.get(j) != null && !"".equals(revList.get(j))) {
115
+                            len = revList.get(j).length();
116
+                            if (len > 30) {
117
+                                msg = "第 "+(i+1)+" 行第 4 列的值的长度不能超过30!";
118
+                                return msg;
119
+                            }
120
+                        }
121
+                        agent.setDesignYear(revList.get(j));
122
+                        break;
123
+                    case 4:
124
+                        //是否国债投资
125
+                        String sf = revList.get(j);
126
+                        if ("是".equals(sf) || "是" == sf) {
127
+                            agent.setTreasuryBonds("true");
128
+                        }else{
129
+                            agent.setTreasuryBonds("false");
130
+                        }
131
+                        break;
132
+                    case 5:
133
+                        //启用日期
134
+                        len = revList.get(j).length();
135
+                        if (len > 20) {
136
+                            msg = "第 "+(i+1)+" 行第 6 列的值的长度不能超过20!";
137
+                            return msg;
138
+                        }
139
+                        agent.setEnableDate(revList.get(j));
140
+                        break;
141
+                    case 6:
142
+                        //当前状态
143
+                        switch(revList.get(j)) {
144
+                            case "完好":
145
+                                agent.setState("3011");
146
+                                break;
147
+                            case "需小修":
148
+                                agent.setState("3012");
149
+                                break;
150
+                            case "需大修":
151
+                                agent.setState("3013");
152
+                                break;
153
+                            case "待报废":
154
+                                agent.setState("3014");
155
+                                break;
156
+                            case "待拆除":
157
+                                agent.setState("3015");
158
+                                break;
159
+                            case "死角仓":
160
+                                agent.setState("3016");
161
+                                break;
162
+                            case "其他":
163
+                                agent.setState("3017");
164
+                                break;
165
+                            default:
166
+                                msg = "第 "+(i+1)+" 行第 7 列的值并没有在项目中存在请查询后再导入!";
167
+                                return msg;
168
+                        }
169
+                        break;
170
+                    case 7:
171
+                        //责任保管员
172
+                        len = revList.get(j).length();
173
+                        if (len > 20) {
174
+                            msg = "第 "+(i+1)+" 行第 8 列的值的长度不能超过20!";
175
+                            return msg;
176
+                        }
177
+                        agent.setKeeper(revList.get(j));
178
+                        break;
179
+                    default :
180
+                        break;
181
+                }
182
+
183
+            }
184
+            BusinessAgentTankMapper.insert(agent);
185
+        }
186
+        return msg;
187
+    }
188
+}

+ 295 - 0
src/main/java/com/chinaitop/depot/agent/bgz/controller/BusinessAgentBgmxzController.java

@@ -0,0 +1,295 @@
1
+package com.chinaitop.depot.agent.bgz.controller;
2
+
3
+import java.math.BigDecimal;
4
+import java.util.Date;
5
+import java.util.HashMap;
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+import javax.annotation.Resource;
10
+
11
+import org.springframework.http.MediaType;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RequestMethod;
14
+import org.springframework.web.bind.annotation.RestController;
15
+
16
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepot;
17
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxz;
18
+import com.chinaitop.depot.agent.bgz.service.BusinessAgentBgmxzService;
19
+import com.chinaitop.utils.ParameterUtil;
20
+import com.fasterxml.jackson.databind.ObjectMapper;
21
+import com.github.pagehelper.PageHelper;
22
+import com.github.pagehelper.PageInfo;
23
+
24
+import io.swagger.annotations.Api;
25
+import io.swagger.annotations.ApiImplicitParam;
26
+import io.swagger.annotations.ApiImplicitParams;
27
+import io.swagger.annotations.ApiOperation;
28
+import net.sf.json.JSONArray;
29
+import net.sf.json.JSONObject;
30
+
31
+@RestController
32
+@RequestMapping(value = "/agent_bgmxz")
33
+@Api(description = "代储库保管明细账控制类")
34
+public class BusinessAgentBgmxzController {
35
+
36
+	@Resource
37
+	private BusinessAgentBgmxzService bgmxzService;
38
+
39
+	@RequestMapping(value = "/getList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
40
+    @ApiOperation(value="代储库保管明细账信息列表", notes = "代储库保管明细账信息列表")
41
+    @ApiImplicitParams({
42
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
43
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
44
+            @ApiImplicitParam(name = "agentId", value = "代储点ID", paramType = "query"),
45
+            @ApiImplicitParam(name = "szlkOrgId", value = "代储库ID", paramType = "query"),
46
+            @ApiImplicitParam(name = "houseId", value = "代储库仓房ID", paramType = "query"),
47
+            @ApiImplicitParam(name = "wareId", value = "代储库货位id", paramType = "query"),
48
+            @ApiImplicitParam(name = "fssj", value = "业务发生时间", paramType = "query"),
49
+            @ApiImplicitParam(name = "orgId", value = "单位ID", paramType = "query")
50
+    })
51
+	public PageInfo<BusinessAgentBgmxz> list(Integer pageNum, Integer pageSize, Integer agentId, Integer szlkOrgId,
52
+			Integer houseId, Integer wareId, String fssj, Integer orgId) {
53
+		Map<String, Object> param_map = new HashMap<String, Object>();
54
+		/* 代储点ID */
55
+		if(ParameterUtil.isnotnull(agentId)){
56
+			param_map.put("agent_id", agentId);
57
+		}
58
+		/* 代储库ID */
59
+		if(ParameterUtil.isnotnull(szlkOrgId)){
60
+			param_map.put("szlk_org_id", szlkOrgId);
61
+		}
62
+		/* 仓房ID */
63
+		if(ParameterUtil.isnotnull(houseId)){
64
+			param_map.put("house_id", houseId);
65
+		}
66
+		/* 货位ID */
67
+		if(ParameterUtil.isnotnull(wareId)){
68
+			param_map.put("ware_id", wareId);
69
+		}
70
+		/* 业务发生时间 */
71
+		if(ParameterUtil.isnotnull(fssj)){
72
+			Date startTime = ParameterUtil.string2datetime(fssj+" 00:00:00");
73
+			Date endTime = ParameterUtil.string2datetime(fssj+" 23:59:59");
74
+			param_map.put("fssj", fssj);
75
+			param_map.put("start_time", startTime);
76
+			param_map.put("end_time", endTime);
77
+		}
78
+		if (ParameterUtil.isnotnull(orgId)) {
79
+			param_map.put("org_id", orgId);
80
+		}
81
+
82
+		/* 分页 */
83
+		if(ParameterUtil.isnotnull(pageNum) && ParameterUtil.isnotnull(pageSize)){
84
+			PageHelper.startPage(pageNum, pageSize);
85
+		}
86
+		List<BusinessAgentBgmxz> list = bgmxzService.findByConditions(param_map);
87
+		PageInfo<BusinessAgentBgmxz> pageInfo = new PageInfo<BusinessAgentBgmxz>(list);
88
+		
89
+		return pageInfo;
90
+	}
91
+
92
+	@RequestMapping(value = "/findByMxbgz", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
93
+    @ApiOperation(value="查看代储库保管明细账信息", notes = "查看代储库保管明细账信息")
94
+    @ApiImplicitParams({
95
+            @ApiImplicitParam(name = "id", value = "数据ID", paramType = "query")
96
+    })
97
+	public BusinessAgentBgmxz findByMxbgz(Integer id) {
98
+		BusinessAgentBgmxz bgmxz = null;
99
+		if (null != id) {
100
+			bgmxz = bgmxzService.findByParmaryKey(id);
101
+		} else {
102
+			bgmxz = new BusinessAgentBgmxz();
103
+		}
104
+		return bgmxz;
105
+	}
106
+
107
+	@RequestMapping(value = "/edit", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
108
+    @ApiOperation(value="新增或修改代储库保管明细账信息", notes = "新增或修改代储库保管明细账信息")
109
+    @ApiImplicitParams({
110
+            @ApiImplicitParam(name = "bgmxzJson", value = "数据对象", paramType = "form")
111
+    })
112
+	public Map<String, Object> edit(String bgmxzJson) {
113
+		Map<String, Object> modelMap = new HashMap<String, Object>();
114
+		// JSON字符串转对象
115
+		ObjectMapper mapper = new ObjectMapper();
116
+		try {
117
+			BusinessAgentBgmxz bgmxz = (BusinessAgentBgmxz) mapper.readValue(bgmxzJson, BusinessAgentBgmxz.class);
118
+			if (bgmxz.getId() != null) {
119
+				bgmxzService.update(bgmxz);
120
+			} else {
121
+				bgmxzService.insert(bgmxz);
122
+			}
123
+			modelMap.put("status", "success");
124
+			modelMap.put("msg", "操作成功!");
125
+		} catch (Exception e) {
126
+			e.printStackTrace();
127
+			modelMap.put("status", "error");
128
+			modelMap.put("msg", "操作失败!");
129
+		}
130
+		return modelMap;
131
+	}
132
+
133
+	@RequestMapping(value = "/remove", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
134
+    @ApiOperation(value="新增或修改代储库保管明细账信息", notes = "新增或修改代储库保管明细账信息")
135
+    @ApiImplicitParams({
136
+            @ApiImplicitParam(name = "id", value = "数据ID", paramType = "form")
137
+    })
138
+	public Map<String, Object> remove(Integer id) {
139
+		Map<String, Object> modelMap = new HashMap<String, Object>();
140
+		try {
141
+			if (null != id) {
142
+				bgmxzService.remove(id);
143
+				modelMap.put("status", "success");
144
+				modelMap.put("msg", "操作成功!");
145
+			}
146
+		} catch (Exception e) {
147
+			e.printStackTrace();
148
+			modelMap.put("status", "error");
149
+			modelMap.put("msg", "操作失败!");
150
+		}
151
+		return modelMap;
152
+	}
153
+	
154
+	@RequestMapping(value="/getFcbgzList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
155
+	@ApiOperation(value="分仓保管列表,按天统计", notes = "分仓保管列表,按天统计,支持分页")
156
+	@ApiImplicitParams({
157
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
158
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
159
+		@ApiImplicitParam(name="bgmxzJson", value="数据对象", paramType="query")
160
+	})
161
+	public PageInfo<Map<String, Object>> getFcbgzList(Integer pageNum, Integer pageSize, String bgmxzJson) {
162
+
163
+		Map<String, Object> paramMap = new HashMap<String, Object>();
164
+		ObjectMapper mapper = new ObjectMapper();
165
+		BusinessAgentBgmxz bgmxz = null;
166
+		try {
167
+			bgmxz = (BusinessAgentBgmxz) mapper.readValue(bgmxzJson, BusinessAgentBgmxz.class);
168
+		} catch (Exception e) {
169
+			e.printStackTrace();
170
+		}
171
+		if(ParameterUtil.isnotnull(bgmxz.getOrgId())){
172
+			paramMap.put("orgId", bgmxz.getOrgId());
173
+		}
174
+		if(ParameterUtil.isnotnull(bgmxz.getAgentId())){
175
+			paramMap.put("agentId", bgmxz.getAgentId());
176
+		}
177
+		if(ParameterUtil.isnotnull(bgmxz.getSzlkOrgId())){
178
+			paramMap.put("szlkOrgId", bgmxz.getSzlkOrgId());
179
+		}
180
+		if(ParameterUtil.isnotnull(bgmxz.getHouseId())){
181
+			paramMap.put("houseId", bgmxz.getHouseId());
182
+		}
183
+		if(ParameterUtil.isnotnull(bgmxz.getWareId())){
184
+			paramMap.put("wareId", bgmxz.getWareId());
185
+		}
186
+		if(ParameterUtil.isnotnull(bgmxz.getLspz())){
187
+			paramMap.put("lspz", bgmxz.getLspz());
188
+		}
189
+		if(ParameterUtil.isnotnull(bgmxz.getLsxz())){
190
+			paramMap.put("lsxz", bgmxz.getLsxz());
191
+		}
192
+		if(ParameterUtil.isnotnull(bgmxz.getFssj())){
193
+			paramMap.put("fssj", bgmxz.getFssj());
194
+		}
195
+		/* 分页 */
196
+		if(ParameterUtil.isnotnull(pageNum) && ParameterUtil.isnotnull(pageSize)){
197
+			PageHelper.startPage(pageNum, pageSize);
198
+		}
199
+
200
+		List<Map<String, Object>> list = bgmxzService.selectFcbgzGroupBy(paramMap);
201
+		
202
+		PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(list);
203
+		list = pageInfo.getList();
204
+		if (null != list && list.size() > 0) {
205
+			Map<String, Object> detail_map = new HashMap<String, Object>();
206
+			for (Map<String, Object> map : list) {
207
+				String fssj = map.get("fssj")+"";
208
+				map.put("fssj", fssj.substring(0, 10));
209
+				detail_map = bgmxzService.selectDetail(map);
210
+				if (null != detail_map) {
211
+					map.put("agent_name", detail_map.get("agent_name"));
212
+					map.put("agent_depot_name", detail_map.get("agent_depot_name"));
213
+					map.put("house_name", detail_map.get("house_name"));
214
+					map.put("ware_name", detail_map.get("ware_name"));
215
+					map.put("kcsl", detail_map.get("kcsl"));
216
+				}
217
+			}
218
+			list = ParameterUtil.slashCapitals(list);
219
+			pageInfo.setList(list);
220
+		}
221
+		return pageInfo;
222
+	}
223
+
224
+	@RequestMapping(value="/selectAgentHouseWareList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
225
+	@ApiOperation(value="查询代储库正常使用的货位数据信息", notes = "查询代储库正常使用的货位数据信息")
226
+	@ApiImplicitParams({
227
+		@ApiImplicitParam(name="orgId", value="当前单位ID", paramType="query")
228
+	})
229
+	public List<Map<String, Object>> selectAgentHouseWareList(Integer orgId) {
230
+
231
+		Map<String, Object> paramMap = new HashMap<String, Object>();
232
+
233
+		paramMap.put("orgId", orgId);
234
+		List<Map<String, Object>> list = bgmxzService.selectAgentHouseWareList(paramMap);
235
+
236
+		return list;
237
+	}
238
+	
239
+	@RequestMapping(value="/addCrkFcbgzData", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
240
+	@ApiOperation(value="把出入库拿来的分仓保管账数据插入到代储库业务的分仓保管账表 中", notes = "把出入库拿来的分仓保管账数据插入到代储库业务的分仓保管账表 中")
241
+	@ApiImplicitParams({
242
+		@ApiImplicitParam(name="fcbgzData", value="出入库分仓保管账数据", paramType="form"),
243
+		@ApiImplicitParam(name="orgId", value="当前单位ID", paramType="form"),
244
+		@ApiImplicitParam(name="realName", value="当前操作人", paramType="form")
245
+	})
246
+	public Map<String, Object> addCrkFcbgzData(String fcbgzData, Integer orgId, String realName) {
247
+
248
+		Map<String, Object> map = new HashMap<String, Object>();
249
+
250
+		try {
251
+			JSONArray json = JSONArray.fromObject(fcbgzData);
252
+			if (json.size() > 0) {
253
+				BusinessAgentBgmxz bgmxz = null;
254
+				for (int i = 0; i < json.size(); i++) {
255
+					bgmxz = new BusinessAgentBgmxz();
256
+					JSONObject job = json.getJSONObject(i);
257
+					bgmxz.setOrgId(orgId);
258
+					Integer dckId = Integer.parseInt(job.get("unitid")+"");
259
+					BusinessAgentDepot businessAgentDepot = bgmxzService.selectAgentDepotObj(orgId, dckId);
260
+					bgmxz.setAgentId(Integer.parseInt(businessAgentDepot.getAgentId()));
261
+					bgmxz.setSzlkOrgId(businessAgentDepot.getId());
262
+					bgmxz.setHouseId(Integer.parseInt(job.get("ch")+""));
263
+					bgmxz.setWareId(Integer.parseInt(job.get("hwh")+""));
264
+					bgmxz.setLspz(Integer.parseInt(job.get("mxpz")+""));
265
+					bgmxz.setLsxz(Integer.parseInt(job.get("hwxz")+""));
266
+					bgmxz.setLsdj(Integer.parseInt(job.get("dj")+""));
267
+					Date fssj =  ParameterUtil.string2datetime(job.get("olddataid") + "");
268
+					bgmxz.setFssj(fssj);
269
+					BigDecimal number = new BigDecimal(job.get("srsl")+"");
270
+					bgmxz.setSrsl(number);
271
+					number = new BigDecimal(job.get("zcsl")+"");
272
+					bgmxz.setZcsl(number);
273
+					number = new BigDecimal(job.get("kcsl")+"");
274
+					bgmxz.setKcsl(number);
275
+					bgmxz.setIsJz(1);
276
+					bgmxz.setSjly(1);
277
+					bgmxz.setCreatePerson(realName);
278
+					bgmxz.setCreateDate(fssj);
279
+
280
+					//插入代储点的保管明细账表
281
+					bgmxzService.insert(bgmxz);
282
+				}
283
+				//修改代储点货位表的保管明细账最后同步时间
284
+				bgmxzService.updateAgentDepot(orgId);
285
+			}
286
+			map.put("status", "200");
287
+			map.put("msg", "操作成功!");
288
+		} catch (NumberFormatException e) {
289
+			map.put("msg", "操作失败!");
290
+			e.printStackTrace();
291
+		}
292
+
293
+		return map;
294
+	}
295
+}

+ 155 - 0
src/main/java/com/chinaitop/depot/agent/bgz/controller/BusinessAgentBgzzController.java

@@ -0,0 +1,155 @@
1
+package com.chinaitop.depot.agent.bgz.controller;
2
+
3
+import java.util.HashMap;
4
+import java.util.List;
5
+import java.util.Map;
6
+
7
+import javax.annotation.Resource;
8
+
9
+import org.springframework.http.MediaType;
10
+import org.springframework.web.bind.annotation.RequestMapping;
11
+import org.springframework.web.bind.annotation.RequestMethod;
12
+import org.springframework.web.bind.annotation.RestController;
13
+
14
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzz;
15
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzzExample;
16
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzzExample.Criteria;
17
+import com.chinaitop.depot.agent.bgz.service.BusinessAgentBgzzService;
18
+import com.chinaitop.utils.ParameterUtil;
19
+import com.fasterxml.jackson.databind.ObjectMapper;
20
+import com.github.pagehelper.PageHelper;
21
+import com.github.pagehelper.PageInfo;
22
+
23
+import io.swagger.annotations.Api;
24
+import io.swagger.annotations.ApiImplicitParam;
25
+import io.swagger.annotations.ApiImplicitParams;
26
+import io.swagger.annotations.ApiOperation;
27
+
28
+@RestController
29
+@RequestMapping(value = "/agent_bgzz")
30
+@Api(description = "代储库保管总账控制类")
31
+public class BusinessAgentBgzzController {
32
+
33
+	@Resource
34
+	private BusinessAgentBgzzService bgzzService;
35
+
36
+	@RequestMapping(value = "/getList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
37
+    @ApiOperation(value="代储库分仓保管账信息列表", notes = "代储库分仓保管账信息列表")
38
+    @ApiImplicitParams({
39
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
40
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
41
+            @ApiImplicitParam(name = "bgzzJson", value = "条件对象", paramType = "query")
42
+    })
43
+	public PageInfo<BusinessAgentBgzz> list(Integer pageNum, Integer pageSize, String bgzzJson) {
44
+		
45
+		ObjectMapper mapper = new ObjectMapper();
46
+		BusinessAgentBgzz bgzz = null;
47
+		try {
48
+			bgzz = (BusinessAgentBgzz) mapper.readValue(bgzzJson, BusinessAgentBgzz.class);
49
+		} catch (Exception e) {
50
+			e.printStackTrace();
51
+		}
52
+		BusinessAgentBgzzExample example = new BusinessAgentBgzzExample();
53
+		Criteria criteria = example.createCriteria();
54
+
55
+		/* orgId */
56
+		if(ParameterUtil.isnotnull(bgzz.getOrgId())){
57
+			criteria.andAgentIdEqualTo(bgzz.getOrgId());
58
+		}
59
+		/* 代储点ID */
60
+		if(ParameterUtil.isnotnull(bgzz.getAgentId())){
61
+			criteria.andAgentIdEqualTo(bgzz.getAgentId());
62
+		}
63
+		/* 代储库ID */
64
+		if(ParameterUtil.isnotnull(bgzz.getDckId())){
65
+			criteria.andDckIdEqualTo(bgzz.getDckId());
66
+		}
67
+		/* 粮食品种ID */
68
+		if(ParameterUtil.isnotnull(bgzz.getLspz())){
69
+			criteria.andLspzEqualTo(bgzz.getLspz());
70
+		}
71
+		/* 粮食性质ID */
72
+		if(ParameterUtil.isnotnull(bgzz.getLsxz())){
73
+			criteria.andLsxzEqualTo(bgzz.getLsxz());
74
+		}
75
+		/* 业务月份 */
76
+		if(ParameterUtil.isnotnull(bgzz.getFssj())){
77
+			criteria.andFssjEqualTo(bgzz.getFssj());
78
+		}
79
+
80
+		/* 分页 */
81
+		if(ParameterUtil.isnotnull(pageNum) && ParameterUtil.isnotnull(pageSize)){
82
+			PageHelper.startPage(pageNum, pageSize);
83
+		}
84
+		List<BusinessAgentBgzz> list = bgzzService.findByConditions(example);
85
+		PageInfo<BusinessAgentBgzz> pageInfo = new PageInfo<BusinessAgentBgzz>(list);
86
+		
87
+		return pageInfo;
88
+	}
89
+
90
+	@RequestMapping(value = "/edit", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
91
+    @ApiOperation(value="新增或修改代储库保管总账信息", notes = "新增或修改代储库保管总账信息")
92
+    @ApiImplicitParams({
93
+        @ApiImplicitParam(name = "bgzzJson", value = "数据对象", paramType = "form"),
94
+        @ApiImplicitParam(name = "type", value = "操作类型", paramType = "form")
95
+    })
96
+	public Map<String, Object> edit(String bgzzJson, String type) {
97
+		Map<String, Object> modelMap = new HashMap<String, Object>();
98
+		// JSON字符串转对象
99
+		ObjectMapper mapper = new ObjectMapper();
100
+		try {
101
+			BusinessAgentBgzz bgzz = (BusinessAgentBgzz) mapper.readValue(bgzzJson, BusinessAgentBgzz.class);
102
+			if (type != null && "shenhe".equals(type)) {
103
+				bgzzService.update(bgzz);
104
+			} else {
105
+				/**
106
+				 * 实现思路:
107
+				 * 1、查询是否记过账
108
+				 * 2、如果记过账则直接修改数据就行,否则就新增记账数据
109
+				 */
110
+				BusinessAgentBgzzExample example = new BusinessAgentBgzzExample();
111
+				Criteria criteria = example.createCriteria();
112
+
113
+				/* orgId */
114
+				if(ParameterUtil.isnotnull(bgzz.getOrgId())){
115
+					criteria.andOrgIdEqualTo(bgzz.getOrgId());
116
+				}
117
+				/* 代储点ID */
118
+				if(ParameterUtil.isnotnull(bgzz.getAgentId())){
119
+					criteria.andAgentIdEqualTo(bgzz.getAgentId());
120
+				}
121
+				/* 代储库ID */
122
+				if(ParameterUtil.isnotnull(bgzz.getDckId())){
123
+					criteria.andDckIdEqualTo(bgzz.getDckId());
124
+				}
125
+				/* 粮食品种ID */
126
+				if(ParameterUtil.isnotnull(bgzz.getLspz())){
127
+					criteria.andLspzEqualTo(bgzz.getLspz());
128
+				}
129
+				/* 粮食性质ID */
130
+				if(ParameterUtil.isnotnull(bgzz.getLsxz())){
131
+					criteria.andLsxzEqualTo(bgzz.getLsxz());
132
+				}
133
+				/* 业务月份 */
134
+				if(ParameterUtil.isnotnull(bgzz.getFssj())){
135
+					criteria.andFssjEqualTo(bgzz.getFssj());
136
+				}
137
+				List<BusinessAgentBgzz> list = bgzzService.findByConditions(example);
138
+				
139
+				if (null != list && list.size() > 0) {
140
+					bgzzService.update(bgzz);
141
+				} else {
142
+					bgzzService.insert(bgzz);
143
+				}
144
+			}
145
+			modelMap.put("status", "success");
146
+			modelMap.put("msg", "操作成功!");
147
+		} catch (Exception e) {
148
+			e.printStackTrace();
149
+			modelMap.put("status", "error");
150
+			modelMap.put("msg", "操作失败!");
151
+		}
152
+		return modelMap;
153
+	}
154
+
155
+}

+ 263 - 0
src/main/java/com/chinaitop/depot/agent/bgz/controller/BusinessAgentFcbgzController.java

@@ -0,0 +1,263 @@
1
+package com.chinaitop.depot.agent.bgz.controller;
2
+
3
+import java.util.HashMap;
4
+import java.util.List;
5
+import java.util.Map;
6
+
7
+import javax.annotation.Resource;
8
+
9
+import org.springframework.http.MediaType;
10
+import org.springframework.web.bind.annotation.RequestMapping;
11
+import org.springframework.web.bind.annotation.RequestMethod;
12
+import org.springframework.web.bind.annotation.RestController;
13
+
14
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgz;
15
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgzExample;
16
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgzExample.Criteria;
17
+import com.chinaitop.depot.agent.bgz.service.BusinessAgentBgmxzService;
18
+import com.chinaitop.depot.agent.bgz.service.BusinessAgentFcbgzService;
19
+import com.chinaitop.utils.ParameterUtil;
20
+import com.fasterxml.jackson.databind.ObjectMapper;
21
+import com.github.pagehelper.PageHelper;
22
+import com.github.pagehelper.PageInfo;
23
+
24
+import io.swagger.annotations.Api;
25
+import io.swagger.annotations.ApiImplicitParam;
26
+import io.swagger.annotations.ApiImplicitParams;
27
+import io.swagger.annotations.ApiOperation;
28
+
29
+@RestController
30
+@RequestMapping(value = "/agent_fcbgz")
31
+@Api(description = "代储库分仓保管账控制类")
32
+public class BusinessAgentFcbgzController {
33
+
34
+	@Resource
35
+	private BusinessAgentFcbgzService fcbgzService;
36
+
37
+	@Resource
38
+	private BusinessAgentBgmxzService bgmxzService;
39
+	
40
+	@RequestMapping(value = "/getList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
41
+    @ApiOperation(value="代储库分仓保管账信息列表", notes = "代储库分仓保管账信息列表")
42
+    @ApiImplicitParams({
43
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
44
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
45
+            @ApiImplicitParam(name = "fcbgzJson", value = "条件对象", paramType = "query")
46
+    })
47
+	public PageInfo<BusinessAgentFcbgz> list(Integer pageNum, Integer pageSize, String fcbgzJson) {
48
+		
49
+		ObjectMapper mapper = new ObjectMapper();
50
+		BusinessAgentFcbgz fcbgz = null;
51
+		try {
52
+			fcbgz = (BusinessAgentFcbgz) mapper.readValue(fcbgzJson, BusinessAgentFcbgz.class);
53
+		} catch (Exception e) {
54
+			e.printStackTrace();
55
+		}
56
+		BusinessAgentFcbgzExample example = new BusinessAgentFcbgzExample();
57
+		Criteria criteria = example.createCriteria();
58
+
59
+		/* orgId */
60
+		if(ParameterUtil.isnotnull(fcbgz.getOrgId())){
61
+			criteria.andOrgIdEqualTo(fcbgz.getOrgId());
62
+		}
63
+		/* 代储点ID */
64
+		if(ParameterUtil.isnotnull(fcbgz.getAgentId())){
65
+			criteria.andAgentIdEqualTo(fcbgz.getAgentId());
66
+		}
67
+		/* 代储库ID */
68
+		if(ParameterUtil.isnotnull(fcbgz.getDckId())){
69
+			criteria.andDckIdEqualTo(fcbgz.getDckId());
70
+		}
71
+		/* 仓房ID */
72
+		if(ParameterUtil.isnotnull(fcbgz.getHouseId())){
73
+			criteria.andHouseIdEqualTo(fcbgz.getHouseId());
74
+		}
75
+		/* 货位ID */
76
+		if(ParameterUtil.isnotnull(fcbgz.getWareId())){
77
+			criteria.andWareIdEqualTo(fcbgz.getWareId());
78
+		}
79
+		/* 粮食品种ID */
80
+		if(ParameterUtil.isnotnull(fcbgz.getLspz())){
81
+			criteria.andLspzEqualTo(fcbgz.getLspz());
82
+		}
83
+		/* 粮食性质ID */
84
+		if(ParameterUtil.isnotnull(fcbgz.getLsxz())){
85
+			criteria.andLsxzEqualTo(fcbgz.getLsxz());
86
+		}
87
+		/* 业务时间 */
88
+		if(ParameterUtil.isnotnull(fcbgz.getFssj())){
89
+			criteria.andFssjEqualTo(fcbgz.getFssj());
90
+		}
91
+
92
+		/* 分页 */
93
+		if(ParameterUtil.isnotnull(pageNum) && ParameterUtil.isnotnull(pageSize)){
94
+			PageHelper.startPage(pageNum, pageSize);
95
+		}
96
+		List<BusinessAgentFcbgz> list = fcbgzService.findByConditions(example);
97
+		PageInfo<BusinessAgentFcbgz> pageInfo = new PageInfo<BusinessAgentFcbgz>(list);
98
+		
99
+		return pageInfo;
100
+	}
101
+
102
+	@RequestMapping(value = "/edit", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
103
+    @ApiOperation(value="新增或修改代储库分仓保管账信息", notes = "新增或修改代储库分仓保管账信息")
104
+    @ApiImplicitParams({
105
+        @ApiImplicitParam(name = "fcbgzJson", value = "数据对象", paramType = "form"),
106
+        @ApiImplicitParam(name = "type", value = "操作类型", paramType = "form")
107
+    })
108
+	public Map<String, Object> edit(String fcbgzJson, String type) {
109
+		Map<String, Object> modelMap = new HashMap<String, Object>();
110
+		// JSON字符串转对象
111
+		ObjectMapper mapper = new ObjectMapper();
112
+		try {
113
+			BusinessAgentFcbgz fcbgz = (BusinessAgentFcbgz) mapper.readValue(fcbgzJson, BusinessAgentFcbgz.class);
114
+			if (type != null && "shenhe".equals(type)) {
115
+				fcbgzService.update(fcbgz);
116
+			} else {
117
+				/**
118
+				 * 实现思路
119
+				 * 1、先查询有没有记过账
120
+				 * 2、记过账那么修改数据就行,没记过账就新增
121
+				 * 3、记账后要把这个业务时间段的保管明细数据设置为已记账
122
+				 */
123
+				BusinessAgentFcbgzExample example = new BusinessAgentFcbgzExample();
124
+				Criteria criteria = example.createCriteria();
125
+				/* orgId */
126
+				if(ParameterUtil.isnotnull(fcbgz.getOrgId())){
127
+					criteria.andOrgIdEqualTo(fcbgz.getOrgId());
128
+				}
129
+				/* 代储点ID */
130
+				if(ParameterUtil.isnotnull(fcbgz.getAgentId())){
131
+					criteria.andAgentIdEqualTo(fcbgz.getAgentId());
132
+				}
133
+				/* 代储库ID */
134
+				if(ParameterUtil.isnotnull(fcbgz.getDckId())){
135
+					criteria.andDckIdEqualTo(fcbgz.getDckId());
136
+				}
137
+				/* 仓房ID */
138
+				if(ParameterUtil.isnotnull(fcbgz.getHouseId())){
139
+					criteria.andHouseIdEqualTo(fcbgz.getHouseId());
140
+				}
141
+				/* 货位ID */
142
+				if(ParameterUtil.isnotnull(fcbgz.getWareId())){
143
+					criteria.andWareIdEqualTo(fcbgz.getWareId());
144
+				}
145
+				/* 粮食品种ID */
146
+				if(ParameterUtil.isnotnull(fcbgz.getLspz())){
147
+					criteria.andLspzEqualTo(fcbgz.getLspz());
148
+				}
149
+				/* 粮食性质ID */
150
+				if(ParameterUtil.isnotnull(fcbgz.getLsxz())){
151
+					criteria.andLsxzEqualTo(fcbgz.getLsxz());
152
+				}
153
+				/* 业务时间 */
154
+				if(ParameterUtil.isnotnull(fcbgz.getFssj())){
155
+					criteria.andFssjEqualTo(fcbgz.getFssj());
156
+				}
157
+				List<BusinessAgentFcbgz> list = fcbgzService.findByConditions(example);
158
+
159
+				/* 如果记过账了那么就修改,否则新增 */
160
+				if (null != list && list.size() != 0) {
161
+					fcbgzService.update(fcbgz);
162
+				} else {
163
+					//新增
164
+					fcbgzService.insert(fcbgz);
165
+				}
166
+
167
+				//记账后将这天的保管明细账数据设置为已记账,记账后不可修改
168
+				fcbgzService.updateSfjz(fcbgz);
169
+			}
170
+			modelMap.put("status", "success");
171
+			modelMap.put("msg", "操作成功!");
172
+		} catch (Exception e) {
173
+			e.printStackTrace();
174
+			modelMap.put("status", "error");
175
+			modelMap.put("msg", "操作失败!");
176
+		}
177
+		return modelMap;
178
+	}
179
+	
180
+	@RequestMapping(value = "/remove", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
181
+    @ApiOperation(value="删除选中分仓保管账信息", notes = "删除选中分仓保管账信息")
182
+    @ApiImplicitParams({
183
+            @ApiImplicitParam(name = "id", value = "数据ID", paramType = "form")
184
+    })
185
+	public Map<String, Object> remove(Integer id) {
186
+		Map<String, Object> modelMap = new HashMap<String, Object>();
187
+		try {
188
+			if (null != id) {
189
+				fcbgzService.remove(id);
190
+				modelMap.put("status", "success");
191
+				modelMap.put("msg", "操作成功!");
192
+			}
193
+		} catch (Exception e) {
194
+			e.printStackTrace();
195
+			modelMap.put("status", "error");
196
+			modelMap.put("msg", "操作失败!");
197
+		}
198
+		return modelMap;
199
+	}
200
+	
201
+	@RequestMapping(value="/getBgzzList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
202
+	@ApiOperation(value="保管总账列表,按月统计", notes = "保管总账列表,按月统计,支持分页")
203
+	@ApiImplicitParams({
204
+		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
205
+		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
206
+		@ApiImplicitParam(name="bgzzJson", value="数据对象", paramType="query")
207
+	})
208
+	public PageInfo<Map<String, Object>> getBgzzList(Integer pageNum, Integer pageSize, String fcbgzJson) {
209
+
210
+		Map<String, Object> paramMap = new HashMap<String, Object>();
211
+		ObjectMapper mapper = new ObjectMapper();
212
+		BusinessAgentFcbgz fcbgz = null;
213
+		try {
214
+			fcbgz = (BusinessAgentFcbgz) mapper.readValue(fcbgzJson, BusinessAgentFcbgz.class);
215
+		} catch (Exception e) {
216
+			e.printStackTrace();
217
+		}
218
+		if(ParameterUtil.isnotnull(fcbgz.getOrgId())){
219
+			paramMap.put("orgId", fcbgz.getOrgId());
220
+		}
221
+		if(ParameterUtil.isnotnull(fcbgz.getAgentId())){
222
+			paramMap.put("agentId", fcbgz.getAgentId());
223
+		}
224
+		if(ParameterUtil.isnotnull(fcbgz.getDckId())){
225
+			paramMap.put("dckId", fcbgz.getDckId());
226
+		}
227
+		if(ParameterUtil.isnotnull(fcbgz.getLspz())){
228
+			paramMap.put("lspz", fcbgz.getLspz());
229
+		}
230
+		if(ParameterUtil.isnotnull(fcbgz.getLsxz())){
231
+			paramMap.put("lsxz", fcbgz.getLsxz());
232
+		}
233
+		if(ParameterUtil.isnotnull(fcbgz.getFssj())){
234
+			paramMap.put("fssj", fcbgz.getFssj());
235
+		}
236
+		/* 分页 */
237
+		if(ParameterUtil.isnotnull(pageNum) && ParameterUtil.isnotnull(pageSize)){
238
+			PageHelper.startPage(pageNum, pageSize);
239
+		}
240
+
241
+		List<Map<String, Object>> list = fcbgzService.selectBgzzGroupByList(paramMap);
242
+
243
+		PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(list);
244
+		list = pageInfo.getList();
245
+		if (null != list && list.size() > 0) {
246
+			Map<String, Object> param_map = null;
247
+			for (Map<String, Object> map : list) {
248
+				map.put("fssj", map.get("fssj").toString().substring(0, 7));
249
+				param_map = fcbgzService.selectBgzzList(map);
250
+				if (null != param_map) {
251
+					map.put("agent_name", param_map.get("agent_name"));
252
+					map.put("agent_depot_name", param_map.get("agent_depot_name"));
253
+					map.put("kcsl", param_map.get("kcsl"));
254
+				}
255
+			}
256
+			list = ParameterUtil.slashCapitals(list);
257
+			pageInfo.setList(list);
258
+			
259
+		}
260
+		
261
+		return pageInfo;
262
+	}
263
+}

+ 64 - 0
src/main/java/com/chinaitop/depot/agent/bgz/mapper/BusinessAgentBgmxzMapper.java

@@ -0,0 +1,64 @@
1
+package com.chinaitop.depot.agent.bgz.mapper;
2
+
3
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxz;
4
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxzExample;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+public interface BusinessAgentBgmxzMapper {
11
+    int countByExample(BusinessAgentBgmxzExample example);
12
+
13
+    int deleteByExample(BusinessAgentBgmxzExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessAgentBgmxz record);
18
+
19
+    int insertSelective(BusinessAgentBgmxz record);
20
+
21
+    List<BusinessAgentBgmxz> selectByExample(BusinessAgentBgmxzExample example);
22
+
23
+    BusinessAgentBgmxz selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessAgentBgmxz record, @Param("example") BusinessAgentBgmxzExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessAgentBgmxz record, @Param("example") BusinessAgentBgmxzExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessAgentBgmxz record);
30
+
31
+    int updateByPrimaryKey(BusinessAgentBgmxz record);
32
+
33
+    /**
34
+     * 查询分仓保管账分组列表
35
+     * 
36
+     * @param map 条件
37
+     * @return
38
+     */
39
+    List<Map<String, Object>> selectFcbgzGroupBy(Map<String, Object> map);
40
+    
41
+    /**
42
+     * 查询分仓保管账列表中的其它数据
43
+     * 
44
+     * @param map 条件
45
+     * @return
46
+     */
47
+    Map<String, Object> selectDetail(Map<String, Object> map);
48
+
49
+    /**
50
+     * 查询保管明细账数据
51
+     * 
52
+     * @param example
53
+     * @return
54
+     */
55
+    List<BusinessAgentBgmxz> selectByExampleNew(Map<String, Object> parem_map);
56
+
57
+    /**
58
+     * 查询代储库正常使用的货位数据信息
59
+     * 
60
+     * @param paramMap 条件
61
+     * @return
62
+     */
63
+    List<Map<String, Object>> selectAgentHouseWareList(Map<String, Object> paramMap);
64
+}

+ 577 - 0
src/main/java/com/chinaitop/depot/agent/bgz/mapper/BusinessAgentBgmxzMapper.xml

@@ -0,0 +1,577 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.chinaitop.depot.agent.bgz.mapper.BusinessAgentBgmxzMapper">
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxz">
5
+    <id column="id" jdbcType="INTEGER" property="id" />
6
+    <result column="org_id" jdbcType="INTEGER" property="orgId" />
7
+    <result column="agent_id" jdbcType="INTEGER" property="agentId" />
8
+    <result column="szlk_org_id" jdbcType="INTEGER" property="szlkOrgId" />
9
+    <result column="house_id" jdbcType="INTEGER" property="houseId" />
10
+    <result column="ware_id" jdbcType="INTEGER" property="wareId" />
11
+    <result column="lspz" jdbcType="INTEGER" property="lspz" />
12
+    <result column="lsxz" jdbcType="INTEGER" property="lsxz" />
13
+    <result column="lsdj" jdbcType="INTEGER" property="lsdj" />
14
+    <result column="fssj" jdbcType="TIMESTAMP" property="fssj" />
15
+    <result column="srsl" jdbcType="DECIMAL" property="srsl" />
16
+    <result column="zcsl" jdbcType="DECIMAL" property="zcsl" />
17
+    <result column="kcsl" jdbcType="DECIMAL" property="kcsl" />
18
+    <result column="lqgs_org_id" jdbcType="INTEGER" property="lqgsOrgId" />
19
+    <result column="is_jz" jdbcType="INTEGER" property="isJz" />
20
+    <result column="sjly" jdbcType="INTEGER" property="sjly" />
21
+    <result column="create_person" jdbcType="VARCHAR" property="createPerson" />
22
+    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
23
+    <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
24
+  </resultMap>
25
+  <sql id="Example_Where_Clause">
26
+    <where>
27
+      <foreach collection="oredCriteria" item="criteria" separator="or">
28
+        <if test="criteria.valid">
29
+          <trim prefix="(" prefixOverrides="and" suffix=")">
30
+            <foreach collection="criteria.criteria" item="criterion">
31
+              <choose>
32
+                <when test="criterion.noValue">
33
+                  and ${criterion.condition}
34
+                </when>
35
+                <when test="criterion.singleValue">
36
+                  and ${criterion.condition} #{criterion.value}
37
+                </when>
38
+                <when test="criterion.betweenValue">
39
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
40
+                </when>
41
+                <when test="criterion.listValue">
42
+                  and ${criterion.condition}
43
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
44
+                    #{listItem}
45
+                  </foreach>
46
+                </when>
47
+              </choose>
48
+            </foreach>
49
+          </trim>
50
+        </if>
51
+      </foreach>
52
+    </where>
53
+  </sql>
54
+  <sql id="Update_By_Example_Where_Clause">
55
+    <where>
56
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
57
+        <if test="criteria.valid">
58
+          <trim prefix="(" prefixOverrides="and" suffix=")">
59
+            <foreach collection="criteria.criteria" item="criterion">
60
+              <choose>
61
+                <when test="criterion.noValue">
62
+                  and ${criterion.condition}
63
+                </when>
64
+                <when test="criterion.singleValue">
65
+                  and ${criterion.condition} #{criterion.value}
66
+                </when>
67
+                <when test="criterion.betweenValue">
68
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
69
+                </when>
70
+                <when test="criterion.listValue">
71
+                  and ${criterion.condition}
72
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
73
+                    #{listItem}
74
+                  </foreach>
75
+                </when>
76
+              </choose>
77
+            </foreach>
78
+          </trim>
79
+        </if>
80
+      </foreach>
81
+    </where>
82
+  </sql>
83
+  <sql id="Base_Column_List">
84
+    id, org_id, agent_id, szlk_org_id, house_id, ware_id, lspz, lsxz, lsdj, fssj, srsl, 
85
+    zcsl, kcsl, lqgs_org_id, is_jz, sjly, create_person, create_date, updatetime
86
+  </sql>
87
+  <select id="selectByExample" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxzExample" resultMap="BaseResultMap">
88
+    select
89
+    <if test="distinct">
90
+      distinct
91
+    </if>
92
+    <include refid="Base_Column_List" />
93
+    from business_agent_bgmxz
94
+    <if test="_parameter != null">
95
+      <include refid="Example_Where_Clause" />
96
+    </if>
97
+    <if test="orderByClause != null">
98
+      order by ${orderByClause}
99
+    </if>
100
+  </select>
101
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
102
+    select 
103
+    <include refid="Base_Column_List" />
104
+    from business_agent_bgmxz
105
+    where id = #{id,jdbcType=INTEGER}
106
+  </select>
107
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
108
+    delete from business_agent_bgmxz
109
+    where id = #{id,jdbcType=INTEGER}
110
+  </delete>
111
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxzExample">
112
+    delete from business_agent_bgmxz
113
+    <if test="_parameter != null">
114
+      <include refid="Example_Where_Clause" />
115
+    </if>
116
+  </delete>
117
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxz">
118
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
119
+  	select SEQ_business_agent_bgmxz.nextVal from dual
120
+  	</selectKey>
121
+    insert into business_agent_bgmxz (id, org_id, agent_id, 
122
+      szlk_org_id, house_id, ware_id, 
123
+      lspz, lsxz, lsdj, fssj, 
124
+      srsl, zcsl, kcsl, lqgs_org_id, 
125
+      is_jz, sjly, create_person, 
126
+      create_date, updatetime)
127
+    values (#{id,jdbcType=INTEGER}, #{orgId,jdbcType=INTEGER}, #{agentId,jdbcType=INTEGER}, 
128
+      #{szlkOrgId,jdbcType=INTEGER}, #{houseId,jdbcType=INTEGER}, #{wareId,jdbcType=INTEGER}, 
129
+      #{lspz,jdbcType=INTEGER}, #{lsxz,jdbcType=INTEGER}, #{lsdj,jdbcType=INTEGER}, #{fssj,jdbcType=TIMESTAMP}, 
130
+      #{srsl,jdbcType=DECIMAL}, #{zcsl,jdbcType=DECIMAL}, #{kcsl,jdbcType=DECIMAL}, #{lqgsOrgId,jdbcType=INTEGER}, 
131
+      #{isJz,jdbcType=INTEGER}, #{sjly,jdbcType=INTEGER}, #{createPerson,jdbcType=VARCHAR}, 
132
+      #{createDate,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP})
133
+  </insert>
134
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxz">
135
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
136
+  	select SEQ_business_agent_bgmxz.nextVal from dual
137
+  	</selectKey>
138
+    insert into business_agent_bgmxz
139
+    <trim prefix="(" suffix=")" suffixOverrides=",">
140
+      <if test="id != null">
141
+        id,
142
+      </if>
143
+      <if test="orgId != null">
144
+        org_id,
145
+      </if>
146
+      <if test="agentId != null">
147
+        agent_id,
148
+      </if>
149
+      <if test="szlkOrgId != null">
150
+        szlk_org_id,
151
+      </if>
152
+      <if test="houseId != null">
153
+        house_id,
154
+      </if>
155
+      <if test="wareId != null">
156
+        ware_id,
157
+      </if>
158
+      <if test="lspz != null">
159
+        lspz,
160
+      </if>
161
+      <if test="lsxz != null">
162
+        lsxz,
163
+      </if>
164
+      <if test="lsdj != null">
165
+        lsdj,
166
+      </if>
167
+      <if test="fssj != null">
168
+        fssj,
169
+      </if>
170
+      <if test="srsl != null">
171
+        srsl,
172
+      </if>
173
+      <if test="zcsl != null">
174
+        zcsl,
175
+      </if>
176
+      <if test="kcsl != null">
177
+        kcsl,
178
+      </if>
179
+      <if test="lqgsOrgId != null">
180
+        lqgs_org_id,
181
+      </if>
182
+      <if test="isJz != null">
183
+        is_jz,
184
+      </if>
185
+      <if test="sjly != null">
186
+        sjly,
187
+      </if>
188
+      <if test="createPerson != null">
189
+        create_person,
190
+      </if>
191
+      <if test="createDate != null">
192
+        create_date,
193
+      </if>
194
+      <if test="updatetime != null">
195
+        updatetime,
196
+      </if>
197
+    </trim>
198
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
199
+      <if test="id != null">
200
+        #{id,jdbcType=INTEGER},
201
+      </if>
202
+      <if test="orgId != null">
203
+        #{orgId,jdbcType=INTEGER},
204
+      </if>
205
+      <if test="agentId != null">
206
+        #{agentId,jdbcType=INTEGER},
207
+      </if>
208
+      <if test="szlkOrgId != null">
209
+        #{szlkOrgId,jdbcType=INTEGER},
210
+      </if>
211
+      <if test="houseId != null">
212
+        #{houseId,jdbcType=INTEGER},
213
+      </if>
214
+      <if test="wareId != null">
215
+        #{wareId,jdbcType=INTEGER},
216
+      </if>
217
+      <if test="lspz != null">
218
+        #{lspz,jdbcType=INTEGER},
219
+      </if>
220
+      <if test="lsxz != null">
221
+        #{lsxz,jdbcType=INTEGER},
222
+      </if>
223
+      <if test="lsdj != null">
224
+        #{lsdj,jdbcType=INTEGER},
225
+      </if>
226
+      <if test="fssj != null">
227
+        #{fssj,jdbcType=TIMESTAMP},
228
+      </if>
229
+      <if test="srsl != null">
230
+        #{srsl,jdbcType=DECIMAL},
231
+      </if>
232
+      <if test="zcsl != null">
233
+        #{zcsl,jdbcType=DECIMAL},
234
+      </if>
235
+      <if test="kcsl != null">
236
+        #{kcsl,jdbcType=DECIMAL},
237
+      </if>
238
+      <if test="lqgsOrgId != null">
239
+        #{lqgsOrgId,jdbcType=INTEGER},
240
+      </if>
241
+      <if test="isJz != null">
242
+        #{isJz,jdbcType=INTEGER},
243
+      </if>
244
+      <if test="sjly != null">
245
+        #{sjly,jdbcType=INTEGER},
246
+      </if>
247
+      <if test="createPerson != null">
248
+        #{createPerson,jdbcType=VARCHAR},
249
+      </if>
250
+      <if test="createDate != null">
251
+        #{createDate,jdbcType=TIMESTAMP},
252
+      </if>
253
+      <if test="updatetime != null">
254
+        #{updatetime,jdbcType=TIMESTAMP},
255
+      </if>
256
+    </trim>
257
+  </insert>
258
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxzExample" resultType="java.lang.Integer">
259
+    select count(*) from business_agent_bgmxz
260
+    <if test="_parameter != null">
261
+      <include refid="Example_Where_Clause" />
262
+    </if>
263
+  </select>
264
+  <update id="updateByExampleSelective" parameterType="map">
265
+    update business_agent_bgmxz
266
+    <set>
267
+      <if test="record.id != null">
268
+        id = #{record.id,jdbcType=INTEGER},
269
+      </if>
270
+      <if test="record.orgId != null">
271
+        org_id = #{record.orgId,jdbcType=INTEGER},
272
+      </if>
273
+      <if test="record.agentId != null">
274
+        agent_id = #{record.agentId,jdbcType=INTEGER},
275
+      </if>
276
+      <if test="record.szlkOrgId != null">
277
+        szlk_org_id = #{record.szlkOrgId,jdbcType=INTEGER},
278
+      </if>
279
+      <if test="record.houseId != null">
280
+        house_id = #{record.houseId,jdbcType=INTEGER},
281
+      </if>
282
+      <if test="record.wareId != null">
283
+        ware_id = #{record.wareId,jdbcType=INTEGER},
284
+      </if>
285
+      <if test="record.lspz != null">
286
+        lspz = #{record.lspz,jdbcType=INTEGER},
287
+      </if>
288
+      <if test="record.lsxz != null">
289
+        lsxz = #{record.lsxz,jdbcType=INTEGER},
290
+      </if>
291
+      <if test="record.lsdj != null">
292
+        lsdj = #{record.lsdj,jdbcType=INTEGER},
293
+      </if>
294
+      <if test="record.fssj != null">
295
+        fssj = #{record.fssj,jdbcType=TIMESTAMP},
296
+      </if>
297
+      <if test="record.srsl != null">
298
+        srsl = #{record.srsl,jdbcType=DECIMAL},
299
+      </if>
300
+      <if test="record.zcsl != null">
301
+        zcsl = #{record.zcsl,jdbcType=DECIMAL},
302
+      </if>
303
+      <if test="record.kcsl != null">
304
+        kcsl = #{record.kcsl,jdbcType=DECIMAL},
305
+      </if>
306
+      <if test="record.lqgsOrgId != null">
307
+        lqgs_org_id = #{record.lqgsOrgId,jdbcType=INTEGER},
308
+      </if>
309
+      <if test="record.isJz != null">
310
+        is_jz = #{record.isJz,jdbcType=INTEGER},
311
+      </if>
312
+      <if test="record.sjly != null">
313
+        sjly = #{record.sjly,jdbcType=INTEGER},
314
+      </if>
315
+      <if test="record.createPerson != null">
316
+        create_person = #{record.createPerson,jdbcType=VARCHAR},
317
+      </if>
318
+      <if test="record.createDate != null">
319
+        create_date = #{record.createDate,jdbcType=TIMESTAMP},
320
+      </if>
321
+      <if test="record.updatetime != null">
322
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
323
+      </if>
324
+    </set>
325
+    <if test="_parameter != null">
326
+      <include refid="Update_By_Example_Where_Clause" />
327
+    </if>
328
+  </update>
329
+  <update id="updateByExample" parameterType="map">
330
+    update business_agent_bgmxz
331
+    set id = #{record.id,jdbcType=INTEGER},
332
+      org_id = #{record.orgId,jdbcType=INTEGER},
333
+      agent_id = #{record.agentId,jdbcType=INTEGER},
334
+      szlk_org_id = #{record.szlkOrgId,jdbcType=INTEGER},
335
+      house_id = #{record.houseId,jdbcType=INTEGER},
336
+      ware_id = #{record.wareId,jdbcType=INTEGER},
337
+      lspz = #{record.lspz,jdbcType=INTEGER},
338
+      lsxz = #{record.lsxz,jdbcType=INTEGER},
339
+      lsdj = #{record.lsdj,jdbcType=INTEGER},
340
+      fssj = #{record.fssj,jdbcType=TIMESTAMP},
341
+      srsl = #{record.srsl,jdbcType=DECIMAL},
342
+      zcsl = #{record.zcsl,jdbcType=DECIMAL},
343
+      kcsl = #{record.kcsl,jdbcType=DECIMAL},
344
+      lqgs_org_id = #{record.lqgsOrgId,jdbcType=INTEGER},
345
+      is_jz = #{record.isJz,jdbcType=INTEGER},
346
+      sjly = #{record.sjly,jdbcType=INTEGER},
347
+      create_person = #{record.createPerson,jdbcType=VARCHAR},
348
+      create_date = #{record.createDate,jdbcType=TIMESTAMP},
349
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
350
+    <if test="_parameter != null">
351
+      <include refid="Update_By_Example_Where_Clause" />
352
+    </if>
353
+  </update>
354
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxz">
355
+    update business_agent_bgmxz
356
+    <set>
357
+      <if test="orgId != null">
358
+        org_id = #{orgId,jdbcType=INTEGER},
359
+      </if>
360
+      <if test="agentId != null">
361
+        agent_id = #{agentId,jdbcType=INTEGER},
362
+      </if>
363
+      <if test="szlkOrgId != null">
364
+        szlk_org_id = #{szlkOrgId,jdbcType=INTEGER},
365
+      </if>
366
+      <if test="houseId != null">
367
+        house_id = #{houseId,jdbcType=INTEGER},
368
+      </if>
369
+      <if test="wareId != null">
370
+        ware_id = #{wareId,jdbcType=INTEGER},
371
+      </if>
372
+      <if test="lspz != null">
373
+        lspz = #{lspz,jdbcType=INTEGER},
374
+      </if>
375
+      <if test="lsxz != null">
376
+        lsxz = #{lsxz,jdbcType=INTEGER},
377
+      </if>
378
+      <if test="lsdj != null">
379
+        lsdj = #{lsdj,jdbcType=INTEGER},
380
+      </if>
381
+      <if test="fssj != null">
382
+        fssj = #{fssj,jdbcType=TIMESTAMP},
383
+      </if>
384
+      <if test="srsl != null">
385
+        srsl = #{srsl,jdbcType=DECIMAL},
386
+      </if>
387
+      <if test="zcsl != null">
388
+        zcsl = #{zcsl,jdbcType=DECIMAL},
389
+      </if>
390
+      <if test="kcsl != null">
391
+        kcsl = #{kcsl,jdbcType=DECIMAL},
392
+      </if>
393
+      <if test="lqgsOrgId != null">
394
+        lqgs_org_id = #{lqgsOrgId,jdbcType=INTEGER},
395
+      </if>
396
+      <if test="isJz != null">
397
+        is_jz = #{isJz,jdbcType=INTEGER},
398
+      </if>
399
+      <if test="sjly != null">
400
+        sjly = #{sjly,jdbcType=INTEGER},
401
+      </if>
402
+      <if test="createPerson != null">
403
+        create_person = #{createPerson,jdbcType=VARCHAR},
404
+      </if>
405
+      <if test="createDate != null">
406
+        create_date = #{createDate,jdbcType=TIMESTAMP},
407
+      </if>
408
+      <if test="updatetime != null">
409
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
410
+      </if>
411
+    </set>
412
+    where id = #{id,jdbcType=INTEGER}
413
+  </update>
414
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxz">
415
+    update business_agent_bgmxz
416
+    set org_id = #{orgId,jdbcType=INTEGER},
417
+      agent_id = #{agentId,jdbcType=INTEGER},
418
+      szlk_org_id = #{szlkOrgId,jdbcType=INTEGER},
419
+      house_id = #{houseId,jdbcType=INTEGER},
420
+      ware_id = #{wareId,jdbcType=INTEGER},
421
+      lspz = #{lspz,jdbcType=INTEGER},
422
+      lsxz = #{lsxz,jdbcType=INTEGER},
423
+      lsdj = #{lsdj,jdbcType=INTEGER},
424
+      fssj = #{fssj,jdbcType=TIMESTAMP},
425
+      srsl = #{srsl,jdbcType=DECIMAL},
426
+      zcsl = #{zcsl,jdbcType=DECIMAL},
427
+      kcsl = #{kcsl,jdbcType=DECIMAL},
428
+      lqgs_org_id = #{lqgsOrgId,jdbcType=INTEGER},
429
+      is_jz = #{isJz,jdbcType=INTEGER},
430
+      sjly = #{sjly,jdbcType=INTEGER},
431
+      create_person = #{createPerson,jdbcType=VARCHAR},
432
+      create_date = #{createDate,jdbcType=TIMESTAMP},
433
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
434
+    where id = #{id,jdbcType=INTEGER}
435
+  </update>
436
+
437
+  <!-- 查询分仓保管账列表其它数据 -->
438
+  <select id="selectDetail" parameterType="java.util.Map" resultType="java.util.Map">
439
+	SELECT * FROM (
440
+		select
441
+	        a.fssj fssj,
442
+			b.agent_name agent_Name,
443
+			c.agent_depot_name agent_Depot_Name,
444
+			d.storehouse_name house_Name,
445
+			e.warehouse_name ware_Name,
446
+			a.kcsl 
447
+		from business_agent_bgmxz  a 
448
+		LEFT JOIN business_agent b ON b.id=agent_id 
449
+		LEFT JOIN business_agent_depot c ON c.id=szlk_org_id 
450
+		LEFT JOIN basic_storehouse d ON d.storehouse_id=house_id 
451
+		LEFT JOIN basic_warehouse e ON e.warehouse_id=ware_id 
452
+		where 1=1 
453
+		<if test="orgId != null">
454
+	        AND a.org_id = #{orgId,jdbcType=INTEGER}
455
+	    </if>
456
+		<if test="agent_id != null">
457
+	        AND a.agent_id = #{agent_id,jdbcType=INTEGER}
458
+	    </if>
459
+	    <if test="dck_id != null">
460
+	        AND a.szlk_org_id = #{dck_id,jdbcType=INTEGER}
461
+	    </if>
462
+	    <if test="house_id != null">
463
+	        AND a.house_id = #{house_id,jdbcType=INTEGER}
464
+	    </if>
465
+	    <if test="ware_id != null">
466
+	        AND a.ware_id = #{ware_id,jdbcType=INTEGER}
467
+	    </if>
468
+	    <if test="lspz != null">
469
+	        AND a.lspz = #{lspz,jdbcType=INTEGER}
470
+	    </if>
471
+	    <if test="lsxz != null">
472
+	        AND a.lsxz = #{lsxz,jdbcType=INTEGER}
473
+	    </if>
474
+	    <if test="fssj != null">
475
+	        AND to_char(a.fssj,'yyyy-mm-dd') = #{fssj}
476
+	    </if>
477
+		ORDER BY fssj desc
478
+	) WHERE ROWNUM = 1 
479
+  </select>
480
+
481
+  <!-- 查询分仓保管账的分组信息 -->
482
+  <select id="selectFcbgzGroupBy" parameterType="java.util.Map" resultType="java.util.Map">
483
+	select 
484
+		a.agent_id agent_Id, 
485
+		a.szlk_org_id dck_Id, 
486
+		a.house_id house_Id, 
487
+		a.ware_id ware_Id, 
488
+		a.lsxz, 
489
+		a.lspz, 
490
+		to_date(a.fssj, 'yyyy-mm-dd') fssj, 
491
+		min(a.lsdj) lsdj, 
492
+		sum(a.srsl) as srsl, 
493
+		sum(a.zcsl) as zcsl,
494
+		a.org_id 
495
+	from(
496
+		SELECT org_id,agent_id, szlk_org_id, house_id, ware_id, lsxz, lspz, to_char(fssj, 'yyyy-mm-dd') fssj, min(lsdj) lsdj, sum(srsl) as srsl, sum(zcsl) as zcsl
497
+		from business_agent_bgmxz WHERE 1=1 
498
+	    <if test="orgId != null">
499
+	        AND org_id = #{orgId, jdbcType=INTEGER}
500
+	    </if>
501
+		group by org_id,agent_id, szlk_org_id, house_id, ware_id, lsxz, lspz, fssj
502
+	) a 
503
+	where 1=1 
504
+    <if test="agentId != null">
505
+        AND a.agent_id = #{agentId,jdbcType=INTEGER}
506
+    </if>
507
+    <if test="szlkOrgId != null">
508
+        AND a.szlk_org_id = #{szlkOrgId,jdbcType=INTEGER}
509
+    </if>
510
+    <if test="houseId != null">
511
+        AND a.house_id = #{houseId,jdbcType=INTEGER}
512
+    </if>
513
+    <if test="wareId != null">
514
+        AND a.ware_id = #{wareId,jdbcType=INTEGER}
515
+    </if>
516
+    <if test="lspz != null">
517
+        AND a.lspz = #{lspz,jdbcType=INTEGER}
518
+    </if>
519
+    <if test="lsxz != null">
520
+        AND a.lsxz = #{lsxz,jdbcType=INTEGER}
521
+    </if>
522
+    <if test="fssj != null">
523
+        AND a.fssj = #{fssj}
524
+    </if>
525
+	group by a.org_id, a.agent_id, a.szlk_org_id, a.house_id, a.ware_id, a.lsxz, a.lspz, a.fssj
526
+	order by a.fssj desc
527
+  </select>
528
+
529
+  <select id="selectByExampleNew" parameterType="java.util.Map" resultMap="BaseResultMap">
530
+    select
531
+    <if test="distinct">
532
+      distinct
533
+    </if>
534
+    a.*,b.agent_name agentName,c.agent_depot_name agentDepotName,d.storehouse_name houseName,e.warehouse_name wareName
535
+    from business_agent_bgmxz a 
536
+    LEFT JOIN business_agent b ON b.id=a.agent_id 
537
+	LEFT JOIN business_agent_depot c ON c.id=a.szlk_org_id 
538
+	LEFT JOIN basic_storehouse d ON d.storehouse_id=a.house_id 
539
+	LEFT JOIN basic_warehouse e ON e.warehouse_id=a.ware_id 
540
+	where 1=1 
541
+    <if test="agent_id != null">
542
+      and a.agent_id=#{agent_id, jdbcType=INTEGER}
543
+    </if>
544
+    <if test="szlk_org_id != null">
545
+      and a.szlk_org_id=#{szlk_org_id, jdbcType=INTEGER}
546
+    </if>
547
+    <if test="house_id != null">
548
+      and a.house_id=#{house_id, jdbcType=INTEGER}
549
+    </if>
550
+    <if test="ware_id != null">
551
+      and a.ware_id=#{ware_id, jdbcType=INTEGER}
552
+    </if>
553
+    <if test="fssj != null">
554
+      and a.fssj between #{start_time} and #{end_time} 
555
+    </if>
556
+    <if test="org_id != null">
557
+      and a.org_id=#{org_id, jdbcType=INTEGER} 
558
+    </if>
559
+    order by a.fssj desc
560
+  </select>
561
+
562
+  <!-- 查询代储库仓房货位信息 -->
563
+  <select id="selectAgentHouseWareList" parameterType="java.util.Map" resultType="java.util.Map">
564
+    SELECT 
565
+    	a.depot_id+"" unitid,
566
+    	c.warehouse_id hwh,
567
+    	c.bgmxz_tbsj modifydate
568
+    FROM business_agent_depot a
569
+	LEFT JOIN business_agent_storehouse b ON b.agent_depot_id=a.id
570
+	LEFT JOIN business_agent_warehouse c ON c.agent_storehouse_id=b.id 
571
+	WHERE a.depot_id != 0 AND b.storehouse_id IS NOT NULL AND c.warehouse_id IS NOT NULL 
572
+	<if test="orgId != null">
573
+	and c.org_id=#{orgId,jdbcType=INTEGER}
574
+	</if>
575
+  </select>
576
+  
577
+</mapper>

+ 30 - 0
src/main/java/com/chinaitop/depot/agent/bgz/mapper/BusinessAgentBgzzMapper.java

@@ -0,0 +1,30 @@
1
+package com.chinaitop.depot.agent.bgz.mapper;
2
+
3
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzz;
4
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzzExample;
5
+import java.util.List;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+public interface BusinessAgentBgzzMapper {
9
+    int countByExample(BusinessAgentBgzzExample example);
10
+
11
+    int deleteByExample(BusinessAgentBgzzExample example);
12
+
13
+    int deleteByPrimaryKey(Integer id);
14
+
15
+    int insert(BusinessAgentBgzz record);
16
+
17
+    int insertSelective(BusinessAgentBgzz record);
18
+
19
+    List<BusinessAgentBgzz> selectByExample(BusinessAgentBgzzExample example);
20
+
21
+    BusinessAgentBgzz selectByPrimaryKey(Integer id);
22
+
23
+    int updateByExampleSelective(@Param("record") BusinessAgentBgzz record, @Param("example") BusinessAgentBgzzExample example);
24
+
25
+    int updateByExample(@Param("record") BusinessAgentBgzz record, @Param("example") BusinessAgentBgzzExample example);
26
+
27
+    int updateByPrimaryKeySelective(BusinessAgentBgzz record);
28
+
29
+    int updateByPrimaryKey(BusinessAgentBgzz record);
30
+}

+ 406 - 0
src/main/java/com/chinaitop/depot/agent/bgz/mapper/BusinessAgentBgzzMapper.xml

@@ -0,0 +1,406 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.agent.bgz.mapper.BusinessAgentBgzzMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzz" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
7
+    <result column="agent_id" property="agentId" jdbcType="INTEGER" />
8
+    <result column="dck_id" property="dckId" jdbcType="INTEGER" />
9
+    <result column="lspz" property="lspz" jdbcType="INTEGER" />
10
+    <result column="lsxz" property="lsxz" jdbcType="INTEGER" />
11
+    <result column="fssj" property="fssj" jdbcType="VARCHAR" />
12
+    <result column="srsl" property="srsl" jdbcType="DECIMAL" />
13
+    <result column="zcsl" property="zcsl" jdbcType="DECIMAL" />
14
+    <result column="kcsl" property="kcsl" jdbcType="DECIMAL" />
15
+    <result column="jzr" property="jzr" jdbcType="VARCHAR" />
16
+    <result column="jzsj" property="jzsj" jdbcType="TIMESTAMP" />
17
+    <result column="shr" property="shr" jdbcType="VARCHAR" />
18
+    <result column="shsj" property="shsj" jdbcType="TIMESTAMP" />
19
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
20
+    <result column="create_person" property="createPerson" jdbcType="VARCHAR" />
21
+    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
22
+  </resultMap>
23
+  <sql id="Example_Where_Clause" >
24
+    <where >
25
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
26
+        <if test="criteria.valid" >
27
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
28
+            <foreach collection="criteria.criteria" item="criterion" >
29
+              <choose >
30
+                <when test="criterion.noValue" >
31
+                  and ${criterion.condition}
32
+                </when>
33
+                <when test="criterion.singleValue" >
34
+                  and ${criterion.condition} #{criterion.value}
35
+                </when>
36
+                <when test="criterion.betweenValue" >
37
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
38
+                </when>
39
+                <when test="criterion.listValue" >
40
+                  and ${criterion.condition}
41
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
42
+                    #{listItem}
43
+                  </foreach>
44
+                </when>
45
+              </choose>
46
+            </foreach>
47
+          </trim>
48
+        </if>
49
+      </foreach>
50
+    </where>
51
+  </sql>
52
+  <sql id="Update_By_Example_Where_Clause" >
53
+    <where >
54
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
55
+        <if test="criteria.valid" >
56
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
57
+            <foreach collection="criteria.criteria" item="criterion" >
58
+              <choose >
59
+                <when test="criterion.noValue" >
60
+                  and ${criterion.condition}
61
+                </when>
62
+                <when test="criterion.singleValue" >
63
+                  and ${criterion.condition} #{criterion.value}
64
+                </when>
65
+                <when test="criterion.betweenValue" >
66
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
67
+                </when>
68
+                <when test="criterion.listValue" >
69
+                  and ${criterion.condition}
70
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
71
+                    #{listItem}
72
+                  </foreach>
73
+                </when>
74
+              </choose>
75
+            </foreach>
76
+          </trim>
77
+        </if>
78
+      </foreach>
79
+    </where>
80
+  </sql>
81
+  <sql id="Base_Column_List" >
82
+    id, org_id, agent_id, dck_id, lspz, lsxz, fssj, srsl, zcsl, kcsl, jzr, jzsj, shr, 
83
+    shsj, create_date, create_person, updatetime
84
+  </sql>
85
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzzExample" >
86
+    select
87
+    <if test="distinct" >
88
+      distinct
89
+    </if>
90
+    <include refid="Base_Column_List" />
91
+    from business_agent_bgzz
92
+    <if test="_parameter != null" >
93
+      <include refid="Example_Where_Clause" />
94
+    </if>
95
+    <if test="orderByClause != null" >
96
+      order by ${orderByClause}
97
+    </if>
98
+  </select>
99
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
100
+    select 
101
+    <include refid="Base_Column_List" />
102
+    from business_agent_bgzz
103
+    where id = #{id,jdbcType=INTEGER}
104
+  </select>
105
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
106
+    delete from business_agent_bgzz
107
+    where id = #{id,jdbcType=INTEGER}
108
+  </delete>
109
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzzExample" >
110
+    delete from business_agent_bgzz
111
+    <if test="_parameter != null" >
112
+      <include refid="Example_Where_Clause" />
113
+    </if>
114
+  </delete>
115
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzz" >
116
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
117
+  	select SEQ_business_agent_bgzz.nextVal from dual
118
+  	</selectKey>
119
+    insert into business_agent_bgzz (id, org_id, agent_id, 
120
+      dck_id, lspz, lsxz, 
121
+      fssj, srsl, zcsl, kcsl, 
122
+      jzr, jzsj, shr, shsj, 
123
+      create_date, create_person, updatetime
124
+      )
125
+    values (#{id,jdbcType=INTEGER}, #{orgId,jdbcType=INTEGER}, #{agentId,jdbcType=INTEGER}, 
126
+      #{dckId,jdbcType=INTEGER}, #{lspz,jdbcType=INTEGER}, #{lsxz,jdbcType=INTEGER}, 
127
+      #{fssj,jdbcType=VARCHAR}, #{srsl,jdbcType=DECIMAL}, #{zcsl,jdbcType=DECIMAL}, #{kcsl,jdbcType=DECIMAL}, 
128
+      #{jzr,jdbcType=VARCHAR}, #{jzsj,jdbcType=TIMESTAMP}, #{shr,jdbcType=VARCHAR}, #{shsj,jdbcType=TIMESTAMP}, 
129
+      #{createDate,jdbcType=TIMESTAMP}, #{createPerson,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}
130
+      )
131
+  </insert>
132
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzz" >
133
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
134
+  	select SEQ_business_agent_bgzz.nextVal from dual
135
+  	</selectKey>
136
+    insert into business_agent_bgzz
137
+    <trim prefix="(" suffix=")" suffixOverrides="," >
138
+      <if test="id != null" >
139
+        id,
140
+      </if>
141
+      <if test="orgId != null" >
142
+        org_id,
143
+      </if>
144
+      <if test="agentId != null" >
145
+        agent_id,
146
+      </if>
147
+      <if test="dckId != null" >
148
+        dck_id,
149
+      </if>
150
+      <if test="lspz != null" >
151
+        lspz,
152
+      </if>
153
+      <if test="lsxz != null" >
154
+        lsxz,
155
+      </if>
156
+      <if test="fssj != null" >
157
+        fssj,
158
+      </if>
159
+      <if test="srsl != null" >
160
+        srsl,
161
+      </if>
162
+      <if test="zcsl != null" >
163
+        zcsl,
164
+      </if>
165
+      <if test="kcsl != null" >
166
+        kcsl,
167
+      </if>
168
+      <if test="jzr != null" >
169
+        jzr,
170
+      </if>
171
+      <if test="jzsj != null" >
172
+        jzsj,
173
+      </if>
174
+      <if test="shr != null" >
175
+        shr,
176
+      </if>
177
+      <if test="shsj != null" >
178
+        shsj,
179
+      </if>
180
+      <if test="createDate != null" >
181
+        create_date,
182
+      </if>
183
+      <if test="createPerson != null" >
184
+        create_person,
185
+      </if>
186
+      <if test="updatetime != null" >
187
+        updatetime,
188
+      </if>
189
+    </trim>
190
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
191
+      <if test="id != null" >
192
+        #{id,jdbcType=INTEGER},
193
+      </if>
194
+      <if test="orgId != null" >
195
+        #{orgId,jdbcType=INTEGER},
196
+      </if>
197
+      <if test="agentId != null" >
198
+        #{agentId,jdbcType=INTEGER},
199
+      </if>
200
+      <if test="dckId != null" >
201
+        #{dckId,jdbcType=INTEGER},
202
+      </if>
203
+      <if test="lspz != null" >
204
+        #{lspz,jdbcType=INTEGER},
205
+      </if>
206
+      <if test="lsxz != null" >
207
+        #{lsxz,jdbcType=INTEGER},
208
+      </if>
209
+      <if test="fssj != null" >
210
+        #{fssj,jdbcType=VARCHAR},
211
+      </if>
212
+      <if test="srsl != null" >
213
+        #{srsl,jdbcType=DECIMAL},
214
+      </if>
215
+      <if test="zcsl != null" >
216
+        #{zcsl,jdbcType=DECIMAL},
217
+      </if>
218
+      <if test="kcsl != null" >
219
+        #{kcsl,jdbcType=DECIMAL},
220
+      </if>
221
+      <if test="jzr != null" >
222
+        #{jzr,jdbcType=VARCHAR},
223
+      </if>
224
+      <if test="jzsj != null" >
225
+        #{jzsj,jdbcType=TIMESTAMP},
226
+      </if>
227
+      <if test="shr != null" >
228
+        #{shr,jdbcType=VARCHAR},
229
+      </if>
230
+      <if test="shsj != null" >
231
+        #{shsj,jdbcType=TIMESTAMP},
232
+      </if>
233
+      <if test="createDate != null" >
234
+        #{createDate,jdbcType=TIMESTAMP},
235
+      </if>
236
+      <if test="createPerson != null" >
237
+        #{createPerson,jdbcType=VARCHAR},
238
+      </if>
239
+      <if test="updatetime != null" >
240
+        #{updatetime,jdbcType=TIMESTAMP},
241
+      </if>
242
+    </trim>
243
+  </insert>
244
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzzExample" resultType="java.lang.Integer" >
245
+    select count(*) from business_agent_bgzz
246
+    <if test="_parameter != null" >
247
+      <include refid="Example_Where_Clause" />
248
+    </if>
249
+  </select>
250
+  <update id="updateByExampleSelective" parameterType="map" >
251
+    update business_agent_bgzz
252
+    <set >
253
+      <if test="record.id != null" >
254
+        id = #{record.id,jdbcType=INTEGER},
255
+      </if>
256
+      <if test="record.orgId != null" >
257
+        org_id = #{record.orgId,jdbcType=INTEGER},
258
+      </if>
259
+      <if test="record.agentId != null" >
260
+        agent_id = #{record.agentId,jdbcType=INTEGER},
261
+      </if>
262
+      <if test="record.dckId != null" >
263
+        dck_id = #{record.dckId,jdbcType=INTEGER},
264
+      </if>
265
+      <if test="record.lspz != null" >
266
+        lspz = #{record.lspz,jdbcType=INTEGER},
267
+      </if>
268
+      <if test="record.lsxz != null" >
269
+        lsxz = #{record.lsxz,jdbcType=INTEGER},
270
+      </if>
271
+      <if test="record.fssj != null" >
272
+        fssj = #{record.fssj,jdbcType=VARCHAR},
273
+      </if>
274
+      <if test="record.srsl != null" >
275
+        srsl = #{record.srsl,jdbcType=DECIMAL},
276
+      </if>
277
+      <if test="record.zcsl != null" >
278
+        zcsl = #{record.zcsl,jdbcType=DECIMAL},
279
+      </if>
280
+      <if test="record.kcsl != null" >
281
+        kcsl = #{record.kcsl,jdbcType=DECIMAL},
282
+      </if>
283
+      <if test="record.jzr != null" >
284
+        jzr = #{record.jzr,jdbcType=VARCHAR},
285
+      </if>
286
+      <if test="record.jzsj != null" >
287
+        jzsj = #{record.jzsj,jdbcType=TIMESTAMP},
288
+      </if>
289
+      <if test="record.shr != null" >
290
+        shr = #{record.shr,jdbcType=VARCHAR},
291
+      </if>
292
+      <if test="record.shsj != null" >
293
+        shsj = #{record.shsj,jdbcType=TIMESTAMP},
294
+      </if>
295
+      <if test="record.createDate != null" >
296
+        create_date = #{record.createDate,jdbcType=TIMESTAMP},
297
+      </if>
298
+      <if test="record.createPerson != null" >
299
+        create_person = #{record.createPerson,jdbcType=VARCHAR},
300
+      </if>
301
+      <if test="record.updatetime != null" >
302
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
303
+      </if>
304
+    </set>
305
+    <if test="_parameter != null" >
306
+      <include refid="Update_By_Example_Where_Clause" />
307
+    </if>
308
+  </update>
309
+  <update id="updateByExample" parameterType="map" >
310
+    update business_agent_bgzz
311
+    set id = #{record.id,jdbcType=INTEGER},
312
+      org_id = #{record.orgId,jdbcType=INTEGER},
313
+      agent_id = #{record.agentId,jdbcType=INTEGER},
314
+      dck_id = #{record.dckId,jdbcType=INTEGER},
315
+      lspz = #{record.lspz,jdbcType=INTEGER},
316
+      lsxz = #{record.lsxz,jdbcType=INTEGER},
317
+      fssj = #{record.fssj,jdbcType=VARCHAR},
318
+      srsl = #{record.srsl,jdbcType=DECIMAL},
319
+      zcsl = #{record.zcsl,jdbcType=DECIMAL},
320
+      kcsl = #{record.kcsl,jdbcType=DECIMAL},
321
+      jzr = #{record.jzr,jdbcType=VARCHAR},
322
+      jzsj = #{record.jzsj,jdbcType=TIMESTAMP},
323
+      shr = #{record.shr,jdbcType=VARCHAR},
324
+      shsj = #{record.shsj,jdbcType=TIMESTAMP},
325
+      create_date = #{record.createDate,jdbcType=TIMESTAMP},
326
+      create_person = #{record.createPerson,jdbcType=VARCHAR},
327
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
328
+    <if test="_parameter != null" >
329
+      <include refid="Update_By_Example_Where_Clause" />
330
+    </if>
331
+  </update>
332
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzz" >
333
+    update business_agent_bgzz
334
+    <set >
335
+      <if test="orgId != null" >
336
+        org_id = #{orgId,jdbcType=INTEGER},
337
+      </if>
338
+      <if test="agentId != null" >
339
+        agent_id = #{agentId,jdbcType=INTEGER},
340
+      </if>
341
+      <if test="dckId != null" >
342
+        dck_id = #{dckId,jdbcType=INTEGER},
343
+      </if>
344
+      <if test="lspz != null" >
345
+        lspz = #{lspz,jdbcType=INTEGER},
346
+      </if>
347
+      <if test="lsxz != null" >
348
+        lsxz = #{lsxz,jdbcType=INTEGER},
349
+      </if>
350
+      <if test="fssj != null" >
351
+        fssj = #{fssj,jdbcType=VARCHAR},
352
+      </if>
353
+      <if test="srsl != null" >
354
+        srsl = #{srsl,jdbcType=DECIMAL},
355
+      </if>
356
+      <if test="zcsl != null" >
357
+        zcsl = #{zcsl,jdbcType=DECIMAL},
358
+      </if>
359
+      <if test="kcsl != null" >
360
+        kcsl = #{kcsl,jdbcType=DECIMAL},
361
+      </if>
362
+      <if test="jzr != null" >
363
+        jzr = #{jzr,jdbcType=VARCHAR},
364
+      </if>
365
+      <if test="jzsj != null" >
366
+        jzsj = #{jzsj,jdbcType=TIMESTAMP},
367
+      </if>
368
+      <if test="shr != null" >
369
+        shr = #{shr,jdbcType=VARCHAR},
370
+      </if>
371
+      <if test="shsj != null" >
372
+        shsj = #{shsj,jdbcType=TIMESTAMP},
373
+      </if>
374
+      <if test="createDate != null" >
375
+        create_date = #{createDate,jdbcType=TIMESTAMP},
376
+      </if>
377
+      <if test="createPerson != null" >
378
+        create_person = #{createPerson,jdbcType=VARCHAR},
379
+      </if>
380
+      <if test="updatetime != null" >
381
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
382
+      </if>
383
+    </set>
384
+    where id = #{id,jdbcType=INTEGER}
385
+  </update>
386
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzz" >
387
+    update business_agent_bgzz
388
+    set org_id = #{orgId,jdbcType=INTEGER},
389
+      agent_id = #{agentId,jdbcType=INTEGER},
390
+      dck_id = #{dckId,jdbcType=INTEGER},
391
+      lspz = #{lspz,jdbcType=INTEGER},
392
+      lsxz = #{lsxz,jdbcType=INTEGER},
393
+      fssj = #{fssj,jdbcType=VARCHAR},
394
+      srsl = #{srsl,jdbcType=DECIMAL},
395
+      zcsl = #{zcsl,jdbcType=DECIMAL},
396
+      kcsl = #{kcsl,jdbcType=DECIMAL},
397
+      jzr = #{jzr,jdbcType=VARCHAR},
398
+      jzsj = #{jzsj,jdbcType=TIMESTAMP},
399
+      shr = #{shr,jdbcType=VARCHAR},
400
+      shsj = #{shsj,jdbcType=TIMESTAMP},
401
+      create_date = #{createDate,jdbcType=TIMESTAMP},
402
+      create_person = #{createPerson,jdbcType=VARCHAR},
403
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
404
+    where id = #{id,jdbcType=INTEGER}
405
+  </update>
406
+</mapper>

+ 48 - 0
src/main/java/com/chinaitop/depot/agent/bgz/mapper/BusinessAgentFcbgzMapper.java

@@ -0,0 +1,48 @@
1
+package com.chinaitop.depot.agent.bgz.mapper;
2
+
3
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgz;
4
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgzExample;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+public interface BusinessAgentFcbgzMapper {
11
+    int countByExample(BusinessAgentFcbgzExample example);
12
+
13
+    int deleteByExample(BusinessAgentFcbgzExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessAgentFcbgz record);
18
+
19
+    int insertSelective(BusinessAgentFcbgz record);
20
+
21
+    List<BusinessAgentFcbgz> selectByExample(BusinessAgentFcbgzExample example);
22
+
23
+    BusinessAgentFcbgz selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessAgentFcbgz record, @Param("example") BusinessAgentFcbgzExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessAgentFcbgz record, @Param("example") BusinessAgentFcbgzExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessAgentFcbgz record);
30
+
31
+    int updateByPrimaryKey(BusinessAgentFcbgz record);
32
+
33
+    /**
34
+     * 查询保管总账列表分组信息
35
+     * 
36
+     * @param map 参数
37
+     * @return
38
+     */
39
+    List<Map<String, Object>> selectBgzzGroupByList(Map<String, Object> map);
40
+
41
+    /**
42
+     * 查询保管总账列表其它数据
43
+     * 
44
+     * @param map 参数
45
+     * @return
46
+     */
47
+    Map<String, Object> selectBgzzList(Map<String, Object> map);
48
+}

+ 523 - 0
src/main/java/com/chinaitop/depot/agent/bgz/mapper/BusinessAgentFcbgzMapper.xml

@@ -0,0 +1,523 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.agent.bgz.mapper.BusinessAgentFcbgzMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgz" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
7
+    <result column="agent_id" property="agentId" jdbcType="INTEGER" />
8
+    <result column="dck_id" property="dckId" jdbcType="INTEGER" />
9
+    <result column="house_id" property="houseId" jdbcType="INTEGER" />
10
+    <result column="ware_id" property="wareId" jdbcType="INTEGER" />
11
+    <result column="lspz" property="lspz" jdbcType="INTEGER" />
12
+    <result column="lsxz" property="lsxz" jdbcType="INTEGER" />
13
+    <result column="lsdj" property="lsdj" jdbcType="INTEGER" />
14
+    <result column="fssj" property="fssj" jdbcType="TIMESTAMP" />
15
+    <result column="srsl" property="srsl" jdbcType="DECIMAL" />
16
+    <result column="zcsl" property="zcsl" jdbcType="DECIMAL" />
17
+    <result column="kcsl" property="kcsl" jdbcType="DECIMAL" />
18
+    <result column="jzr" property="jzr" jdbcType="VARCHAR" />
19
+    <result column="jzsj" property="jzsj" jdbcType="TIMESTAMP" />
20
+    <result column="shr" property="shr" jdbcType="VARCHAR" />
21
+    <result column="shsj" property="shsj" jdbcType="TIMESTAMP" />
22
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
23
+    <result column="create_person" property="createPerson" jdbcType="VARCHAR" />
24
+    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
25
+  </resultMap>
26
+  <sql id="Example_Where_Clause" >
27
+    <where >
28
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
29
+        <if test="criteria.valid" >
30
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
31
+            <foreach collection="criteria.criteria" item="criterion" >
32
+              <choose >
33
+                <when test="criterion.noValue" >
34
+                  and ${criterion.condition}
35
+                </when>
36
+                <when test="criterion.singleValue" >
37
+                  and ${criterion.condition} #{criterion.value}
38
+                </when>
39
+                <when test="criterion.betweenValue" >
40
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
41
+                </when>
42
+                <when test="criterion.listValue" >
43
+                  and ${criterion.condition}
44
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
45
+                    #{listItem}
46
+                  </foreach>
47
+                </when>
48
+              </choose>
49
+            </foreach>
50
+          </trim>
51
+        </if>
52
+      </foreach>
53
+    </where>
54
+  </sql>
55
+  <sql id="Update_By_Example_Where_Clause" >
56
+    <where >
57
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
58
+        <if test="criteria.valid" >
59
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
60
+            <foreach collection="criteria.criteria" item="criterion" >
61
+              <choose >
62
+                <when test="criterion.noValue" >
63
+                  and ${criterion.condition}
64
+                </when>
65
+                <when test="criterion.singleValue" >
66
+                  and ${criterion.condition} #{criterion.value}
67
+                </when>
68
+                <when test="criterion.betweenValue" >
69
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
70
+                </when>
71
+                <when test="criterion.listValue" >
72
+                  and ${criterion.condition}
73
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
74
+                    #{listItem}
75
+                  </foreach>
76
+                </when>
77
+              </choose>
78
+            </foreach>
79
+          </trim>
80
+        </if>
81
+      </foreach>
82
+    </where>
83
+  </sql>
84
+  <sql id="Base_Column_List" >
85
+    id, org_id, agent_id, dck_id, house_id, ware_id, lspz, lsxz, lsdj, fssj, srsl, zcsl, 
86
+    kcsl, jzr, jzsj, shr, shsj, create_date, create_person, updatetime
87
+  </sql>
88
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgzExample" >
89
+    select
90
+    <if test="distinct" >
91
+      distinct
92
+    </if>
93
+    <include refid="Base_Column_List" />
94
+    from business_agent_fcbgz
95
+    <if test="_parameter != null" >
96
+      <include refid="Example_Where_Clause" />
97
+    </if>
98
+    <if test="orderByClause != null" >
99
+      order by ${orderByClause}
100
+    </if>
101
+  </select>
102
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
103
+    select 
104
+    <include refid="Base_Column_List" />
105
+    from business_agent_fcbgz
106
+    where id = #{id,jdbcType=INTEGER}
107
+  </select>
108
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
109
+    delete from business_agent_fcbgz
110
+    where id = #{id,jdbcType=INTEGER}
111
+  </delete>
112
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgzExample" >
113
+    delete from business_agent_fcbgz
114
+    <if test="_parameter != null" >
115
+      <include refid="Example_Where_Clause" />
116
+    </if>
117
+  </delete>
118
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgz" >
119
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
120
+  	select SEQ_business_agent_fcbgz.nextVal from dual
121
+  	</selectKey>
122
+    insert into business_agent_fcbgz (id, org_id, agent_id, 
123
+      dck_id, house_id, ware_id, 
124
+      lspz, lsxz, lsdj, fssj, 
125
+      srsl, zcsl, kcsl, jzr, 
126
+      jzsj, shr, shsj, 
127
+      create_date, create_person, updatetime
128
+      )
129
+    values (#{id,jdbcType=INTEGER}, #{orgId,jdbcType=INTEGER}, #{agentId,jdbcType=INTEGER}, 
130
+      #{dckId,jdbcType=INTEGER}, #{houseId,jdbcType=INTEGER}, #{wareId,jdbcType=INTEGER}, 
131
+      #{lspz,jdbcType=INTEGER}, #{lsxz,jdbcType=INTEGER}, #{lsdj,jdbcType=INTEGER}, #{fssj,jdbcType=TIMESTAMP}, 
132
+      #{srsl,jdbcType=DECIMAL}, #{zcsl,jdbcType=DECIMAL}, #{kcsl,jdbcType=DECIMAL}, #{jzr,jdbcType=VARCHAR}, 
133
+      #{jzsj,jdbcType=TIMESTAMP}, #{shr,jdbcType=VARCHAR}, #{shsj,jdbcType=TIMESTAMP}, 
134
+      #{createDate,jdbcType=TIMESTAMP}, #{createPerson,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}
135
+      )
136
+  </insert>
137
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgz" >
138
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
139
+  	select SEQ_business_agent_fcbgz.nextVal from dual
140
+  	</selectKey>
141
+    insert into business_agent_fcbgz
142
+    <trim prefix="(" suffix=")" suffixOverrides="," >
143
+      <if test="id != null" >
144
+        id,
145
+      </if>
146
+      <if test="orgId != null" >
147
+        org_id,
148
+      </if>
149
+      <if test="agentId != null" >
150
+        agent_id,
151
+      </if>
152
+      <if test="dckId != null" >
153
+        dck_id,
154
+      </if>
155
+      <if test="houseId != null" >
156
+        house_id,
157
+      </if>
158
+      <if test="wareId != null" >
159
+        ware_id,
160
+      </if>
161
+      <if test="lspz != null" >
162
+        lspz,
163
+      </if>
164
+      <if test="lsxz != null" >
165
+        lsxz,
166
+      </if>
167
+      <if test="lsdj != null" >
168
+        lsdj,
169
+      </if>
170
+      <if test="fssj != null" >
171
+        fssj,
172
+      </if>
173
+      <if test="srsl != null" >
174
+        srsl,
175
+      </if>
176
+      <if test="zcsl != null" >
177
+        zcsl,
178
+      </if>
179
+      <if test="kcsl != null" >
180
+        kcsl,
181
+      </if>
182
+      <if test="jzr != null" >
183
+        jzr,
184
+      </if>
185
+      <if test="jzsj != null" >
186
+        jzsj,
187
+      </if>
188
+      <if test="shr != null" >
189
+        shr,
190
+      </if>
191
+      <if test="shsj != null" >
192
+        shsj,
193
+      </if>
194
+      <if test="createDate != null" >
195
+        create_date,
196
+      </if>
197
+      <if test="createPerson != null" >
198
+        create_person,
199
+      </if>
200
+      <if test="updatetime != null" >
201
+        updatetime,
202
+      </if>
203
+    </trim>
204
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
205
+      <if test="id != null" >
206
+        #{id,jdbcType=INTEGER},
207
+      </if>
208
+      <if test="orgId != null" >
209
+        #{orgId,jdbcType=INTEGER},
210
+      </if>
211
+      <if test="agentId != null" >
212
+        #{agentId,jdbcType=INTEGER},
213
+      </if>
214
+      <if test="dckId != null" >
215
+        #{dckId,jdbcType=INTEGER},
216
+      </if>
217
+      <if test="houseId != null" >
218
+        #{houseId,jdbcType=INTEGER},
219
+      </if>
220
+      <if test="wareId != null" >
221
+        #{wareId,jdbcType=INTEGER},
222
+      </if>
223
+      <if test="lspz != null" >
224
+        #{lspz,jdbcType=INTEGER},
225
+      </if>
226
+      <if test="lsxz != null" >
227
+        #{lsxz,jdbcType=INTEGER},
228
+      </if>
229
+      <if test="lsdj != null" >
230
+        #{lsdj,jdbcType=INTEGER},
231
+      </if>
232
+      <if test="fssj != null" >
233
+        #{fssj,jdbcType=TIMESTAMP},
234
+      </if>
235
+      <if test="srsl != null" >
236
+        #{srsl,jdbcType=DECIMAL},
237
+      </if>
238
+      <if test="zcsl != null" >
239
+        #{zcsl,jdbcType=DECIMAL},
240
+      </if>
241
+      <if test="kcsl != null" >
242
+        #{kcsl,jdbcType=DECIMAL},
243
+      </if>
244
+      <if test="jzr != null" >
245
+        #{jzr,jdbcType=VARCHAR},
246
+      </if>
247
+      <if test="jzsj != null" >
248
+        #{jzsj,jdbcType=TIMESTAMP},
249
+      </if>
250
+      <if test="shr != null" >
251
+        #{shr,jdbcType=VARCHAR},
252
+      </if>
253
+      <if test="shsj != null" >
254
+        #{shsj,jdbcType=TIMESTAMP},
255
+      </if>
256
+      <if test="createDate != null" >
257
+        #{createDate,jdbcType=TIMESTAMP},
258
+      </if>
259
+      <if test="createPerson != null" >
260
+        #{createPerson,jdbcType=VARCHAR},
261
+      </if>
262
+      <if test="updatetime != null" >
263
+        #{updatetime,jdbcType=TIMESTAMP},
264
+      </if>
265
+    </trim>
266
+  </insert>
267
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgzExample" resultType="java.lang.Integer" >
268
+    select count(*) from business_agent_fcbgz
269
+    <if test="_parameter != null" >
270
+      <include refid="Example_Where_Clause" />
271
+    </if>
272
+  </select>
273
+  <update id="updateByExampleSelective" parameterType="map" >
274
+    update business_agent_fcbgz
275
+    <set >
276
+      <if test="record.id != null" >
277
+        id = #{record.id,jdbcType=INTEGER},
278
+      </if>
279
+      <if test="record.orgId != null" >
280
+        org_id = #{record.orgId,jdbcType=INTEGER},
281
+      </if>
282
+      <if test="record.agentId != null" >
283
+        agent_id = #{record.agentId,jdbcType=INTEGER},
284
+      </if>
285
+      <if test="record.dckId != null" >
286
+        dck_id = #{record.dckId,jdbcType=INTEGER},
287
+      </if>
288
+      <if test="record.houseId != null" >
289
+        house_id = #{record.houseId,jdbcType=INTEGER},
290
+      </if>
291
+      <if test="record.wareId != null" >
292
+        ware_id = #{record.wareId,jdbcType=INTEGER},
293
+      </if>
294
+      <if test="record.lspz != null" >
295
+        lspz = #{record.lspz,jdbcType=INTEGER},
296
+      </if>
297
+      <if test="record.lsxz != null" >
298
+        lsxz = #{record.lsxz,jdbcType=INTEGER},
299
+      </if>
300
+      <if test="record.lsdj != null" >
301
+        lsdj = #{record.lsdj,jdbcType=INTEGER},
302
+      </if>
303
+      <if test="record.fssj != null" >
304
+        fssj = #{record.fssj,jdbcType=TIMESTAMP},
305
+      </if>
306
+      <if test="record.srsl != null" >
307
+        srsl = #{record.srsl,jdbcType=DECIMAL},
308
+      </if>
309
+      <if test="record.zcsl != null" >
310
+        zcsl = #{record.zcsl,jdbcType=DECIMAL},
311
+      </if>
312
+      <if test="record.kcsl != null" >
313
+        kcsl = #{record.kcsl,jdbcType=DECIMAL},
314
+      </if>
315
+      <if test="record.jzr != null" >
316
+        jzr = #{record.jzr,jdbcType=VARCHAR},
317
+      </if>
318
+      <if test="record.jzsj != null" >
319
+        jzsj = #{record.jzsj,jdbcType=TIMESTAMP},
320
+      </if>
321
+      <if test="record.shr != null" >
322
+        shr = #{record.shr,jdbcType=VARCHAR},
323
+      </if>
324
+      <if test="record.shsj != null" >
325
+        shsj = #{record.shsj,jdbcType=TIMESTAMP},
326
+      </if>
327
+      <if test="record.createDate != null" >
328
+        create_date = #{record.createDate,jdbcType=TIMESTAMP},
329
+      </if>
330
+      <if test="record.createPerson != null" >
331
+        create_person = #{record.createPerson,jdbcType=VARCHAR},
332
+      </if>
333
+      <if test="record.updatetime != null" >
334
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
335
+      </if>
336
+    </set>
337
+    <if test="_parameter != null" >
338
+      <include refid="Update_By_Example_Where_Clause" />
339
+    </if>
340
+  </update>
341
+  <update id="updateByExample" parameterType="map" >
342
+    update business_agent_fcbgz
343
+    set id = #{record.id,jdbcType=INTEGER},
344
+      org_id = #{record.orgId,jdbcType=INTEGER},
345
+      agent_id = #{record.agentId,jdbcType=INTEGER},
346
+      dck_id = #{record.dckId,jdbcType=INTEGER},
347
+      house_id = #{record.houseId,jdbcType=INTEGER},
348
+      ware_id = #{record.wareId,jdbcType=INTEGER},
349
+      lspz = #{record.lspz,jdbcType=INTEGER},
350
+      lsxz = #{record.lsxz,jdbcType=INTEGER},
351
+      lsdj = #{record.lsdj,jdbcType=INTEGER},
352
+      fssj = #{record.fssj,jdbcType=TIMESTAMP},
353
+      srsl = #{record.srsl,jdbcType=DECIMAL},
354
+      zcsl = #{record.zcsl,jdbcType=DECIMAL},
355
+      kcsl = #{record.kcsl,jdbcType=DECIMAL},
356
+      jzr = #{record.jzr,jdbcType=VARCHAR},
357
+      jzsj = #{record.jzsj,jdbcType=TIMESTAMP},
358
+      shr = #{record.shr,jdbcType=VARCHAR},
359
+      shsj = #{record.shsj,jdbcType=TIMESTAMP},
360
+      create_date = #{record.createDate,jdbcType=TIMESTAMP},
361
+      create_person = #{record.createPerson,jdbcType=VARCHAR},
362
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
363
+    <if test="_parameter != null" >
364
+      <include refid="Update_By_Example_Where_Clause" />
365
+    </if>
366
+  </update>
367
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgz" >
368
+    update business_agent_fcbgz
369
+    <set >
370
+      <if test="orgId != null" >
371
+        org_id = #{orgId,jdbcType=INTEGER},
372
+      </if>
373
+      <if test="agentId != null" >
374
+        agent_id = #{agentId,jdbcType=INTEGER},
375
+      </if>
376
+      <if test="dckId != null" >
377
+        dck_id = #{dckId,jdbcType=INTEGER},
378
+      </if>
379
+      <if test="houseId != null" >
380
+        house_id = #{houseId,jdbcType=INTEGER},
381
+      </if>
382
+      <if test="wareId != null" >
383
+        ware_id = #{wareId,jdbcType=INTEGER},
384
+      </if>
385
+      <if test="lspz != null" >
386
+        lspz = #{lspz,jdbcType=INTEGER},
387
+      </if>
388
+      <if test="lsxz != null" >
389
+        lsxz = #{lsxz,jdbcType=INTEGER},
390
+      </if>
391
+      <if test="lsdj != null" >
392
+        lsdj = #{lsdj,jdbcType=INTEGER},
393
+      </if>
394
+      <if test="fssj != null" >
395
+        fssj = #{fssj,jdbcType=TIMESTAMP},
396
+      </if>
397
+      <if test="srsl != null" >
398
+        srsl = #{srsl,jdbcType=DECIMAL},
399
+      </if>
400
+      <if test="zcsl != null" >
401
+        zcsl = #{zcsl,jdbcType=DECIMAL},
402
+      </if>
403
+      <if test="kcsl != null" >
404
+        kcsl = #{kcsl,jdbcType=DECIMAL},
405
+      </if>
406
+      <if test="jzr != null" >
407
+        jzr = #{jzr,jdbcType=VARCHAR},
408
+      </if>
409
+      <if test="jzsj != null" >
410
+        jzsj = #{jzsj,jdbcType=TIMESTAMP},
411
+      </if>
412
+      <if test="shr != null" >
413
+        shr = #{shr,jdbcType=VARCHAR},
414
+      </if>
415
+      <if test="shsj != null" >
416
+        shsj = #{shsj,jdbcType=TIMESTAMP},
417
+      </if>
418
+      <if test="createDate != null" >
419
+        create_date = #{createDate,jdbcType=TIMESTAMP},
420
+      </if>
421
+      <if test="createPerson != null" >
422
+        create_person = #{createPerson,jdbcType=VARCHAR},
423
+      </if>
424
+      <if test="updatetime != null" >
425
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
426
+      </if>
427
+    </set>
428
+    where id = #{id,jdbcType=INTEGER}
429
+  </update>
430
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgz" >
431
+    update business_agent_fcbgz
432
+    set org_id = #{orgId,jdbcType=INTEGER},
433
+      agent_id = #{agentId,jdbcType=INTEGER},
434
+      dck_id = #{dckId,jdbcType=INTEGER},
435
+      house_id = #{houseId,jdbcType=INTEGER},
436
+      ware_id = #{wareId,jdbcType=INTEGER},
437
+      lspz = #{lspz,jdbcType=INTEGER},
438
+      lsxz = #{lsxz,jdbcType=INTEGER},
439
+      lsdj = #{lsdj,jdbcType=INTEGER},
440
+      fssj = #{fssj,jdbcType=TIMESTAMP},
441
+      srsl = #{srsl,jdbcType=DECIMAL},
442
+      zcsl = #{zcsl,jdbcType=DECIMAL},
443
+      kcsl = #{kcsl,jdbcType=DECIMAL},
444
+      jzr = #{jzr,jdbcType=VARCHAR},
445
+      jzsj = #{jzsj,jdbcType=TIMESTAMP},
446
+      shr = #{shr,jdbcType=VARCHAR},
447
+      shsj = #{shsj,jdbcType=TIMESTAMP},
448
+      create_date = #{createDate,jdbcType=TIMESTAMP},
449
+      create_person = #{createPerson,jdbcType=VARCHAR},
450
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
451
+    where id = #{id,jdbcType=INTEGER}
452
+  </update>
453
+
454
+  <!-- 查询保管总账列表分组信息 -->
455
+  <select id="selectBgzzGroupByList" parameterType="java.util.Map" resultType="java.util.Map">
456
+  	select 
457
+  	    org_id, agent_id, dck_id, lsxz, lspz, fssj, srsl, zcsl 
458
+  	from (
459
+		SELECT 
460
+	        org_id,
461
+			agent_id,
462
+			dck_id,
463
+			lsxz, 
464
+			lspz, 
465
+			substr(fssj, 1, 7) fssj, 
466
+			sum(srsl) as srsl, 
467
+			sum(zcsl) as zcsl
468
+		FROM business_agent_fcbgz fcbgz 
469
+		where 1=1 AND shr IS NOT NULL 
470
+		<if test="orgId != null">
471
+			AND org_id = #{orgId,jdbcType=INTEGER}
472
+		</if>
473
+		<if test="agentId != null">
474
+	        AND agent_id = #{agentId,jdbcType=INTEGER}
475
+	    </if>
476
+	    <if test="dckId != null">
477
+	        AND dck_id = #{dckId,jdbcType=INTEGER}
478
+	    </if>
479
+	    <if test="lspz != null">
480
+	        AND lspz = #{lspz,jdbcType=INTEGER}
481
+	    </if>
482
+	    <if test="lsxz != null">
483
+	        AND lsxz = #{lsxz,jdbcType=INTEGER}
484
+	    </if>
485
+	    <if test="fssj != null">
486
+	        AND substr(fssj, 1, 7) = #{fssj}
487
+	    </if>
488
+		group by org_id,agent_id, dck_id, lsxz, lspz, fssj
489
+	    )  order by to_date(fssj, 'yyyy-mm') desc
490
+  </select>
491
+  <!-- 查询保管总账列表其它数据 -->
492
+  <select id="selectBgzzList" parameterType="java.util.Map" resultType="java.util.Map">
493
+    select * from (
494
+	    select 
495
+	        b.agent_name agent_Name, 
496
+		    c.agent_depot_name agent_Depot_Name,
497
+		    a.kcsl 
498
+		from business_agent_fcbgz a
499
+		LEFT JOIN business_agent b ON b.id=a.agent_id 
500
+	    LEFT JOIN business_agent_depot c ON c.id=dck_id
501
+	    where 1=1 
502
+	    <if test="org_id != null">
503
+	        AND a.org_id = #{org_id,jdbcType=INTEGER}
504
+	    </if>
505
+		<if test="agent_id != null">
506
+	        AND a.agent_id = #{agent_id,jdbcType=INTEGER}
507
+	    </if>
508
+	    <if test="dck_id != null">
509
+	        AND a.dck_id = #{dck_id,jdbcType=INTEGER}
510
+	    </if>
511
+	    <if test="lspz != null">
512
+	        AND a.lspz = #{lspz,jdbcType=INTEGER}
513
+	    </if>
514
+	    <if test="lsxz != null">
515
+	        AND a.lsxz = #{lsxz,jdbcType=INTEGER}
516
+	    </if>
517
+	    <if test="fssj != null">
518
+	        AND substr(a.fssj, 1,7) = #{fssj}
519
+	    </if>
520
+	    order by to_date(a.fssj, 'yyyy-mm-dd') desc
521
+	) where ROWNUM=1 
522
+  </select>
523
+</mapper>

+ 390 - 0
src/main/java/com/chinaitop/depot/agent/bgz/model/BusinessAgentBgmxz.java

@@ -0,0 +1,390 @@
1
+package com.chinaitop.depot.agent.bgz.model;
2
+
3
+import java.math.BigDecimal;
4
+import java.util.Date;
5
+
6
+public class BusinessAgentBgmxz {
7
+    private Integer id;
8
+
9
+    private Integer orgId;
10
+
11
+    private Integer agentId;
12
+
13
+    private Integer szlkOrgId;
14
+
15
+    private Integer houseId;
16
+
17
+    private Integer wareId;
18
+
19
+    private Integer lspz;
20
+
21
+    private Integer lsxz;
22
+
23
+    private Integer lsdj;
24
+
25
+    private Date fssj;
26
+
27
+    private BigDecimal srsl;
28
+
29
+    private BigDecimal zcsl;
30
+
31
+    private BigDecimal kcsl;
32
+
33
+    private Integer lqgsOrgId;
34
+
35
+    private Integer isJz;
36
+
37
+    private Integer sjly;
38
+
39
+    private String createPerson;
40
+
41
+    private Date createDate;
42
+
43
+    private Date updatetime;
44
+
45
+    /**
46
+     * 主键
47
+     * @return id 主键
48
+     */
49
+    public Integer getId() {
50
+        return id;
51
+    }
52
+
53
+    /**
54
+     * 主键
55
+     * @param id 主键
56
+     */
57
+    public void setId(Integer id) {
58
+        this.id = id;
59
+    }
60
+
61
+    /**
62
+     * 单位ID
63
+     * @return org_id 单位ID
64
+     */
65
+    public Integer getOrgId() {
66
+        return orgId;
67
+    }
68
+
69
+    /**
70
+     * 单位ID
71
+     * @param orgId 单位ID
72
+     */
73
+    public void setOrgId(Integer orgId) {
74
+        this.orgId = orgId;
75
+    }
76
+
77
+    /**
78
+     * 代储库点ID
79
+     * @return agent_id 代储库点ID
80
+     */
81
+    public Integer getAgentId() {
82
+        return agentId;
83
+    }
84
+
85
+    /**
86
+     * 代储库点ID
87
+     * @param agentId 代储库点ID
88
+     */
89
+    public void setAgentId(Integer agentId) {
90
+        this.agentId = agentId;
91
+    }
92
+
93
+    /**
94
+     * 代储粮库单位ID
95
+     * @return szlk_org_id 代储粮库单位ID
96
+     */
97
+    public Integer getSzlkOrgId() {
98
+        return szlkOrgId;
99
+    }
100
+
101
+    /**
102
+     * 代储粮库单位ID
103
+     * @param szlkOrgId 代储粮库单位ID
104
+     */
105
+    public void setSzlkOrgId(Integer szlkOrgId) {
106
+        this.szlkOrgId = szlkOrgId;
107
+    }
108
+
109
+    /**
110
+     * 仓房ID
111
+     * @return house_id 仓房ID
112
+     */
113
+    public Integer getHouseId() {
114
+        return houseId;
115
+    }
116
+
117
+    /**
118
+     * 仓房ID
119
+     * @param houseId 仓房ID
120
+     */
121
+    public void setHouseId(Integer houseId) {
122
+        this.houseId = houseId;
123
+    }
124
+
125
+    /**
126
+     * 货位ID
127
+     * @return ware_id 货位ID
128
+     */
129
+    public Integer getWareId() {
130
+        return wareId;
131
+    }
132
+
133
+    /**
134
+     * 货位ID
135
+     * @param wareId 货位ID
136
+     */
137
+    public void setWareId(Integer wareId) {
138
+        this.wareId = wareId;
139
+    }
140
+
141
+    /**
142
+     * 粮食品种
143
+     * @return lspz 粮食品种
144
+     */
145
+    public Integer getLspz() {
146
+        return lspz;
147
+    }
148
+
149
+    /**
150
+     * 粮食品种
151
+     * @param lspz 粮食品种
152
+     */
153
+    public void setLspz(Integer lspz) {
154
+        this.lspz = lspz;
155
+    }
156
+
157
+    /**
158
+     * 粮食性质
159
+     * @return lsxz 粮食性质
160
+     */
161
+    public Integer getLsxz() {
162
+        return lsxz;
163
+    }
164
+
165
+    /**
166
+     * 粮食性质
167
+     * @param lsxz 粮食性质
168
+     */
169
+    public void setLsxz(Integer lsxz) {
170
+        this.lsxz = lsxz;
171
+    }
172
+
173
+    /**
174
+     * 粮食等级
175
+     * @return lsdj 粮食等级
176
+     */
177
+    public Integer getLsdj() {
178
+        return lsdj;
179
+    }
180
+
181
+    /**
182
+     * 粮食等级
183
+     * @param lsdj 粮食等级
184
+     */
185
+    public void setLsdj(Integer lsdj) {
186
+        this.lsdj = lsdj;
187
+    }
188
+
189
+    /**
190
+     * 业务发生时间
191
+     * @return fssj 业务发生时间
192
+     */
193
+    public Date getFssj() {
194
+        return fssj;
195
+    }
196
+
197
+    /**
198
+     * 业务发生时间
199
+     * @param fssj 业务发生时间
200
+     */
201
+    public void setFssj(Date fssj) {
202
+        this.fssj = fssj;
203
+    }
204
+
205
+    /**
206
+     * 收入数量
207
+     * @return srsl 收入数量
208
+     */
209
+    public BigDecimal getSrsl() {
210
+        return srsl;
211
+    }
212
+
213
+    /**
214
+     * 收入数量
215
+     * @param srsl 收入数量
216
+     */
217
+    public void setSrsl(BigDecimal srsl) {
218
+        this.srsl = srsl;
219
+    }
220
+
221
+    /**
222
+     * 支出数量
223
+     * @return zcsl 支出数量
224
+     */
225
+    public BigDecimal getZcsl() {
226
+        return zcsl;
227
+    }
228
+
229
+    /**
230
+     * 支出数量
231
+     * @param zcsl 支出数量
232
+     */
233
+    public void setZcsl(BigDecimal zcsl) {
234
+        this.zcsl = zcsl;
235
+    }
236
+
237
+    /**
238
+     * 库存数量
239
+     * @return kcsl 库存数量
240
+     */
241
+    public BigDecimal getKcsl() {
242
+        return kcsl;
243
+    }
244
+
245
+    /**
246
+     * 库存数量
247
+     * @param kcsl 库存数量
248
+     */
249
+    public void setKcsl(BigDecimal kcsl) {
250
+        this.kcsl = kcsl;
251
+    }
252
+
253
+    /**
254
+     * 粮权所属单位ID
255
+     * @return lqgs_org_id 粮权所属单位ID
256
+     */
257
+    public Integer getLqgsOrgId() {
258
+        return lqgsOrgId;
259
+    }
260
+
261
+    /**
262
+     * 粮权所属单位ID
263
+     * @param lqgsOrgId 粮权所属单位ID
264
+     */
265
+    public void setLqgsOrgId(Integer lqgsOrgId) {
266
+        this.lqgsOrgId = lqgsOrgId;
267
+    }
268
+
269
+    /**
270
+     * 是否记账
271
+     * @return is_jz 是否记账
272
+     */
273
+    public Integer getIsJz() {
274
+        return isJz;
275
+    }
276
+
277
+    /**
278
+     * 是否记账
279
+     * @param isJz 是否记账
280
+     */
281
+    public void setIsJz(Integer isJz) {
282
+        this.isJz = isJz;
283
+    }
284
+
285
+    /**
286
+     * 数据来源,0手动插入,1同步插入
287
+     * @return sjly 数据来源,0手动插入,1同步插入
288
+     */
289
+    public Integer getSjly() {
290
+        return sjly;
291
+    }
292
+
293
+    /**
294
+     * 数据来源,0手动插入,1同步插入
295
+     * @param sjly 数据来源,0手动插入,1同步插入
296
+     */
297
+    public void setSjly(Integer sjly) {
298
+        this.sjly = sjly;
299
+    }
300
+
301
+    /**
302
+     * 创建人
303
+     * @return create_person 创建人
304
+     */
305
+    public String getCreatePerson() {
306
+        return createPerson;
307
+    }
308
+
309
+    /**
310
+     * 创建人
311
+     * @param createPerson 创建人
312
+     */
313
+    public void setCreatePerson(String createPerson) {
314
+        this.createPerson = createPerson == null ? null : createPerson.trim();
315
+    }
316
+
317
+    /**
318
+     * 创建时间
319
+     * @return create_date 创建时间
320
+     */
321
+    public Date getCreateDate() {
322
+        return createDate;
323
+    }
324
+
325
+    /**
326
+     * 创建时间
327
+     * @param createDate 创建时间
328
+     */
329
+    public void setCreateDate(Date createDate) {
330
+        this.createDate = createDate;
331
+    }
332
+
333
+    /**
334
+     * 
335
+     * @return updatetime 
336
+     */
337
+    public Date getUpdatetime() {
338
+        return updatetime;
339
+    }
340
+
341
+    /**
342
+     * 
343
+     * @param updatetime 
344
+     */
345
+    public void setUpdatetime(Date updatetime) {
346
+        this.updatetime = updatetime;
347
+    }
348
+    
349
+    //后加属性
350
+    private String agentName;
351
+    
352
+    private String agentDepotName;
353
+    
354
+    private String houseName;
355
+    
356
+    private String wareName;
357
+
358
+	public String getAgentName() {
359
+		return agentName;
360
+	}
361
+
362
+	public void setAgentName(String agentName) {
363
+		this.agentName = agentName;
364
+	}
365
+
366
+	public String getAgentDepotName() {
367
+		return agentDepotName;
368
+	}
369
+
370
+	public void setAgentDepotName(String agentDepotName) {
371
+		this.agentDepotName = agentDepotName;
372
+	}
373
+
374
+	public String getHouseName() {
375
+		return houseName;
376
+	}
377
+
378
+	public void setHouseName(String houseName) {
379
+		this.houseName = houseName;
380
+	}
381
+
382
+	public String getWareName() {
383
+		return wareName;
384
+	}
385
+
386
+	public void setWareName(String wareName) {
387
+		this.wareName = wareName;
388
+	}
389
+
390
+}

File diff suppressed because it is too large
+ 1370 - 0
src/main/java/com/chinaitop/depot/agent/bgz/model/BusinessAgentBgmxzExample.java


+ 334 - 0
src/main/java/com/chinaitop/depot/agent/bgz/model/BusinessAgentBgzz.java

@@ -0,0 +1,334 @@
1
+package com.chinaitop.depot.agent.bgz.model;
2
+
3
+import java.math.BigDecimal;
4
+import java.util.Date;
5
+
6
+public class BusinessAgentBgzz {
7
+    private Integer id;
8
+
9
+    private Integer orgId;
10
+
11
+    private Integer agentId;
12
+
13
+    private Integer dckId;
14
+
15
+    private Integer lspz;
16
+
17
+    private Integer lsxz;
18
+
19
+    private String fssj;
20
+
21
+    private BigDecimal srsl;
22
+
23
+    private BigDecimal zcsl;
24
+
25
+    private BigDecimal kcsl;
26
+
27
+    private String jzr;
28
+
29
+    private Date jzsj;
30
+
31
+    private String shr;
32
+
33
+    private Date shsj;
34
+
35
+    private Date createDate;
36
+
37
+    private String createPerson;
38
+
39
+    private Date updatetime;
40
+
41
+    /**
42
+     * 主键
43
+     * @return id 主键
44
+     */
45
+    public Integer getId() {
46
+        return id;
47
+    }
48
+
49
+    /**
50
+     * 主键
51
+     * @param id 主键
52
+     */
53
+    public void setId(Integer id) {
54
+        this.id = id;
55
+    }
56
+
57
+    /**
58
+     * 单位ID
59
+     * @return org_id 单位ID
60
+     */
61
+    public Integer getOrgId() {
62
+        return orgId;
63
+    }
64
+
65
+    /**
66
+     * 单位ID
67
+     * @param orgId 单位ID
68
+     */
69
+    public void setOrgId(Integer orgId) {
70
+        this.orgId = orgId;
71
+    }
72
+
73
+    /**
74
+     * 代储点ID
75
+     * @return agent_id 代储点ID
76
+     */
77
+    public Integer getAgentId() {
78
+        return agentId;
79
+    }
80
+
81
+    /**
82
+     * 代储点ID
83
+     * @param agentId 代储点ID
84
+     */
85
+    public void setAgentId(Integer agentId) {
86
+        this.agentId = agentId;
87
+    }
88
+
89
+    /**
90
+     * 代储库ID
91
+     * @return dck_id 代储库ID
92
+     */
93
+    public Integer getDckId() {
94
+        return dckId;
95
+    }
96
+
97
+    /**
98
+     * 代储库ID
99
+     * @param dckId 代储库ID
100
+     */
101
+    public void setDckId(Integer dckId) {
102
+        this.dckId = dckId;
103
+    }
104
+
105
+    /**
106
+     * 粮食品种
107
+     * @return lspz 粮食品种
108
+     */
109
+    public Integer getLspz() {
110
+        return lspz;
111
+    }
112
+
113
+    /**
114
+     * 粮食品种
115
+     * @param lspz 粮食品种
116
+     */
117
+    public void setLspz(Integer lspz) {
118
+        this.lspz = lspz;
119
+    }
120
+
121
+    /**
122
+     * 粮食性质
123
+     * @return lsxz 粮食性质
124
+     */
125
+    public Integer getLsxz() {
126
+        return lsxz;
127
+    }
128
+
129
+    /**
130
+     * 粮食性质
131
+     * @param lsxz 粮食性质
132
+     */
133
+    public void setLsxz(Integer lsxz) {
134
+        this.lsxz = lsxz;
135
+    }
136
+
137
+    /**
138
+     * 业务发生月份
139
+     * @return fssj 业务发生月份
140
+     */
141
+    public String getFssj() {
142
+        return fssj;
143
+    }
144
+
145
+    /**
146
+     * 业务发生月份
147
+     * @param fssj 业务发生月份
148
+     */
149
+    public void setFssj(String fssj) {
150
+        this.fssj = fssj == null ? null : fssj.trim();
151
+    }
152
+
153
+    /**
154
+     * 收入数量
155
+     * @return srsl 收入数量
156
+     */
157
+    public BigDecimal getSrsl() {
158
+        return srsl;
159
+    }
160
+
161
+    /**
162
+     * 收入数量
163
+     * @param srsl 收入数量
164
+     */
165
+    public void setSrsl(BigDecimal srsl) {
166
+        this.srsl = srsl;
167
+    }
168
+
169
+    /**
170
+     * 支出数量
171
+     * @return zcsl 支出数量
172
+     */
173
+    public BigDecimal getZcsl() {
174
+        return zcsl;
175
+    }
176
+
177
+    /**
178
+     * 支出数量
179
+     * @param zcsl 支出数量
180
+     */
181
+    public void setZcsl(BigDecimal zcsl) {
182
+        this.zcsl = zcsl;
183
+    }
184
+
185
+    /**
186
+     * 库存数量
187
+     * @return kcsl 库存数量
188
+     */
189
+    public BigDecimal getKcsl() {
190
+        return kcsl;
191
+    }
192
+
193
+    /**
194
+     * 库存数量
195
+     * @param kcsl 库存数量
196
+     */
197
+    public void setKcsl(BigDecimal kcsl) {
198
+        this.kcsl = kcsl;
199
+    }
200
+
201
+    /**
202
+     * 记账人
203
+     * @return jzr 记账人
204
+     */
205
+    public String getJzr() {
206
+        return jzr;
207
+    }
208
+
209
+    /**
210
+     * 记账人
211
+     * @param jzr 记账人
212
+     */
213
+    public void setJzr(String jzr) {
214
+        this.jzr = jzr == null ? null : jzr.trim();
215
+    }
216
+
217
+    /**
218
+     * 记账时间
219
+     * @return jzsj 记账时间
220
+     */
221
+    public Date getJzsj() {
222
+        return jzsj;
223
+    }
224
+
225
+    /**
226
+     * 记账时间
227
+     * @param jzsj 记账时间
228
+     */
229
+    public void setJzsj(Date jzsj) {
230
+        this.jzsj = jzsj;
231
+    }
232
+
233
+    /**
234
+     * 审核人
235
+     * @return shr 审核人
236
+     */
237
+    public String getShr() {
238
+        return shr;
239
+    }
240
+
241
+    /**
242
+     * 审核人
243
+     * @param shr 审核人
244
+     */
245
+    public void setShr(String shr) {
246
+        this.shr = shr == null ? null : shr.trim();
247
+    }
248
+
249
+    /**
250
+     * 审核时间
251
+     * @return shsj 审核时间
252
+     */
253
+    public Date getShsj() {
254
+        return shsj;
255
+    }
256
+
257
+    /**
258
+     * 审核时间
259
+     * @param shsj 审核时间
260
+     */
261
+    public void setShsj(Date shsj) {
262
+        this.shsj = shsj;
263
+    }
264
+
265
+    /**
266
+     * 创建时间
267
+     * @return create_date 创建时间
268
+     */
269
+    public Date getCreateDate() {
270
+        return createDate;
271
+    }
272
+
273
+    /**
274
+     * 创建时间
275
+     * @param createDate 创建时间
276
+     */
277
+    public void setCreateDate(Date createDate) {
278
+        this.createDate = createDate;
279
+    }
280
+
281
+    /**
282
+     * 创建人
283
+     * @return create_person 创建人
284
+     */
285
+    public String getCreatePerson() {
286
+        return createPerson;
287
+    }
288
+
289
+    /**
290
+     * 创建人
291
+     * @param createPerson 创建人
292
+     */
293
+    public void setCreatePerson(String createPerson) {
294
+        this.createPerson = createPerson == null ? null : createPerson.trim();
295
+    }
296
+
297
+    /**
298
+     * 
299
+     * @return updatetime 
300
+     */
301
+    public Date getUpdatetime() {
302
+        return updatetime;
303
+    }
304
+
305
+    /**
306
+     * 
307
+     * @param updatetime 
308
+     */
309
+    public void setUpdatetime(Date updatetime) {
310
+        this.updatetime = updatetime;
311
+    }
312
+
313
+    //后加
314
+    private String agentName;
315
+
316
+    private String agentDepotName;
317
+
318
+	public String getAgentName() {
319
+		return agentName;
320
+	}
321
+
322
+	public void setAgentName(String agentName) {
323
+		this.agentName = agentName;
324
+	}
325
+
326
+	public String getAgentDepotName() {
327
+		return agentDepotName;
328
+	}
329
+
330
+	public void setAgentDepotName(String agentDepotName) {
331
+		this.agentDepotName = agentDepotName;
332
+	}
333
+
334
+}

File diff suppressed because it is too large
+ 1280 - 0
src/main/java/com/chinaitop/depot/agent/bgz/model/BusinessAgentBgzzExample.java


+ 407 - 0
src/main/java/com/chinaitop/depot/agent/bgz/model/BusinessAgentFcbgz.java

@@ -0,0 +1,407 @@
1
+package com.chinaitop.depot.agent.bgz.model;
2
+
3
+import java.math.BigDecimal;
4
+import java.util.Date;
5
+
6
+public class BusinessAgentFcbgz {
7
+    private Integer id;
8
+
9
+    private Integer orgId;
10
+
11
+    private Integer agentId;
12
+
13
+    private Integer dckId;
14
+
15
+    private Integer houseId;
16
+
17
+    private Integer wareId;
18
+
19
+    private Integer lspz;
20
+
21
+    private Integer lsxz;
22
+
23
+    private Integer lsdj;
24
+
25
+    private String fssj;
26
+
27
+    private BigDecimal srsl;
28
+
29
+    private BigDecimal zcsl;
30
+
31
+    private BigDecimal kcsl;
32
+
33
+    private String jzr;
34
+
35
+    private Date jzsj;
36
+
37
+    private String shr;
38
+
39
+    private Date shsj;
40
+
41
+    private Date createDate;
42
+
43
+    private String createPerson;
44
+
45
+    private Date updatetime;
46
+
47
+    /**
48
+     * 主键
49
+     * @return id 主键
50
+     */
51
+    public Integer getId() {
52
+        return id;
53
+    }
54
+
55
+    /**
56
+     * 主键
57
+     * @param id 主键
58
+     */
59
+    public void setId(Integer id) {
60
+        this.id = id;
61
+    }
62
+
63
+    /**
64
+     * 单位ID
65
+     * @return org_id 单位ID
66
+     */
67
+    public Integer getOrgId() {
68
+        return orgId;
69
+    }
70
+
71
+    /**
72
+     * 单位ID
73
+     * @param orgId 单位ID
74
+     */
75
+    public void setOrgId(Integer orgId) {
76
+        this.orgId = orgId;
77
+    }
78
+
79
+    /**
80
+     * 代储点ID
81
+     * @return agent_id 代储点ID
82
+     */
83
+    public Integer getAgentId() {
84
+        return agentId;
85
+    }
86
+
87
+    /**
88
+     * 代储点ID
89
+     * @param agentId 代储点ID
90
+     */
91
+    public void setAgentId(Integer agentId) {
92
+        this.agentId = agentId;
93
+    }
94
+
95
+    /**
96
+     * 代储库ID
97
+     * @return dck_id 代储库ID
98
+     */
99
+    public Integer getDckId() {
100
+        return dckId;
101
+    }
102
+
103
+    /**
104
+     * 代储库ID
105
+     * @param dckId 代储库ID
106
+     */
107
+    public void setDckId(Integer dckId) {
108
+        this.dckId = dckId;
109
+    }
110
+
111
+    /**
112
+     * 仓房ID
113
+     * @return house_id 仓房ID
114
+     */
115
+    public Integer getHouseId() {
116
+        return houseId;
117
+    }
118
+
119
+    /**
120
+     * 仓房ID
121
+     * @param houseId 仓房ID
122
+     */
123
+    public void setHouseId(Integer houseId) {
124
+        this.houseId = houseId;
125
+    }
126
+
127
+    /**
128
+     * 货位ID
129
+     * @return ware_id 货位ID
130
+     */
131
+    public Integer getWareId() {
132
+        return wareId;
133
+    }
134
+
135
+    /**
136
+     * 货位ID
137
+     * @param wareId 货位ID
138
+     */
139
+    public void setWareId(Integer wareId) {
140
+        this.wareId = wareId;
141
+    }
142
+
143
+    /**
144
+     * 粮食品种
145
+     * @return lspz 粮食品种
146
+     */
147
+    public Integer getLspz() {
148
+        return lspz;
149
+    }
150
+
151
+    /**
152
+     * 粮食品种
153
+     * @param lspz 粮食品种
154
+     */
155
+    public void setLspz(Integer lspz) {
156
+        this.lspz = lspz;
157
+    }
158
+
159
+    /**
160
+     * 粮食性质
161
+     * @return lsxz 粮食性质
162
+     */
163
+    public Integer getLsxz() {
164
+        return lsxz;
165
+    }
166
+
167
+    /**
168
+     * 粮食性质
169
+     * @param lsxz 粮食性质
170
+     */
171
+    public void setLsxz(Integer lsxz) {
172
+        this.lsxz = lsxz;
173
+    }
174
+
175
+    /**
176
+     * 粮食等级
177
+     * @return lsdj 粮食等级
178
+     */
179
+    public Integer getLsdj() {
180
+        return lsdj;
181
+    }
182
+
183
+    /**
184
+     * 粮食等级
185
+     * @param lsdj 粮食等级
186
+     */
187
+    public void setLsdj(Integer lsdj) {
188
+        this.lsdj = lsdj;
189
+    }
190
+
191
+    /**
192
+     * 业务发生时间
193
+     * @return fssj 业务发生时间
194
+     */
195
+    public String getFssj() {
196
+        return fssj;
197
+    }
198
+
199
+    /**
200
+     * 业务发生时间
201
+     * @param fssj 业务发生时间
202
+     */
203
+    public void setFssj(String fssj) {
204
+        this.fssj = fssj == null ? null : fssj.trim();
205
+    }
206
+
207
+    /**
208
+     * 收入数量
209
+     * @return srsl 收入数量
210
+     */
211
+    public BigDecimal getSrsl() {
212
+        return srsl;
213
+    }
214
+
215
+    /**
216
+     * 收入数量
217
+     * @param srsl 收入数量
218
+     */
219
+    public void setSrsl(BigDecimal srsl) {
220
+        this.srsl = srsl;
221
+    }
222
+
223
+    /**
224
+     * 支出数量
225
+     * @return zcsl 支出数量
226
+     */
227
+    public BigDecimal getZcsl() {
228
+        return zcsl;
229
+    }
230
+
231
+    /**
232
+     * 支出数量
233
+     * @param zcsl 支出数量
234
+     */
235
+    public void setZcsl(BigDecimal zcsl) {
236
+        this.zcsl = zcsl;
237
+    }
238
+
239
+    /**
240
+     * 库存数量
241
+     * @return kcsl 库存数量
242
+     */
243
+    public BigDecimal getKcsl() {
244
+        return kcsl;
245
+    }
246
+
247
+    /**
248
+     * 库存数量
249
+     * @param kcsl 库存数量
250
+     */
251
+    public void setKcsl(BigDecimal kcsl) {
252
+        this.kcsl = kcsl;
253
+    }
254
+
255
+    /**
256
+     * 记账人
257
+     * @return jzr 记账人
258
+     */
259
+    public String getJzr() {
260
+        return jzr;
261
+    }
262
+
263
+    /**
264
+     * 记账人
265
+     * @param jzr 记账人
266
+     */
267
+    public void setJzr(String jzr) {
268
+        this.jzr = jzr == null ? null : jzr.trim();
269
+    }
270
+
271
+    /**
272
+     * 记账时间
273
+     * @return jzsj 记账时间
274
+     */
275
+    public Date getJzsj() {
276
+        return jzsj;
277
+    }
278
+
279
+    /**
280
+     * 记账时间
281
+     * @param jzsj 记账时间
282
+     */
283
+    public void setJzsj(Date jzsj) {
284
+        this.jzsj = jzsj;
285
+    }
286
+
287
+    /**
288
+     * 审核人
289
+     * @return shr 审核人
290
+     */
291
+    public String getShr() {
292
+        return shr;
293
+    }
294
+
295
+    /**
296
+     * 审核人
297
+     * @param shr 审核人
298
+     */
299
+    public void setShr(String shr) {
300
+        this.shr = shr == null ? null : shr.trim();
301
+    }
302
+
303
+    /**
304
+     * 审核时间
305
+     * @return shsj 审核时间
306
+     */
307
+    public Date getShsj() {
308
+        return shsj;
309
+    }
310
+
311
+    /**
312
+     * 审核时间
313
+     * @param shsj 审核时间
314
+     */
315
+    public void setShsj(Date shsj) {
316
+        this.shsj = shsj;
317
+    }
318
+
319
+    /**
320
+     * 创建时间
321
+     * @return create_date 创建时间
322
+     */
323
+    public Date getCreateDate() {
324
+        return createDate;
325
+    }
326
+
327
+    /**
328
+     * 创建时间
329
+     * @param createDate 创建时间
330
+     */
331
+    public void setCreateDate(Date createDate) {
332
+        this.createDate = createDate;
333
+    }
334
+
335
+    /**
336
+     * 创建人
337
+     * @return create_person 创建人
338
+     */
339
+    public String getCreatePerson() {
340
+        return createPerson;
341
+    }
342
+
343
+    /**
344
+     * 创建人
345
+     * @param createPerson 创建人
346
+     */
347
+    public void setCreatePerson(String createPerson) {
348
+        this.createPerson = createPerson == null ? null : createPerson.trim();
349
+    }
350
+
351
+    /**
352
+     * 
353
+     * @return updatetime 
354
+     */
355
+    public Date getUpdatetime() {
356
+        return updatetime;
357
+    }
358
+
359
+    /**
360
+     * 
361
+     * @param updatetime 
362
+     */
363
+    public void setUpdatetime(Date updatetime) {
364
+        this.updatetime = updatetime;
365
+    }
366
+
367
+    //后加属性
368
+    private String agentName;
369
+
370
+    private String agentDepotName;
371
+
372
+    private String houseName;
373
+
374
+    private String wareName;
375
+
376
+	public String getAgentName() {
377
+		return agentName;
378
+	}
379
+
380
+	public void setAgentName(String agentName) {
381
+		this.agentName = agentName;
382
+	}
383
+
384
+	public String getAgentDepotName() {
385
+		return agentDepotName;
386
+	}
387
+
388
+	public void setAgentDepotName(String agentDepotName) {
389
+		this.agentDepotName = agentDepotName;
390
+	}
391
+
392
+	public String getHouseName() {
393
+		return houseName;
394
+	}
395
+
396
+	public void setHouseName(String houseName) {
397
+		this.houseName = houseName;
398
+	}
399
+
400
+	public String getWareName() {
401
+		return wareName;
402
+	}
403
+
404
+	public void setWareName(String wareName) {
405
+		this.wareName = wareName;
406
+	}
407
+}

File diff suppressed because it is too large
+ 1460 - 0
src/main/java/com/chinaitop/depot/agent/bgz/model/BusinessAgentFcbgzExample.java


+ 87 - 0
src/main/java/com/chinaitop/depot/agent/bgz/service/BusinessAgentBgmxzService.java

@@ -0,0 +1,87 @@
1
+package com.chinaitop.depot.agent.bgz.service;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+
6
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepot;
7
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxz;
8
+
9
+public interface BusinessAgentBgmxzService {
10
+
11
+	/**
12
+	 * 查询保管明细账列表数据
13
+	 * 
14
+	 * @param example 条件
15
+	 * @return
16
+	 */
17
+	List<BusinessAgentBgmxz> findByConditions(Map<String, Object> parem_map);
18
+
19
+	/**
20
+	 * 按ID查询一条保管明细账数据
21
+	 * 
22
+	 * @param id 数据ID
23
+	 * @return
24
+	 */
25
+	BusinessAgentBgmxz findByParmaryKey(Integer id);
26
+
27
+	/**
28
+	 * 新增保管明细账
29
+	 * 
30
+	 * @param bgmxz 数据对象
31
+	 */
32
+	void insert(BusinessAgentBgmxz bgmxz);
33
+
34
+	/**
35
+	 * 修改保管明细账
36
+	 * 
37
+	 * @param bgmxz 数据对象
38
+	 */
39
+	void update(BusinessAgentBgmxz bgmxz);
40
+
41
+	/**
42
+	 * 删除一条保管明细账数据
43
+	 * 
44
+	 * @param id 数据ID
45
+	 */
46
+	void remove(Integer id);
47
+
48
+	/**
49
+	 * 查询分仓保管账分组列表 
50
+	 * 
51
+	 * @param map 条件
52
+	 * @return
53
+	 */
54
+	List<Map<String, Object>> selectFcbgzGroupBy(Map<String, Object> map);
55
+
56
+	/**
57
+	 * 查询分仓保管账列表库存数量等其它数据 
58
+	 * 
59
+	 * @param map 条件
60
+	 * @return
61
+	 */
62
+	Map<String, Object> selectDetail(Map<String, Object> map);
63
+
64
+	/**
65
+     * 查询代储库正常使用的货位数据信息
66
+     * 
67
+     * @param paramMap 条件
68
+     * @return
69
+     */
70
+    List<Map<String, Object>> selectAgentHouseWareList(Map<String, Object> paramMap);
71
+
72
+    /**
73
+     * 按条件查询代储库数据
74
+     * 
75
+     * @param orgId 当前单位ID
76
+     * @param dckId 代储库ID
77
+     * @return
78
+     */
79
+    BusinessAgentDepot selectAgentDepotObj(Integer orgId, Integer dckId);
80
+
81
+    /**
82
+     * 修改代储货位表的最后修改时间
83
+     * 
84
+     * @param orgId 单位ID
85
+     */
86
+	void updateAgentDepot(Integer orgId);
87
+}

+ 32 - 0
src/main/java/com/chinaitop/depot/agent/bgz/service/BusinessAgentBgzzService.java

@@ -0,0 +1,32 @@
1
+package com.chinaitop.depot.agent.bgz.service;
2
+
3
+import java.util.List;
4
+
5
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzz;
6
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzzExample;
7
+
8
+public interface BusinessAgentBgzzService {
9
+
10
+	/**
11
+	 * 按条件查询数据
12
+	 * 
13
+	 * @param example 条件
14
+	 * @return
15
+	 */
16
+	List<BusinessAgentBgzz> findByConditions(BusinessAgentBgzzExample example);
17
+
18
+	/**
19
+	 * 更新数据
20
+	 * 
21
+	 * @param fcbgz 数据对象
22
+	 */
23
+	void update(BusinessAgentBgzz bgzz);
24
+
25
+	/**
26
+	 * 插入数据
27
+	 * 
28
+	 * @param fcbgz 数据对象
29
+	 */
30
+	void insert(BusinessAgentBgzz bgzz);
31
+
32
+}

+ 62 - 0
src/main/java/com/chinaitop/depot/agent/bgz/service/BusinessAgentFcbgzService.java

@@ -0,0 +1,62 @@
1
+package com.chinaitop.depot.agent.bgz.service;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+
6
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgz;
7
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgzExample;
8
+
9
+public interface BusinessAgentFcbgzService {
10
+
11
+	/**
12
+	 * 按条件查询数据
13
+	 * 
14
+	 * @param example 条件
15
+	 * @return
16
+	 */
17
+	List<BusinessAgentFcbgz> findByConditions(BusinessAgentFcbgzExample example);
18
+
19
+	/**
20
+	 * 更新数据
21
+	 * 
22
+	 * @param fcbgz 数据对象
23
+	 */
24
+	void update(BusinessAgentFcbgz fcbgz);
25
+
26
+	/**
27
+	 * 插入数据
28
+	 * 
29
+	 * @param fcbgz 数据对象
30
+	 */
31
+	void insert(BusinessAgentFcbgz fcbgz);
32
+
33
+	/**
34
+	 * 删除数据
35
+	 * 
36
+	 * @param id 数据ID
37
+	 */
38
+	void remove(Integer id);
39
+
40
+	/**
41
+     * 查询保管总账列表分组信息
42
+     * 
43
+     * @param map 参数
44
+     * @return
45
+     */
46
+    List<Map<String, Object>> selectBgzzGroupByList(Map<String, Object> map);
47
+
48
+	/**
49
+	 * 查询保管总账列表其它数据
50
+	 * 
51
+	 * @param map 条件
52
+	 * @return
53
+	 */
54
+	Map<String, Object> selectBgzzList(Map<String, Object> map);
55
+
56
+	/**
57
+	 * 按条件将保管明细账数据修改为已记账
58
+	 * 
59
+	 * @param fcbgz 条件
60
+	 */
61
+	void updateSfjz(BusinessAgentFcbgz fcbgz);
62
+}

+ 107 - 0
src/main/java/com/chinaitop/depot/agent/bgz/service/impl/BusinessAgentBgmxzServiceImpl.java

@@ -0,0 +1,107 @@
1
+package com.chinaitop.depot.agent.bgz.service.impl;
2
+
3
+import java.util.Date;
4
+import java.util.List;
5
+import java.util.Map;
6
+
7
+import javax.annotation.Resource;
8
+
9
+import org.springframework.stereotype.Service;
10
+
11
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentDepotMapper;
12
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentWarehouseMapper;
13
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepot;
14
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepotExample;
15
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse;
16
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouseExample;
17
+import com.chinaitop.depot.agent.bgz.mapper.BusinessAgentBgmxzMapper;
18
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxz;
19
+import com.chinaitop.depot.agent.bgz.service.BusinessAgentBgmxzService;
20
+
21
+@Service
22
+public class BusinessAgentBgmxzServiceImpl implements BusinessAgentBgmxzService {
23
+
24
+	@Resource
25
+	private BusinessAgentBgmxzMapper bgmxzMapper;
26
+	
27
+	@Resource
28
+	private BusinessAgentDepotMapper agentDepotMapper;
29
+	
30
+	@Resource
31
+	private BusinessAgentWarehouseMapper agentWareHouseMapper;
32
+
33
+	@Override
34
+	public List<BusinessAgentBgmxz> findByConditions(Map<String, Object> parem_map) {
35
+		List<BusinessAgentBgmxz> list = bgmxzMapper.selectByExampleNew(parem_map);
36
+		return list;
37
+	}
38
+
39
+	@Override
40
+	public BusinessAgentBgmxz findByParmaryKey(Integer id) {
41
+		BusinessAgentBgmxz bgmxz = bgmxzMapper.selectByPrimaryKey(id);
42
+		return bgmxz;
43
+	}
44
+
45
+	@Override
46
+	public void insert(BusinessAgentBgmxz bgmxz) {
47
+		bgmxzMapper.insertSelective(bgmxz);
48
+	}
49
+
50
+	@Override
51
+	public void update(BusinessAgentBgmxz bgmxz) {
52
+		bgmxzMapper.updateByPrimaryKey(bgmxz);
53
+	}
54
+
55
+	@Override
56
+	public void remove(Integer id) {
57
+		bgmxzMapper.deleteByPrimaryKey(id);
58
+	}
59
+
60
+	@Override
61
+	public Map<String, Object> selectDetail(Map<String, Object> map) {
62
+		
63
+		Map<String, Object> list = bgmxzMapper.selectDetail(map);
64
+		return list;
65
+	}
66
+
67
+	@Override
68
+	public List<Map<String, Object>> selectAgentHouseWareList(Map<String, Object> paramMap) {
69
+		List<Map<String, Object>> list = bgmxzMapper.selectAgentHouseWareList(paramMap);
70
+		return list;
71
+	}
72
+
73
+	@Override
74
+	public BusinessAgentDepot selectAgentDepotObj(Integer orgId, Integer dckId) {
75
+		BusinessAgentDepotExample example = new BusinessAgentDepotExample();
76
+		BusinessAgentDepotExample.Criteria criteria = example.createCriteria();
77
+		criteria.andOrgIdEqualTo(orgId);
78
+		criteria.andDepotIdEqualTo(dckId);
79
+		criteria.andDelFlagEqualTo(1);
80
+		List<BusinessAgentDepot> list = agentDepotMapper.selectByExample(example);
81
+		BusinessAgentDepot agentDepot = new BusinessAgentDepot();
82
+		if (null != list && list.size() > 0) {
83
+			agentDepot = list.get(0);
84
+		}
85
+		return agentDepot;
86
+	}
87
+
88
+	@Override
89
+	public void updateAgentDepot(Integer orgId) {
90
+		//要修改的值
91
+		BusinessAgentWarehouse record = new BusinessAgentWarehouse();
92
+		record.setBgmxzTbsj(new Date());
93
+		//修改条件
94
+		BusinessAgentWarehouseExample example = new BusinessAgentWarehouseExample();
95
+		BusinessAgentWarehouseExample.Criteria criteria = example.createCriteria();
96
+		criteria.andOrgIdEqualTo(orgId);
97
+		criteria.andDelFlagEqualTo(1);
98
+		agentWareHouseMapper.updateByExampleSelective(record, example);
99
+	}
100
+
101
+	@Override
102
+	public List<Map<String, Object>> selectFcbgzGroupBy(Map<String, Object> map) {
103
+		List<Map<String, Object>> list = bgmxzMapper.selectFcbgzGroupBy(map);
104
+		return list;
105
+	}
106
+
107
+}

+ 36 - 0
src/main/java/com/chinaitop/depot/agent/bgz/service/impl/BusinessAgentBgzzServiceImpl.java

@@ -0,0 +1,36 @@
1
+package com.chinaitop.depot.agent.bgz.service.impl;
2
+
3
+import java.util.List;
4
+
5
+import javax.annotation.Resource;
6
+
7
+import org.springframework.stereotype.Service;
8
+
9
+import com.chinaitop.depot.agent.bgz.mapper.BusinessAgentBgzzMapper;
10
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzz;
11
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgzzExample;
12
+import com.chinaitop.depot.agent.bgz.service.BusinessAgentBgzzService;
13
+
14
+@Service
15
+public class BusinessAgentBgzzServiceImpl implements BusinessAgentBgzzService {
16
+
17
+	@Resource
18
+	private BusinessAgentBgzzMapper bgzzMapper;
19
+	
20
+	@Override
21
+	public List<BusinessAgentBgzz> findByConditions(BusinessAgentBgzzExample example) {
22
+		List<BusinessAgentBgzz> list = bgzzMapper.selectByExample(example);
23
+		return list;
24
+	}
25
+
26
+	@Override
27
+	public void update(BusinessAgentBgzz bgzz) {
28
+		bgzzMapper.updateByPrimaryKey(bgzz);
29
+	}
30
+
31
+	@Override
32
+	public void insert(BusinessAgentBgzz bgzz) {
33
+		bgzzMapper.insert(bgzz);
34
+	}
35
+
36
+}

+ 84 - 0
src/main/java/com/chinaitop/depot/agent/bgz/service/impl/BusinessAgentFcbgzServiceImpl.java

@@ -0,0 +1,84 @@
1
+package com.chinaitop.depot.agent.bgz.service.impl;
2
+
3
+import java.util.Date;
4
+import java.util.List;
5
+import java.util.Map;
6
+
7
+import javax.annotation.Resource;
8
+
9
+import org.springframework.stereotype.Service;
10
+
11
+import com.chinaitop.depot.agent.bgz.mapper.BusinessAgentBgmxzMapper;
12
+import com.chinaitop.depot.agent.bgz.mapper.BusinessAgentFcbgzMapper;
13
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxz;
14
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxzExample;
15
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentBgmxzExample.Criteria;
16
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgz;
17
+import com.chinaitop.depot.agent.bgz.model.BusinessAgentFcbgzExample;
18
+import com.chinaitop.depot.agent.bgz.service.BusinessAgentFcbgzService;
19
+import com.chinaitop.utils.ParameterUtil;
20
+
21
+@Service
22
+public class BusinessAgentFcbgzServiceImpl implements BusinessAgentFcbgzService {
23
+
24
+	@Resource
25
+	private BusinessAgentFcbgzMapper fcbgzMapper;
26
+
27
+	@Resource
28
+	private BusinessAgentBgmxzMapper bgmxzMapper;
29
+
30
+	@Override
31
+	public List<BusinessAgentFcbgz> findByConditions(BusinessAgentFcbgzExample example) {
32
+		return fcbgzMapper.selectByExample(example);
33
+	}
34
+
35
+	@Override
36
+	public void update(BusinessAgentFcbgz fcbgz) {
37
+		fcbgzMapper.updateByPrimaryKey(fcbgz);
38
+	}
39
+
40
+	@Override
41
+	public void insert(BusinessAgentFcbgz fcbgz) {
42
+		fcbgzMapper.insert(fcbgz);
43
+	}
44
+
45
+	@Override
46
+	public void remove(Integer id) {
47
+		fcbgzMapper.deleteByPrimaryKey(id);
48
+	}
49
+
50
+	@Override
51
+	public List<Map<String, Object>> selectBgzzGroupByList(Map<String, Object> map) {
52
+		List<Map<String, Object>> list = fcbgzMapper.selectBgzzGroupByList(map);
53
+		return list;
54
+	}
55
+
56
+	@Override
57
+	public Map<String, Object> selectBgzzList(Map<String, Object> map) {
58
+		Map<String, Object> list = fcbgzMapper.selectBgzzList(map);
59
+		return list;
60
+	}
61
+
62
+	@Override
63
+	public void updateSfjz(BusinessAgentFcbgz fcbgz) {
64
+		/* 设置要修改的数据 */
65
+		BusinessAgentBgmxz bgmxz = new BusinessAgentBgmxz();
66
+		bgmxz.setIsJz(1);
67
+
68
+		/* 设置修改条件 */
69
+		BusinessAgentBgmxzExample example = new BusinessAgentBgmxzExample();
70
+		Criteria criteria = example.createCriteria();
71
+		criteria.andAgentIdEqualTo(fcbgz.getAgentId());//代储点
72
+		criteria.andSzlkOrgIdEqualTo(fcbgz.getDckId());//代储粮库
73
+		criteria.andHouseIdEqualTo(fcbgz.getHouseId());//仓房
74
+		criteria.andWareIdEqualTo(fcbgz.getWareId());//货位
75
+		criteria.andLspzEqualTo(fcbgz.getLspz());//粮食品种
76
+		criteria.andLsxzEqualTo(fcbgz.getLsxz());//粮食性质
77
+		Date startTime = ParameterUtil.string2datetime(fcbgz.getFssj()+" 00:00:00");
78
+		Date endTime = ParameterUtil.string2datetime(fcbgz.getFssj()+" 23:59:59");
79
+		criteria.andFssjBetween(startTime, endTime);
80
+		
81
+		bgmxzMapper.updateByExampleSelective(bgmxz, example);
82
+	}
83
+
84
+}

+ 296 - 0
src/main/java/com/chinaitop/depot/agent/crk/controller/AgentHcController.java

@@ -0,0 +1,296 @@
1
+package com.chinaitop.depot.agent.crk.controller;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.HashMap;
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+import javax.annotation.Resource;
10
+import javax.servlet.http.HttpServletRequest;
11
+
12
+import org.springframework.http.MediaType;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RestController;
16
+import org.springframework.web.multipart.MultipartFile;
17
+
18
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepot;
19
+import com.chinaitop.depot.agent.basic.service.agentService;
20
+import com.chinaitop.depot.agent.bgz.service.BusinessAgentBgmxzService;
21
+import com.chinaitop.depot.agent.crk.model.BusinessAgentHc;
22
+import com.chinaitop.depot.agent.crk.service.agentHcService;
23
+import com.chinaitop.depot.utils.ImportServiceImpl;
24
+import com.chinaitop.utils.ParameterUtil;
25
+import com.fasterxml.jackson.databind.ObjectMapper;
26
+import com.github.pagehelper.PageHelper;
27
+import com.github.pagehelper.PageInfo;
28
+
29
+import io.swagger.annotations.Api;
30
+import io.swagger.annotations.ApiImplicitParam;
31
+import io.swagger.annotations.ApiImplicitParams;
32
+import io.swagger.annotations.ApiOperation;
33
+import net.sf.json.JSONArray;
34
+import net.sf.json.JSONObject;
35
+
36
+@RestController
37
+@RequestMapping(value = "/agentHc")
38
+@Api(description = "火车出入库")
39
+public class AgentHcController {
40
+
41
+    @Resource
42
+    private agentHcService agentHcService;
43
+
44
+    @Resource
45
+    private agentService agentService;
46
+
47
+    @Resource
48
+    private ImportServiceImpl importService;
49
+
50
+    @Resource
51
+    private BusinessAgentBgmxzService bgmxzService;
52
+
53
+    /**
54
+     * 查询火车出入库信息记录
55
+     * @param pageNum
56
+     * @param pageSize
57
+     * @return
58
+     */
59
+    @RequestMapping(value = "/getAgentHcList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
60
+    @ApiOperation(value="火车出入库信息", notes = "查询火车出入库信息记录")
61
+    @ApiImplicitParams({
62
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
63
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
64
+            @ApiImplicitParam(name = "agentId", value = "代储点id", paramType = "query"),
65
+            @ApiImplicitParam(name = "agentDepotId", value = "代储库id", paramType = "query"),
66
+            @ApiImplicitParam(name = "storehouseId", value = "仓房id", paramType = "query"),
67
+            @ApiImplicitParam(name = "warehouseId", value = "货位id", paramType = "query"),
68
+            @ApiImplicitParam(name = "businessType", value = "业务类型", paramType = "query"),
69
+            @ApiImplicitParam(name = "lspz", value = "粮食品种", paramType = "query"),
70
+            @ApiImplicitParam(name = "orgid", value = "组织id", paramType = "query")
71
+    })
72
+    public PageInfo<Map<String, Object>> getAgentHcList(Integer pageNum, Integer pageSize, Integer agentId, Integer agentDepotId,
73
+                                                                Integer storehouseId, Integer warehouseId, String businessType, Integer lspz, String orgid){
74
+        Map<String,Object> map = new HashMap<>();
75
+        map.put("orgId",orgid);
76
+        if(ParameterUtil.isnotnull(agentId)){
77
+            map.put("agentId",agentId);
78
+        }
79
+        if(ParameterUtil.isnotnull(agentDepotId)){
80
+            map.put("agentDepotId",agentDepotId);
81
+        }
82
+        if(ParameterUtil.isnotnull(storehouseId)){
83
+            map.put("storehouseId",storehouseId);
84
+        }
85
+        if(ParameterUtil.isnotnull(warehouseId)){
86
+            map.put("warehouseId",warehouseId);
87
+        }
88
+        if (ParameterUtil.isnotnull(businessType)) {
89
+            if (businessType.equals("2")) {
90
+                map.put("businessType","火车入仓");
91
+            } else if (businessType.equals("4")) {
92
+                map.put("businessType","火车出仓");
93
+            }
94
+        }
95
+        if(ParameterUtil.isnotnull(lspz)){
96
+            map.put("lspz",lspz);
97
+        }
98
+
99
+        PageHelper.startPage(pageNum, pageSize);
100
+        List<Map<String, Object>> list = agentHcService.getAgentHcList(map);
101
+        PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(list);
102
+        //处理驼峰命名大写问题
103
+        List<Map<String, Object>> page_list = ParameterUtil.slashCapitals(pageInfo.getList());
104
+        pageInfo.setList(page_list);
105
+        return pageInfo;
106
+    }
107
+
108
+    /**
109
+     * 保存火车出入库信息
110
+     * @param agentHcJson 主键id
111
+     * @return
112
+     * @throws Exception
113
+     */
114
+    @RequestMapping(value="/saveAgent", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
115
+    @ApiOperation(value="保存火车出入库", notes = "保存火车出入库信息")
116
+    @ApiImplicitParams({
117
+            @ApiImplicitParam(name = "agentHcJson", value = "火车出入库信息", paramType = "form")
118
+    })
119
+    public Map<String, Object> saveAgent(String agentHcJson,Integer orgId) throws Exception {
120
+        Map<String, Object> modelMap = new HashMap<String, Object>();
121
+        // JSON字符串转对象
122
+        ObjectMapper mapper = new ObjectMapper();
123
+        BusinessAgentHc agent = (BusinessAgentHc)mapper.readValue(agentHcJson, BusinessAgentHc.class);
124
+        if (ParameterUtil.isnull(agent.getId())) {
125
+            agent.setOrgId(orgId);
126
+            agent.setCreateTime(ParameterUtil.string2date(ParameterUtil.getSysDateTime()));//创建时间
127
+            agentHcService.add(agent);
128
+        } else {
129
+            agentHcService.update(agent);
130
+        }
131
+        modelMap.put("agentId", agent.getId());
132
+        modelMap.put("status", "success");
133
+        return modelMap;
134
+    }
135
+
136
+    /**
137
+     * 删除火车出入库信息
138
+     * @param id 主键id
139
+     * @return
140
+     */
141
+    @RequestMapping(value="/removeAgentHc", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
142
+    @ApiOperation(value="删除火车出入库信息", notes = "删除火车出入库信息")
143
+    @ApiImplicitParams({
144
+            @ApiImplicitParam(name = "id", value = "火车出入库主键id", paramType = "form")
145
+    })
146
+    public Map<String, Object> removeAgentHc(Integer id){
147
+        Map<String, Object> modelMap = new HashMap<>();
148
+        if (id != null) {
149
+            agentHcService.updateDeleteById(id);
150
+            modelMap.put("status", "success");
151
+        }
152
+        return modelMap;
153
+    }
154
+
155
+    /**
156
+     * 根据id查找火车出入库信息
157
+     * @param id 主键id
158
+     * @return
159
+     */
160
+    @RequestMapping(value="/getAgentHcEdit", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
161
+    @ApiOperation(value="根据id查找火车出入库信息", notes = "根据id查找火车出入库信息")
162
+    @ApiImplicitParams({
163
+            @ApiImplicitParam(name = "id", value = "火车出入库主键id", paramType = "query")
164
+    })
165
+    public BusinessAgentHc getAgentHcEdit(Integer id) {
166
+        BusinessAgentHc agent = new BusinessAgentHc();
167
+        if (id != null) {
168
+            agent = agentHcService.findById(id);
169
+        }
170
+        return agent;
171
+    }
172
+
173
+    /**
174
+     * 导入excel
175
+     * @param file 文件
176
+     * @param fileType 类型:如xlsx
177
+     * @param orgId 组织机构id
178
+     * @return
179
+     */
180
+    @RequestMapping(value="/importFile", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
181
+    @ApiOperation(value="导入excel", notes = "导入excel")
182
+    @ApiImplicitParams({
183
+            @ApiImplicitParam(name = "file", value = "文件数据", paramType = "query"),
184
+            @ApiImplicitParam(name = "fileType", value = "文件名", paramType = "query"),
185
+            @ApiImplicitParam(name = "rootPath", value = "路径", paramType = "query"),
186
+            @ApiImplicitParam(name = "orgId", value = "组织机构id", paramType = "query")
187
+    })
188
+    public Map<String, Object> importFile(MultipartFile file, String fileType, HttpServletRequest request, Integer orgId){
189
+
190
+        String[] titleArr = {"通知单编号", "入站单号", "火车皮号", "业务类型", "粮油品种",
191
+                "数量(公斤)", "仓房名称", "货位名称", "出入库日期"};//第一行的title
192
+        boolean[] emptyArr = {false, false, false, false, false,
193
+                false, false, false, false};//指定列可为空,不可为空值为false.
194
+
195
+        List<List<String>> list = new ArrayList<List<String>>();//该list为数据返回的list
196
+        Map<String, Object> fileMap = new HashMap<>();
197
+        String errormsg = null;
198
+        try {
199
+        	errormsg = importService.importFile(file, fileType, request, titleArr, emptyArr, list,1);
200
+
201
+            if (errormsg != null && !"".equals(errormsg)) {
202
+                fileMap.put("errormsg",errormsg);
203
+                return fileMap;
204
+            }
205
+
206
+            //查询代储点名称和代储库名称对应的id
207
+            Map<String, Object> agentMap = agentService.getNameId(importService.nameData(file, fileType, request));
208
+            if(ParameterUtil.isnull(agentMap)){
209
+                fileMap.put("errormsg","代储点与代储库无关联,请查询后添加!");
210
+                return fileMap;
211
+            }
212
+
213
+            if (list.size()>0) {
214
+                errormsg = agentHcService.importData(list, orgId, agentMap);
215
+            }
216
+        } catch (Exception e) {
217
+            e.printStackTrace();
218
+        }
219
+        fileMap.put("errormsg",errormsg);
220
+        return fileMap;
221
+    }
222
+
223
+    @RequestMapping(value="/selectAgentHouseWareList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
224
+	@ApiOperation(value="查询代储库正常使用的货位数据信息", notes = "查询代储库正常使用的货位数据信息")
225
+	@ApiImplicitParams({
226
+		@ApiImplicitParam(name="orgId", value="当前单位ID", paramType="query")
227
+	})
228
+	public List<Map<String, Object>> selectAgentHouseWareList(Integer orgId) {
229
+
230
+		Map<String, Object> paramMap = new HashMap<String, Object>();
231
+
232
+		paramMap.put("orgId", orgId);
233
+		List<Map<String, Object>> list = agentHcService.selectAgentHouseWareList(paramMap);
234
+
235
+		return list;
236
+	}
237
+    
238
+    @RequestMapping(value="/editQcCrkRecordData", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
239
+	@ApiOperation(value="同步功能", notes = "把出入库拿来的汽车出入库记录数据插入到代储库业务的汽车出入库记录表中")
240
+	@ApiImplicitParams({
241
+		@ApiImplicitParam(name="qcCrkRecordData", value="汽车出入库记录数据", paramType="form"),
242
+		@ApiImplicitParam(name="orgId", value="当前单位ID", paramType="form"),
243
+		@ApiImplicitParam(name="realName", value="当前操作人", paramType="form")
244
+	})
245
+	public Map<String, Object> editQcCrkRecordData(String hcCrkRecordData, Integer orgId, String realName) {
246
+
247
+		Map<String, Object> map = new HashMap<String, Object>();
248
+
249
+		try {
250
+			JSONArray json = JSONArray.fromObject(hcCrkRecordData);
251
+			if (json.size() > 0) {
252
+				BusinessAgentHc agentHc = null;
253
+				for (int i = 0; i < json.size(); i++) {
254
+					
255
+					JSONObject job = json.getJSONObject(i);
256
+					Integer unitId = Integer.parseInt(job.get("unitid")+"");
257
+					BusinessAgentDepot agentDepot = bgmxzService.selectAgentDepotObj(orgId, unitId);
258
+					Integer agentDepotId = agentDepot.getId();
259
+					Integer agentId = Integer.parseInt(agentDepot.getAgentId());
260
+					Integer houseId = Integer.parseInt(job.get("houseId")+"");
261
+					Integer wareId = Integer.parseInt(job.get("wareId")+"");
262
+
263
+					agentHc = new BusinessAgentHc();
264
+					agentHc.setOrgId(orgId);
265
+					agentHc.setAgentId(agentId);
266
+					agentHc.setAgentDepotId(agentDepotId);
267
+					agentHc.setNotice(job.get("tzdbh")+"");
268
+					agentHc.setInbound(job.get("bizNo")+"");
269
+					agentHc.setTrainNo(job.get("hcph")+"");
270
+					String businessType = job.get("ywlx")+"";
271
+					agentHc.setBusinessType(businessType);
272
+					agentHc.setLspz(Integer.parseInt(job.get("lspzid")+""));
273
+					agentHc.setGrainNumber(job.get("count")+"");
274
+					agentHc.setStorehouseId(houseId);
275
+					agentHc.setWarehouseId(wareId);
276
+					Date crk_time = ParameterUtil.string2date(job.get("rq")+"");
277
+					agentHc.setCrkTime(crk_time);
278
+					agentHc.setCreateTime(new Date());
279
+					agentHc.setSjly(1);
280
+
281
+					agentHcService.add(agentHc);
282
+				}
283
+
284
+				//修改代储点货位表的汽车出入库最后同步时间
285
+				agentHcService.updateAgentDepot(orgId);
286
+			}
287
+			map.put("status", "200");
288
+			map.put("msg", "操作成功!");
289
+		} catch (NumberFormatException e) {
290
+			map.put("msg", "操作失败!");
291
+			e.printStackTrace();
292
+		}
293
+
294
+		return map;
295
+	}
296
+}

+ 303 - 0
src/main/java/com/chinaitop/depot/agent/crk/controller/AgentQcController.java

@@ -0,0 +1,303 @@
1
+package com.chinaitop.depot.agent.crk.controller;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.HashMap;
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+import javax.annotation.Resource;
10
+import javax.servlet.http.HttpServletRequest;
11
+
12
+import org.springframework.http.MediaType;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RestController;
16
+import org.springframework.web.multipart.MultipartFile;
17
+
18
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepot;
19
+import com.chinaitop.depot.agent.basic.service.agentService;
20
+import com.chinaitop.depot.agent.bgz.service.BusinessAgentBgmxzService;
21
+import com.chinaitop.depot.agent.crk.model.BusinessAgentQc;
22
+import com.chinaitop.depot.agent.crk.service.agentQcService;
23
+import com.chinaitop.depot.utils.ImportServiceImpl;
24
+import com.chinaitop.utils.ParameterUtil;
25
+import com.fasterxml.jackson.databind.ObjectMapper;
26
+import com.github.pagehelper.PageHelper;
27
+import com.github.pagehelper.PageInfo;
28
+
29
+import io.swagger.annotations.Api;
30
+import io.swagger.annotations.ApiImplicitParam;
31
+import io.swagger.annotations.ApiImplicitParams;
32
+import io.swagger.annotations.ApiOperation;
33
+import net.sf.json.JSONArray;
34
+import net.sf.json.JSONObject;
35
+
36
+@RestController
37
+@RequestMapping(value = "/agentQc")
38
+@Api(description = "汽车出入库")
39
+public class AgentQcController {
40
+
41
+    @Resource
42
+    private agentQcService agentQcService;
43
+
44
+    @Resource
45
+    private agentService agentService;
46
+
47
+    @Resource
48
+    private ImportServiceImpl importService;
49
+
50
+    @Resource
51
+    private BusinessAgentBgmxzService bgmxzService;
52
+
53
+    /**
54
+     * 查询汽车出入库信息记录
55
+     * @param pageNum
56
+     * @param pageSize
57
+     * @return
58
+     */
59
+    @RequestMapping(value = "/getAgentQcList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
60
+    @ApiOperation(value="汽车出入库信息", notes = "查询汽车出入库信息记录")
61
+    @ApiImplicitParams({
62
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
63
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
64
+            @ApiImplicitParam(name = "agentId", value = "代储点id", paramType = "query"),
65
+            @ApiImplicitParam(name = "agentDepotId", value = "代储库id", paramType = "query"),
66
+            @ApiImplicitParam(name = "storehouseId", value = "仓房id", paramType = "query"),
67
+            @ApiImplicitParam(name = "warehouseId", value = "货位id", paramType = "query"),
68
+            @ApiImplicitParam(name = "businessType", value = "业务类型", paramType = "query"),
69
+            @ApiImplicitParam(name = "lspz", value = "粮食品种", paramType = "query"),
70
+            @ApiImplicitParam(name = "orgid", value = "组织id", paramType = "query")
71
+    })
72
+    public PageInfo<Map<String, Object>> getAgentQcList(Integer pageNum, Integer pageSize, Integer agentId, Integer agentDepotId,
73
+                                                                Integer storehouseId, Integer warehouseId, String businessType, Integer lspz, String orgid){
74
+        Map<String,Object> map = new HashMap<>();
75
+        map.put("orgId",orgid);
76
+        if(ParameterUtil.isnotnull(agentId)){
77
+            map.put("agentId",agentId);
78
+        }
79
+        if(ParameterUtil.isnotnull(agentDepotId)){
80
+            map.put("agentDepotId",agentDepotId);
81
+        }
82
+        if(ParameterUtil.isnotnull(storehouseId)){
83
+            map.put("storehouseId",storehouseId);
84
+        }
85
+        if(ParameterUtil.isnotnull(warehouseId)){
86
+            map.put("warehouseId",warehouseId);
87
+        }
88
+        if (ParameterUtil.isnotnull(businessType)) {
89
+            if (businessType.equals("1")) {
90
+                map.put("businessType","汽车入库");
91
+            } else if (businessType.equals("3")) {
92
+                map.put("businessType","汽车出库");
93
+            }
94
+        }
95
+        if(ParameterUtil.isnotnull(lspz)){
96
+            map.put("lspz",lspz);
97
+        }
98
+
99
+        PageHelper.startPage(pageNum, pageSize);
100
+        List<Map<String, Object>> list = agentQcService.getAgentQcList(map);
101
+        PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(list);
102
+        //处理驼峰命名大写问题
103
+        List<Map<String, Object>> page_list = ParameterUtil.slashCapitals(pageInfo.getList());
104
+        pageInfo.setList(page_list);
105
+        return pageInfo;
106
+    }
107
+
108
+    /**
109
+     * 保存汽车出入库信息
110
+     * @param agentQcJson 主键id
111
+     * @return
112
+     * @throws Exception
113
+     */
114
+    @RequestMapping(value="/saveAgent", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
115
+    @ApiOperation(value="保存汽车出入库", notes = "保存汽车出入库信息")
116
+    @ApiImplicitParams({
117
+            @ApiImplicitParam(name = "agentQcJson", value = "汽车出入库信息", paramType = "form")
118
+    })
119
+    public Map<String, Object> saveAgent(String agentQcJson,Integer orgId) throws Exception {
120
+        Map<String, Object> modelMap = new HashMap<String, Object>();
121
+        // JSON字符串转对象
122
+        ObjectMapper mapper = new ObjectMapper();
123
+        BusinessAgentQc agent = (BusinessAgentQc)mapper.readValue(agentQcJson, BusinessAgentQc.class);
124
+        if (ParameterUtil.isnull(agent.getId())) {
125
+            agent.setOrgId(orgId);
126
+            agent.setCreateTime(ParameterUtil.string2date(ParameterUtil.getSysDateTime()));//创建时间
127
+            agentQcService.add(agent);
128
+        } else {
129
+            agentQcService.update(agent);
130
+        }
131
+        modelMap.put("agentId", agent.getId());
132
+        modelMap.put("status", "success");
133
+        return modelMap;
134
+    }
135
+
136
+    /**
137
+     * 删除汽车出入库信息
138
+     * @param id 主键id
139
+     * @return
140
+     */
141
+    @RequestMapping(value="/removeAgentQc", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
142
+    @ApiOperation(value="删除汽车出入库信息", notes = "删除汽车出入库信息")
143
+    @ApiImplicitParams({
144
+            @ApiImplicitParam(name = "id", value = "汽车出入库主键id", paramType = "form")
145
+    })
146
+    public Map<String, Object> removeAgentQc(Integer id){
147
+        Map<String, Object> modelMap = new HashMap<>();
148
+        if (id != null) {
149
+            agentQcService.updateDeleteById(id);
150
+            modelMap.put("status", "success");
151
+        }
152
+        return modelMap;
153
+    }
154
+
155
+    /**
156
+     * 根据id查找汽车出入库信息
157
+     * @param id 主键id
158
+     * @return
159
+     */
160
+    @RequestMapping(value="/getAgentQcEdit", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
161
+    @ApiOperation(value="根据id查找汽车出入库信息", notes = "根据id查找汽车出入库信息")
162
+    @ApiImplicitParams({
163
+            @ApiImplicitParam(name = "id", value = "汽车出入库主键id", paramType = "query")
164
+    })
165
+    public BusinessAgentQc getAgentQcEdit(Integer id) {
166
+        BusinessAgentQc agent = new BusinessAgentQc();
167
+        if (id != null) {
168
+            agent = agentQcService.findById(id);
169
+        }
170
+        return agent;
171
+    }
172
+
173
+    /**
174
+     * 导入excel
175
+     * @param file 文件
176
+     * @param fileType 类型:如xlsx
177
+     * @param orgId 组织机构id
178
+     * @return
179
+     */
180
+    @RequestMapping(value="/importFile", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
181
+    @ApiOperation(value="导入excel", notes = "导入excel")
182
+    @ApiImplicitParams({
183
+            @ApiImplicitParam(name = "file", value = "文件数据", paramType = "query"),
184
+            @ApiImplicitParam(name = "fileType", value = "文件名", paramType = "query"),
185
+            @ApiImplicitParam(name = "rootPath", value = "路径", paramType = "query"),
186
+            @ApiImplicitParam(name = "orgId", value = "组织机构id", paramType = "query")
187
+    })
188
+    public Map<String, Object> importFile(MultipartFile file, String fileType, HttpServletRequest request, Integer orgId){
189
+
190
+        String[] titleArr = {"通知单编号", "业务单号", "汽车牌号", "业务类型", "粮油品种",
191
+                "数量(公斤)", "仓房名称", "货位名称", "出入库日期"};//第一行的title
192
+        boolean[] emptyArr = {false, false, false, false, false,
193
+                false, false, false, false};//指定列可为空,不可为空值为false.
194
+
195
+        List<List<String>> list = new ArrayList<List<String>>();//该list为数据返回的list
196
+        Map<String, Object> fileMap = new HashMap<>();
197
+        String errormsg = null;
198
+        try {
199
+        	errormsg = importService.importFile(file, fileType, request, titleArr, emptyArr, list,1);
200
+
201
+            if (errormsg != null && !"".equals(errormsg)) {
202
+                fileMap.put("errormsg",errormsg);
203
+                return fileMap;
204
+            }
205
+
206
+            //查询代储点名称和代储库名称对应的id
207
+            Map<String, Object> agentMap = agentService.getNameId(importService.nameData(file, fileType, request));
208
+            if(ParameterUtil.isnull(agentMap)){
209
+                fileMap.put("errormsg","代储点与代储库无关联,请查询后添加!");
210
+                return fileMap;
211
+            }
212
+
213
+            if (list.size()>0) {
214
+                errormsg = agentQcService.importData(list, orgId, agentMap);
215
+            }
216
+        } catch (Exception e) {
217
+            e.printStackTrace();
218
+        }
219
+        fileMap.put("errormsg",errormsg);
220
+        return fileMap;
221
+    }
222
+
223
+    @RequestMapping(value="/selectAgentHouseWareList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
224
+	@ApiOperation(value="查询代储库正常使用的货位数据信息", notes = "查询代储库正常使用的货位数据信息")
225
+	@ApiImplicitParams({
226
+		@ApiImplicitParam(name="orgId", value="当前单位ID", paramType="query")
227
+	})
228
+	public List<Map<String, Object>> selectAgentHouseWareList(Integer orgId) {
229
+
230
+		Map<String, Object> paramMap = new HashMap<String, Object>();
231
+
232
+		paramMap.put("orgId", orgId);
233
+		List<Map<String, Object>> list = agentQcService.selectAgentHouseWareList(paramMap);
234
+
235
+		return list;
236
+	}
237
+
238
+    @RequestMapping(value="/editQcCrkRecordData", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
239
+	@ApiOperation(value="同步功能", notes = "把出入库拿来的汽车出入库记录数据插入到代储库业务的汽车出入库记录表中")
240
+	@ApiImplicitParams({
241
+		@ApiImplicitParam(name="qcCrkRecordData", value="汽车出入库记录数据", paramType="form"),
242
+		@ApiImplicitParam(name="orgId", value="当前单位ID", paramType="form"),
243
+		@ApiImplicitParam(name="realName", value="当前操作人", paramType="form")
244
+	})
245
+	public Map<String, Object> editQcCrkRecordData(String qcCrkRecordData, Integer orgId, String realName) {
246
+
247
+		Map<String, Object> map = new HashMap<String, Object>();
248
+
249
+		try {
250
+			JSONArray json = JSONArray.fromObject(qcCrkRecordData);
251
+			if (json.size() > 0) {
252
+				BusinessAgentQc agentQc = null;
253
+				for (int i = 0; i < json.size(); i++) {
254
+					
255
+					JSONObject job = json.getJSONObject(i);
256
+					Integer unitId = Integer.parseInt(job.get("unitid")+"");
257
+					BusinessAgentDepot agentDepot = bgmxzService.selectAgentDepotObj(orgId, unitId);
258
+					Integer agentDepotId = agentDepot.getId();
259
+					Integer agentId = Integer.parseInt(agentDepot.getAgentId());
260
+					Integer houseId = Integer.parseInt(job.get("houseId")+"");
261
+					Integer wareId = Integer.parseInt(job.get("wareId")+"");
262
+
263
+					agentQc = new BusinessAgentQc();
264
+					agentQc.setOrgId(orgId);
265
+					agentQc.setAgentId(agentId);
266
+					agentQc.setAgentDepotId(agentDepotId);
267
+					agentQc.setNotice(job.get("tzdbh")+"");
268
+					agentQc.setBusinessNumber(job.get("bizNo")+"");
269
+					agentQc.setCarBrand(job.get("cphm")+"");
270
+					String businessType = job.get("ywlx")+"";
271
+					if ("入仓".equals(businessType)) {
272
+						businessType = "汽车入库";
273
+					} else {
274
+						businessType = "汽车出库";
275
+					}
276
+					agentQc.setBusinessType(businessType);
277
+					agentQc.setLspz(Integer.parseInt(job.get("lspzid")+""));
278
+					agentQc.setGrainNumber(job.get("count")+"");
279
+					agentQc.setStorehouseId(houseId);
280
+					agentQc.setWarehouseId(wareId);
281
+					Date crk_time = ParameterUtil.string2date(job.get("rq")+"");
282
+					agentQc.setCrkTime(crk_time);
283
+					agentQc.setCreateTime(new Date());
284
+					agentQc.setSjly(1);
285
+
286
+					//插入代储点的库存实物表
287
+					agentQcService.add(agentQc);
288
+
289
+				}
290
+
291
+				//修改代储点货位表的汽车出入库最后同步时间
292
+				agentQcService.updateAgentDepot(orgId);
293
+			}
294
+			map.put("status", "200");
295
+			map.put("msg", "操作成功!");
296
+		} catch (NumberFormatException e) {
297
+			map.put("msg", "操作失败!");
298
+			e.printStackTrace();
299
+		}
300
+
301
+		return map;
302
+	}
303
+}

+ 39 - 0
src/main/java/com/chinaitop/depot/agent/crk/mapper/BusinessAgentHcMapper.java

@@ -0,0 +1,39 @@
1
+package com.chinaitop.depot.agent.crk.mapper;
2
+
3
+import com.chinaitop.depot.agent.crk.model.BusinessAgentHc;
4
+import com.chinaitop.depot.agent.crk.model.BusinessAgentHcExample;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+public interface BusinessAgentHcMapper {
11
+    int countByExample(BusinessAgentHcExample example);
12
+
13
+    int deleteByExample(BusinessAgentHcExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessAgentHc record);
18
+
19
+    int insertSelective(BusinessAgentHc record);
20
+
21
+    List<BusinessAgentHc> selectByExample(BusinessAgentHcExample example);
22
+
23
+    BusinessAgentHc selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessAgentHc record, @Param("example") BusinessAgentHcExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessAgentHc record, @Param("example") BusinessAgentHcExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessAgentHc record);
30
+
31
+    int updateByPrimaryKey(BusinessAgentHc record);
32
+    
33
+    List<Map<String,Object>> getDataByExample(Map<String,Object> map);
34
+
35
+    /**
36
+     * 查询代储库仓房货位信息
37
+     */
38
+    List<Map<String, Object>> selectAgentHouseWareList(Map<String,Object> param_map);
39
+}

+ 476 - 0
src/main/java/com/chinaitop/depot/agent/crk/mapper/BusinessAgentHcMapper.xml

@@ -0,0 +1,476 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.chinaitop.depot.agent.crk.mapper.BusinessAgentHcMapper">
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.crk.model.BusinessAgentHc">
5
+    <id column="id" jdbcType="INTEGER" property="id" />
6
+    <result column="agent_id" jdbcType="INTEGER" property="agentId" />
7
+    <result column="agent_depot_id" jdbcType="INTEGER" property="agentDepotId" />
8
+    <result column="notice" jdbcType="VARCHAR" property="notice" />
9
+    <result column="inbound" jdbcType="VARCHAR" property="inbound" />
10
+    <result column="train_no" jdbcType="VARCHAR" property="trainNo" />
11
+    <result column="business_type" jdbcType="VARCHAR" property="businessType" />
12
+    <result column="lspz" jdbcType="INTEGER" property="lspz" />
13
+    <result column="grain_number" jdbcType="VARCHAR" property="grainNumber" />
14
+    <result column="storehouse_id" jdbcType="INTEGER" property="storehouseId" />
15
+    <result column="warehouse_id" jdbcType="INTEGER" property="warehouseId" />
16
+    <result column="crk_time" jdbcType="TIMESTAMP" property="crkTime" />
17
+    <result column="org_id" jdbcType="INTEGER" property="orgId" />
18
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
19
+    <result column="sjly" jdbcType="INTEGER" property="sjly" />
20
+    <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
21
+  </resultMap>
22
+  <sql id="Example_Where_Clause">
23
+    <where>
24
+      <foreach collection="oredCriteria" item="criteria" separator="or">
25
+        <if test="criteria.valid">
26
+          <trim prefix="(" prefixOverrides="and" suffix=")">
27
+            <foreach collection="criteria.criteria" item="criterion">
28
+              <choose>
29
+                <when test="criterion.noValue">
30
+                  and ${criterion.condition}
31
+                </when>
32
+                <when test="criterion.singleValue">
33
+                  and ${criterion.condition} #{criterion.value}
34
+                </when>
35
+                <when test="criterion.betweenValue">
36
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
37
+                </when>
38
+                <when test="criterion.listValue">
39
+                  and ${criterion.condition}
40
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
41
+                    #{listItem}
42
+                  </foreach>
43
+                </when>
44
+              </choose>
45
+            </foreach>
46
+          </trim>
47
+        </if>
48
+      </foreach>
49
+    </where>
50
+  </sql>
51
+  <sql id="Update_By_Example_Where_Clause">
52
+    <where>
53
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
54
+        <if test="criteria.valid">
55
+          <trim prefix="(" prefixOverrides="and" suffix=")">
56
+            <foreach collection="criteria.criteria" item="criterion">
57
+              <choose>
58
+                <when test="criterion.noValue">
59
+                  and ${criterion.condition}
60
+                </when>
61
+                <when test="criterion.singleValue">
62
+                  and ${criterion.condition} #{criterion.value}
63
+                </when>
64
+                <when test="criterion.betweenValue">
65
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
66
+                </when>
67
+                <when test="criterion.listValue">
68
+                  and ${criterion.condition}
69
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
70
+                    #{listItem}
71
+                  </foreach>
72
+                </when>
73
+              </choose>
74
+            </foreach>
75
+          </trim>
76
+        </if>
77
+      </foreach>
78
+    </where>
79
+  </sql>
80
+  <sql id="Base_Column_List">
81
+    id, agent_id, agent_depot_id, notice, inbound, train_no, business_type, lspz, grain_number, 
82
+    storehouse_id, warehouse_id, crk_time, org_id, create_time, sjly, updatetime
83
+  </sql>
84
+  <select id="selectByExample" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentHcExample" resultMap="BaseResultMap">
85
+    select
86
+    <if test="distinct">
87
+      distinct
88
+    </if>
89
+    <include refid="Base_Column_List" />
90
+    from business_agent_hc
91
+    <if test="_parameter != null">
92
+      <include refid="Example_Where_Clause" />
93
+    </if>
94
+    <if test="orderByClause != null">
95
+      order by ${orderByClause}
96
+    </if>
97
+  </select>
98
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
99
+    select 
100
+    <include refid="Base_Column_List" />
101
+    from business_agent_hc
102
+    where id = #{id,jdbcType=INTEGER}
103
+  </select>
104
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
105
+    delete from business_agent_hc
106
+    where id = #{id,jdbcType=INTEGER}
107
+  </delete>
108
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentHcExample">
109
+    delete from business_agent_hc
110
+    <if test="_parameter != null">
111
+      <include refid="Example_Where_Clause" />
112
+    </if>
113
+  </delete>
114
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentHc">
115
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
116
+      select seq_business_agent_hc.nextVal from dual
117
+    </selectKey>
118
+    insert into business_agent_hc (id, agent_id, agent_depot_id, 
119
+      notice, inbound, train_no, 
120
+      business_type, lspz, grain_number, 
121
+      storehouse_id, warehouse_id, crk_time, 
122
+      org_id, create_time, sjly, 
123
+      updatetime)
124
+    values (#{id,jdbcType=INTEGER}, #{agentId,jdbcType=INTEGER}, #{agentDepotId,jdbcType=INTEGER},
125
+      #{notice,jdbcType=VARCHAR}, #{inbound,jdbcType=VARCHAR}, #{trainNo,jdbcType=VARCHAR}, 
126
+      #{businessType,jdbcType=VARCHAR}, #{lspz,jdbcType=INTEGER}, #{grainNumber,jdbcType=VARCHAR}, 
127
+      #{storehouseId,jdbcType=INTEGER}, #{warehouseId,jdbcType=INTEGER}, #{crkTime,jdbcType=TIMESTAMP}, 
128
+      #{orgId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{sjly,jdbcType=INTEGER}, 
129
+      #{updatetime,jdbcType=TIMESTAMP})
130
+  </insert>
131
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentHc">
132
+    insert into business_agent_hc
133
+    <trim prefix="(" suffix=")" suffixOverrides=",">
134
+      <if test="id != null">
135
+        id,
136
+      </if>
137
+      <if test="agentId != null">
138
+        agent_id,
139
+      </if>
140
+      <if test="agentDepotId != null">
141
+        agent_depot_id,
142
+      </if>
143
+      <if test="notice != null">
144
+        notice,
145
+      </if>
146
+      <if test="inbound != null">
147
+        inbound,
148
+      </if>
149
+      <if test="trainNo != null">
150
+        train_no,
151
+      </if>
152
+      <if test="businessType != null">
153
+        business_type,
154
+      </if>
155
+      <if test="lspz != null">
156
+        lspz,
157
+      </if>
158
+      <if test="grainNumber != null">
159
+        grain_number,
160
+      </if>
161
+      <if test="storehouseId != null">
162
+        storehouse_id,
163
+      </if>
164
+      <if test="warehouseId != null">
165
+        warehouse_id,
166
+      </if>
167
+      <if test="crkTime != null">
168
+        crk_time,
169
+      </if>
170
+      <if test="orgId != null">
171
+        org_id,
172
+      </if>
173
+      <if test="createTime != null">
174
+        create_time,
175
+      </if>
176
+      <if test="sjly != null">
177
+        sjly,
178
+      </if>
179
+      <if test="updatetime != null">
180
+        updatetime,
181
+      </if>
182
+    </trim>
183
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
184
+      <if test="id != null">
185
+        #{id,jdbcType=INTEGER},
186
+      </if>
187
+      <if test="agentId != null">
188
+        #{agentId,jdbcType=INTEGER},
189
+      </if>
190
+      <if test="agentDepotId != null">
191
+        #{agentDepotId,jdbcType=INTEGER},
192
+      </if>
193
+      <if test="notice != null">
194
+        #{notice,jdbcType=VARCHAR},
195
+      </if>
196
+      <if test="inbound != null">
197
+        #{inbound,jdbcType=VARCHAR},
198
+      </if>
199
+      <if test="trainNo != null">
200
+        #{trainNo,jdbcType=VARCHAR},
201
+      </if>
202
+      <if test="businessType != null">
203
+        #{businessType,jdbcType=VARCHAR},
204
+      </if>
205
+      <if test="lspz != null">
206
+        #{lspz,jdbcType=INTEGER},
207
+      </if>
208
+      <if test="grainNumber != null">
209
+        #{grainNumber,jdbcType=VARCHAR},
210
+      </if>
211
+      <if test="storehouseId != null">
212
+        #{storehouseId,jdbcType=INTEGER},
213
+      </if>
214
+      <if test="warehouseId != null">
215
+        #{warehouseId,jdbcType=INTEGER},
216
+      </if>
217
+      <if test="crkTime != null">
218
+        #{crkTime,jdbcType=TIMESTAMP},
219
+      </if>
220
+      <if test="orgId != null">
221
+        #{orgId,jdbcType=INTEGER},
222
+      </if>
223
+      <if test="createTime != null">
224
+        #{createTime,jdbcType=TIMESTAMP},
225
+      </if>
226
+      <if test="sjly != null">
227
+        #{sjly,jdbcType=INTEGER},
228
+      </if>
229
+      <if test="updatetime != null">
230
+        #{updatetime,jdbcType=TIMESTAMP},
231
+      </if>
232
+    </trim>
233
+  </insert>
234
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentHcExample" resultType="java.lang.Integer">
235
+    select count(*) from business_agent_hc
236
+    <if test="_parameter != null">
237
+      <include refid="Example_Where_Clause" />
238
+    </if>
239
+  </select>
240
+  <update id="updateByExampleSelective" parameterType="map">
241
+    update business_agent_hc
242
+    <set>
243
+      <if test="record.id != null">
244
+        id = #{record.id,jdbcType=INTEGER},
245
+      </if>
246
+      <if test="record.agentId != null">
247
+        agent_id = #{record.agentId,jdbcType=INTEGER},
248
+      </if>
249
+      <if test="record.agentDepotId != null">
250
+        agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
251
+      </if>
252
+      <if test="record.notice != null">
253
+        notice = #{record.notice,jdbcType=VARCHAR},
254
+      </if>
255
+      <if test="record.inbound != null">
256
+        inbound = #{record.inbound,jdbcType=VARCHAR},
257
+      </if>
258
+      <if test="record.trainNo != null">
259
+        train_no = #{record.trainNo,jdbcType=VARCHAR},
260
+      </if>
261
+      <if test="record.businessType != null">
262
+        business_type = #{record.businessType,jdbcType=VARCHAR},
263
+      </if>
264
+      <if test="record.lspz != null">
265
+        lspz = #{record.lspz,jdbcType=INTEGER},
266
+      </if>
267
+      <if test="record.grainNumber != null">
268
+        grain_number = #{record.grainNumber,jdbcType=VARCHAR},
269
+      </if>
270
+      <if test="record.storehouseId != null">
271
+        storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
272
+      </if>
273
+      <if test="record.warehouseId != null">
274
+        warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
275
+      </if>
276
+      <if test="record.crkTime != null">
277
+        crk_time = #{record.crkTime,jdbcType=TIMESTAMP},
278
+      </if>
279
+      <if test="record.orgId != null">
280
+        org_id = #{record.orgId,jdbcType=INTEGER},
281
+      </if>
282
+      <if test="record.createTime != null">
283
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
284
+      </if>
285
+      <if test="record.sjly != null">
286
+        sjly = #{record.sjly,jdbcType=INTEGER},
287
+      </if>
288
+      <if test="record.updatetime != null">
289
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
290
+      </if>
291
+    </set>
292
+    <if test="_parameter != null">
293
+      <include refid="Update_By_Example_Where_Clause" />
294
+    </if>
295
+  </update>
296
+  <update id="updateByExample" parameterType="map">
297
+    update business_agent_hc
298
+    set id = #{record.id,jdbcType=INTEGER},
299
+      agent_id = #{record.agentId,jdbcType=INTEGER},
300
+      agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
301
+      notice = #{record.notice,jdbcType=VARCHAR},
302
+      inbound = #{record.inbound,jdbcType=VARCHAR},
303
+      train_no = #{record.trainNo,jdbcType=VARCHAR},
304
+      business_type = #{record.businessType,jdbcType=VARCHAR},
305
+      lspz = #{record.lspz,jdbcType=INTEGER},
306
+      grain_number = #{record.grainNumber,jdbcType=VARCHAR},
307
+      storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
308
+      warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
309
+      crk_time = #{record.crkTime,jdbcType=TIMESTAMP},
310
+      org_id = #{record.orgId,jdbcType=INTEGER},
311
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
312
+      sjly = #{record.sjly,jdbcType=INTEGER},
313
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
314
+    <if test="_parameter != null">
315
+      <include refid="Update_By_Example_Where_Clause" />
316
+    </if>
317
+  </update>
318
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentHc">
319
+    update business_agent_hc
320
+    <set>
321
+      <if test="agentId != null">
322
+        agent_id = #{agentId,jdbcType=INTEGER},
323
+      </if>
324
+      <if test="agentDepotId != null">
325
+        agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
326
+      </if>
327
+      <if test="notice != null">
328
+        notice = #{notice,jdbcType=VARCHAR},
329
+      </if>
330
+      <if test="inbound != null">
331
+        inbound = #{inbound,jdbcType=VARCHAR},
332
+      </if>
333
+      <if test="trainNo != null">
334
+        train_no = #{trainNo,jdbcType=VARCHAR},
335
+      </if>
336
+      <if test="businessType != null">
337
+        business_type = #{businessType,jdbcType=VARCHAR},
338
+      </if>
339
+      <if test="lspz != null">
340
+        lspz = #{lspz,jdbcType=INTEGER},
341
+      </if>
342
+      <if test="grainNumber != null">
343
+        grain_number = #{grainNumber,jdbcType=VARCHAR},
344
+      </if>
345
+      <if test="storehouseId != null">
346
+        storehouse_id = #{storehouseId,jdbcType=INTEGER},
347
+      </if>
348
+      <if test="warehouseId != null">
349
+        warehouse_id = #{warehouseId,jdbcType=INTEGER},
350
+      </if>
351
+      <if test="crkTime != null">
352
+        crk_time = #{crkTime,jdbcType=TIMESTAMP},
353
+      </if>
354
+      <if test="orgId != null">
355
+        org_id = #{orgId,jdbcType=INTEGER},
356
+      </if>
357
+      <if test="createTime != null">
358
+        create_time = #{createTime,jdbcType=TIMESTAMP},
359
+      </if>
360
+      <if test="sjly != null">
361
+        sjly = #{sjly,jdbcType=INTEGER},
362
+      </if>
363
+      <if test="updatetime != null">
364
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
365
+      </if>
366
+    </set>
367
+    where id = #{id,jdbcType=INTEGER}
368
+  </update>
369
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentHc">
370
+    update business_agent_hc
371
+    set agent_id = #{agentId,jdbcType=INTEGER},
372
+      agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
373
+      notice = #{notice,jdbcType=VARCHAR},
374
+      inbound = #{inbound,jdbcType=VARCHAR},
375
+      train_no = #{trainNo,jdbcType=VARCHAR},
376
+      business_type = #{businessType,jdbcType=VARCHAR},
377
+      lspz = #{lspz,jdbcType=INTEGER},
378
+      grain_number = #{grainNumber,jdbcType=VARCHAR},
379
+      storehouse_id = #{storehouseId,jdbcType=INTEGER},
380
+      warehouse_id = #{warehouseId,jdbcType=INTEGER},
381
+      crk_time = #{crkTime,jdbcType=TIMESTAMP},
382
+      org_id = #{orgId,jdbcType=INTEGER},
383
+      create_time = #{createTime,jdbcType=TIMESTAMP},
384
+      sjly = #{sjly,jdbcType=INTEGER},
385
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
386
+    where id = #{id,jdbcType=INTEGER}
387
+  </update>
388
+
389
+  <select id="getDataByExample" parameterType="java.util.Map" resultType="java.util.HashMap">
390
+    SELECT
391
+    a.*
392
+    FROM
393
+    (SELECT
394
+          hc.id,hc.agent_id,hc.agent_depot_id,hc.notice,hc.inbound,hc.train_no,
395
+          hc.business_type,hc.lspz,hc.grain_number,hc.storehouse_id,
396
+          hc.warehouse_id,hc.crk_time,hc.org_id,hc.create_time,
397
+          ware.warehouse_name,store.storehouse_name,agent.agent_name,
398
+          depot.agent_depot_name,hc.updatetime
399
+      FROM
400
+          business_agent_hc hc
401
+          LEFT JOIN business_agent agent ON agent.id = hc.agent_id AND agent.org_id = #{orgId,jdbcType=INTEGER}
402
+          LEFT JOIN business_agent_depot depot ON depot.id = hc.agent_depot_id AND depot.org_id = #{orgId,jdbcType=INTEGER}
403
+          LEFT JOIN basic_storehouse store ON store.storehouse_id = hc.storehouse_id AND store.org_id = #{orgId,jdbcType=INTEGER}
404
+          LEFT JOIN basic_warehouse ware ON ware.warehouse_id = hc.warehouse_id AND ware.org_id = #{orgId,jdbcType=INTEGER}
405
+      WHERE ware.library_type = 1 AND store.library_type = 1 AND hc.org_id = #{orgId,jdbcType=INTEGER}
406
+          <if test="agentId != null">
407
+            AND hc.agent_id = #{agentId,jdbcType=INTEGER}
408
+          </if>
409
+          <if test="agentDepotId != null">
410
+            AND hc.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
411
+          </if>
412
+          <if test="storehouseId != null">
413
+            AND hc.storehouse_id = #{storehouseId,jdbcType=INTEGER}
414
+          </if>
415
+          <if test="warehouseId != null">
416
+            AND hc.warehouse_id = #{warehouseId,jdbcType=INTEGER}
417
+          </if>
418
+          <if test="businessType != null">
419
+            AND hc.business_type = #{businessType,jdbcType=INTEGER}
420
+          </if>
421
+          <if test="lspz != null">
422
+            AND hc.lspz = #{lspz,jdbcType=INTEGER}
423
+          </if>
424
+    UNION ALL
425
+    SELECT
426
+        hc.id,hc.agent_id,hc.agent_depot_id,hc.notice,hc.inbound,hc.train_no,
427
+        hc.business_type,hc.lspz,hc.grain_number,hc.storehouse_id,
428
+        hc.warehouse_id,hc.crk_time,hc.org_id,hc.create_time,
429
+        ware.warehouse_name,store.storehouse_name,agent.agent_name,
430
+        depot.agent_depot_name,hc.updatetime
431
+    FROM
432
+    business_agent_hc hc
433
+        INNER JOIN business_agent_storehouse aStore ON aStore.storehouse_id = hc.storehouse_id
434
+        INNER JOIN business_agent_warehouse aWare ON aWare.warehouse_id = hc.warehouse_id
435
+        LEFT JOIN business_agent agent ON agent.id = hc.agent_id
436
+        LEFT JOIN business_agent_depot depot ON depot.id = hc.agent_depot_id
437
+        LEFT JOIN basic_storehouse store ON store.storehouse_id = aStore.storehouse_id
438
+        LEFT JOIN basic_warehouse ware ON ware.warehouse_id = aWare.warehouse_id
439
+    WHERE hc.org_id = #{orgId,jdbcType=INTEGER}
440
+    <if test="agentId != null">
441
+      AND hc.agent_id = #{agentId,jdbcType=INTEGER}
442
+    </if>
443
+    <if test="agentDepotId != null">
444
+      AND hc.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
445
+    </if>
446
+    <if test="storehouseId != null">
447
+      AND hc.storehouse_id = #{storehouseId,jdbcType=INTEGER}
448
+    </if>
449
+    <if test="warehouseId != null">
450
+      AND hc.warehouse_id = #{warehouseId,jdbcType=INTEGER}
451
+    </if>
452
+    <if test="businessType != null">
453
+      AND hc.business_type = #{businessType,jdbcType=INTEGER}
454
+    </if>
455
+    <if test="lspz != null">
456
+      AND hc.lspz = #{lspz,jdbcType=INTEGER}
457
+    </if>
458
+    ) a
459
+    ORDER BY a.updatetime DESC
460
+  </select>
461
+  
462
+  <!-- 查询代储库仓房货位信息 -->
463
+  <select id="selectAgentHouseWareList" parameterType="java.util.Map" resultType="java.util.Map">
464
+    SELECT 
465
+    	a.depot_id+"" unitid,
466
+    	c.warehouse_id hwh,
467
+    	c.hccrk_tbsj modifydate
468
+    FROM business_agent_depot a
469
+	LEFT JOIN business_agent_storehouse b ON b.agent_depot_id=a.id
470
+	LEFT JOIN business_agent_warehouse c ON c.agent_storehouse_id=b.id 
471
+	WHERE a.depot_id != 0 AND b.storehouse_id IS NOT NULL AND c.warehouse_id IS NOT NULL 
472
+	<if test="orgId != null">
473
+	and c.org_id=#{orgId,jdbcType=INTEGER}
474
+	</if>
475
+  </select>
476
+</mapper>

+ 39 - 0
src/main/java/com/chinaitop/depot/agent/crk/mapper/BusinessAgentQcMapper.java

@@ -0,0 +1,39 @@
1
+package com.chinaitop.depot.agent.crk.mapper;
2
+
3
+import com.chinaitop.depot.agent.crk.model.BusinessAgentQc;
4
+import com.chinaitop.depot.agent.crk.model.BusinessAgentQcExample;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+public interface BusinessAgentQcMapper {
11
+    int countByExample(BusinessAgentQcExample example);
12
+
13
+    int deleteByExample(BusinessAgentQcExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessAgentQc record);
18
+
19
+    int insertSelective(BusinessAgentQc record);
20
+
21
+    List<BusinessAgentQc> selectByExample(BusinessAgentQcExample example);
22
+
23
+    BusinessAgentQc selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessAgentQc record, @Param("example") BusinessAgentQcExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessAgentQc record, @Param("example") BusinessAgentQcExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessAgentQc record);
30
+
31
+    int updateByPrimaryKey(BusinessAgentQc record);
32
+
33
+    List<Map<String,Object>> getDataByExample(Map<String,Object> map);
34
+
35
+    /**
36
+     * 查询代储库仓房货位信息
37
+     */
38
+    List<Map<String, Object>> selectAgentHouseWareList(Map<String,Object> param_map);
39
+}

+ 477 - 0
src/main/java/com/chinaitop/depot/agent/crk/mapper/BusinessAgentQcMapper.xml

@@ -0,0 +1,477 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.chinaitop.depot.agent.crk.mapper.BusinessAgentQcMapper">
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.crk.model.BusinessAgentQc">
5
+    <id column="id" jdbcType="INTEGER" property="id" />
6
+    <result column="agent_id" jdbcType="INTEGER" property="agentId" />
7
+    <result column="agent_depot_id" jdbcType="INTEGER" property="agentDepotId" />
8
+    <result column="notice" jdbcType="VARCHAR" property="notice" />
9
+    <result column="business_number" jdbcType="VARCHAR" property="businessNumber" />
10
+    <result column="car_brand" jdbcType="VARCHAR" property="carBrand" />
11
+    <result column="business_type" jdbcType="VARCHAR" property="businessType" />
12
+    <result column="lspz" jdbcType="INTEGER" property="lspz" />
13
+    <result column="grain_number" jdbcType="VARCHAR" property="grainNumber" />
14
+    <result column="storehouse_id" jdbcType="INTEGER" property="storehouseId" />
15
+    <result column="warehouse_id" jdbcType="INTEGER" property="warehouseId" />
16
+    <result column="crk_time" jdbcType="TIMESTAMP" property="crkTime" />
17
+    <result column="org_id" jdbcType="INTEGER" property="orgId" />
18
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
19
+    <result column="sjly" jdbcType="INTEGER" property="sjly" />
20
+    <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
21
+  </resultMap>
22
+  <sql id="Example_Where_Clause">
23
+    <where>
24
+      <foreach collection="oredCriteria" item="criteria" separator="or">
25
+        <if test="criteria.valid">
26
+          <trim prefix="(" prefixOverrides="and" suffix=")">
27
+            <foreach collection="criteria.criteria" item="criterion">
28
+              <choose>
29
+                <when test="criterion.noValue">
30
+                  and ${criterion.condition}
31
+                </when>
32
+                <when test="criterion.singleValue">
33
+                  and ${criterion.condition} #{criterion.value}
34
+                </when>
35
+                <when test="criterion.betweenValue">
36
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
37
+                </when>
38
+                <when test="criterion.listValue">
39
+                  and ${criterion.condition}
40
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
41
+                    #{listItem}
42
+                  </foreach>
43
+                </when>
44
+              </choose>
45
+            </foreach>
46
+          </trim>
47
+        </if>
48
+      </foreach>
49
+    </where>
50
+  </sql>
51
+  <sql id="Update_By_Example_Where_Clause">
52
+    <where>
53
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
54
+        <if test="criteria.valid">
55
+          <trim prefix="(" prefixOverrides="and" suffix=")">
56
+            <foreach collection="criteria.criteria" item="criterion">
57
+              <choose>
58
+                <when test="criterion.noValue">
59
+                  and ${criterion.condition}
60
+                </when>
61
+                <when test="criterion.singleValue">
62
+                  and ${criterion.condition} #{criterion.value}
63
+                </when>
64
+                <when test="criterion.betweenValue">
65
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
66
+                </when>
67
+                <when test="criterion.listValue">
68
+                  and ${criterion.condition}
69
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
70
+                    #{listItem}
71
+                  </foreach>
72
+                </when>
73
+              </choose>
74
+            </foreach>
75
+          </trim>
76
+        </if>
77
+      </foreach>
78
+    </where>
79
+  </sql>
80
+  <sql id="Base_Column_List">
81
+    id, agent_id, agent_depot_id, notice, business_number, car_brand, business_type, 
82
+    lspz, grain_number, storehouse_id, warehouse_id, crk_time, org_id, create_time, sjly, 
83
+    updatetime
84
+  </sql>
85
+  <select id="selectByExample" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentQcExample" resultMap="BaseResultMap">
86
+    select
87
+    <if test="distinct">
88
+      distinct
89
+    </if>
90
+    <include refid="Base_Column_List" />
91
+    from business_agent_qc
92
+    <if test="_parameter != null">
93
+      <include refid="Example_Where_Clause" />
94
+    </if>
95
+    <if test="orderByClause != null">
96
+      order by ${orderByClause}
97
+    </if>
98
+  </select>
99
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
100
+    select 
101
+    <include refid="Base_Column_List" />
102
+    from business_agent_qc
103
+    where id = #{id,jdbcType=INTEGER}
104
+  </select>
105
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
106
+    delete from business_agent_qc
107
+    where id = #{id,jdbcType=INTEGER}
108
+  </delete>
109
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentQcExample">
110
+    delete from business_agent_qc
111
+    <if test="_parameter != null">
112
+      <include refid="Example_Where_Clause" />
113
+    </if>
114
+  </delete>
115
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentQc">
116
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
117
+      select seq_business_agent_qc.nextVal from dual
118
+    </selectKey>
119
+    insert into business_agent_qc (id, agent_id, agent_depot_id, 
120
+      notice, business_number, car_brand, 
121
+      business_type, lspz, grain_number, 
122
+      storehouse_id, warehouse_id, crk_time, 
123
+      org_id, create_time, sjly, 
124
+      updatetime)
125
+    values (#{id,jdbcType=INTEGER}, #{agentId,jdbcType=INTEGER}, #{agentDepotId,jdbcType=INTEGER},
126
+      #{notice,jdbcType=VARCHAR}, #{businessNumber,jdbcType=VARCHAR}, #{carBrand,jdbcType=VARCHAR}, 
127
+      #{businessType,jdbcType=VARCHAR}, #{lspz,jdbcType=INTEGER}, #{grainNumber,jdbcType=VARCHAR}, 
128
+      #{storehouseId,jdbcType=INTEGER}, #{warehouseId,jdbcType=INTEGER}, #{crkTime,jdbcType=TIMESTAMP}, 
129
+      #{orgId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{sjly,jdbcType=INTEGER}, 
130
+      #{updatetime,jdbcType=TIMESTAMP})
131
+  </insert>
132
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentQc">
133
+    insert into business_agent_qc
134
+    <trim prefix="(" suffix=")" suffixOverrides=",">
135
+      <if test="id != null">
136
+        id,
137
+      </if>
138
+      <if test="agentId != null">
139
+        agent_id,
140
+      </if>
141
+      <if test="agentDepotId != null">
142
+        agent_depot_id,
143
+      </if>
144
+      <if test="notice != null">
145
+        notice,
146
+      </if>
147
+      <if test="businessNumber != null">
148
+        business_number,
149
+      </if>
150
+      <if test="carBrand != null">
151
+        car_brand,
152
+      </if>
153
+      <if test="businessType != null">
154
+        business_type,
155
+      </if>
156
+      <if test="lspz != null">
157
+        lspz,
158
+      </if>
159
+      <if test="grainNumber != null">
160
+        grain_number,
161
+      </if>
162
+      <if test="storehouseId != null">
163
+        storehouse_id,
164
+      </if>
165
+      <if test="warehouseId != null">
166
+        warehouse_id,
167
+      </if>
168
+      <if test="crkTime != null">
169
+        crk_time,
170
+      </if>
171
+      <if test="orgId != null">
172
+        org_id,
173
+      </if>
174
+      <if test="createTime != null">
175
+        create_time,
176
+      </if>
177
+      <if test="sjly != null">
178
+        sjly,
179
+      </if>
180
+      <if test="updatetime != null">
181
+        updatetime,
182
+      </if>
183
+    </trim>
184
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
185
+      <if test="id != null">
186
+        #{id,jdbcType=INTEGER},
187
+      </if>
188
+      <if test="agentId != null">
189
+        #{agentId,jdbcType=INTEGER},
190
+      </if>
191
+      <if test="agentDepotId != null">
192
+        #{agentDepotId,jdbcType=INTEGER},
193
+      </if>
194
+      <if test="notice != null">
195
+        #{notice,jdbcType=VARCHAR},
196
+      </if>
197
+      <if test="businessNumber != null">
198
+        #{businessNumber,jdbcType=VARCHAR},
199
+      </if>
200
+      <if test="carBrand != null">
201
+        #{carBrand,jdbcType=VARCHAR},
202
+      </if>
203
+      <if test="businessType != null">
204
+        #{businessType,jdbcType=VARCHAR},
205
+      </if>
206
+      <if test="lspz != null">
207
+        #{lspz,jdbcType=INTEGER},
208
+      </if>
209
+      <if test="grainNumber != null">
210
+        #{grainNumber,jdbcType=VARCHAR},
211
+      </if>
212
+      <if test="storehouseId != null">
213
+        #{storehouseId,jdbcType=INTEGER},
214
+      </if>
215
+      <if test="warehouseId != null">
216
+        #{warehouseId,jdbcType=INTEGER},
217
+      </if>
218
+      <if test="crkTime != null">
219
+        #{crkTime,jdbcType=TIMESTAMP},
220
+      </if>
221
+      <if test="orgId != null">
222
+        #{orgId,jdbcType=INTEGER},
223
+      </if>
224
+      <if test="createTime != null">
225
+        #{createTime,jdbcType=TIMESTAMP},
226
+      </if>
227
+      <if test="sjly != null">
228
+        #{sjly,jdbcType=INTEGER},
229
+      </if>
230
+      <if test="updatetime != null">
231
+        #{updatetime,jdbcType=TIMESTAMP},
232
+      </if>
233
+    </trim>
234
+  </insert>
235
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentQcExample" resultType="java.lang.Integer">
236
+    select count(*) from business_agent_qc
237
+    <if test="_parameter != null">
238
+      <include refid="Example_Where_Clause" />
239
+    </if>
240
+  </select>
241
+  <update id="updateByExampleSelective" parameterType="map">
242
+    update business_agent_qc
243
+    <set>
244
+      <if test="record.id != null">
245
+        id = #{record.id,jdbcType=INTEGER},
246
+      </if>
247
+      <if test="record.agentId != null">
248
+        agent_id = #{record.agentId,jdbcType=INTEGER},
249
+      </if>
250
+      <if test="record.agentDepotId != null">
251
+        agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
252
+      </if>
253
+      <if test="record.notice != null">
254
+        notice = #{record.notice,jdbcType=VARCHAR},
255
+      </if>
256
+      <if test="record.businessNumber != null">
257
+        business_number = #{record.businessNumber,jdbcType=VARCHAR},
258
+      </if>
259
+      <if test="record.carBrand != null">
260
+        car_brand = #{record.carBrand,jdbcType=VARCHAR},
261
+      </if>
262
+      <if test="record.businessType != null">
263
+        business_type = #{record.businessType,jdbcType=VARCHAR},
264
+      </if>
265
+      <if test="record.lspz != null">
266
+        lspz = #{record.lspz,jdbcType=INTEGER},
267
+      </if>
268
+      <if test="record.grainNumber != null">
269
+        grain_number = #{record.grainNumber,jdbcType=VARCHAR},
270
+      </if>
271
+      <if test="record.storehouseId != null">
272
+        storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
273
+      </if>
274
+      <if test="record.warehouseId != null">
275
+        warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
276
+      </if>
277
+      <if test="record.crkTime != null">
278
+        crk_time = #{record.crkTime,jdbcType=TIMESTAMP},
279
+      </if>
280
+      <if test="record.orgId != null">
281
+        org_id = #{record.orgId,jdbcType=INTEGER},
282
+      </if>
283
+      <if test="record.createTime != null">
284
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
285
+      </if>
286
+      <if test="record.sjly != null">
287
+        sjly = #{record.sjly,jdbcType=INTEGER},
288
+      </if>
289
+      <if test="record.updatetime != null">
290
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
291
+      </if>
292
+    </set>
293
+    <if test="_parameter != null">
294
+      <include refid="Update_By_Example_Where_Clause" />
295
+    </if>
296
+  </update>
297
+  <update id="updateByExample" parameterType="map">
298
+    update business_agent_qc
299
+    set id = #{record.id,jdbcType=INTEGER},
300
+      agent_id = #{record.agentId,jdbcType=INTEGER},
301
+      agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
302
+      notice = #{record.notice,jdbcType=VARCHAR},
303
+      business_number = #{record.businessNumber,jdbcType=VARCHAR},
304
+      car_brand = #{record.carBrand,jdbcType=VARCHAR},
305
+      business_type = #{record.businessType,jdbcType=VARCHAR},
306
+      lspz = #{record.lspz,jdbcType=INTEGER},
307
+      grain_number = #{record.grainNumber,jdbcType=VARCHAR},
308
+      storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
309
+      warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
310
+      crk_time = #{record.crkTime,jdbcType=TIMESTAMP},
311
+      org_id = #{record.orgId,jdbcType=INTEGER},
312
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
313
+      sjly = #{record.sjly,jdbcType=INTEGER},
314
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
315
+    <if test="_parameter != null">
316
+      <include refid="Update_By_Example_Where_Clause" />
317
+    </if>
318
+  </update>
319
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentQc">
320
+    update business_agent_qc
321
+    <set>
322
+      <if test="agentId != null">
323
+        agent_id = #{agentId,jdbcType=INTEGER},
324
+      </if>
325
+      <if test="agentDepotId != null">
326
+        agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
327
+      </if>
328
+      <if test="notice != null">
329
+        notice = #{notice,jdbcType=VARCHAR},
330
+      </if>
331
+      <if test="businessNumber != null">
332
+        business_number = #{businessNumber,jdbcType=VARCHAR},
333
+      </if>
334
+      <if test="carBrand != null">
335
+        car_brand = #{carBrand,jdbcType=VARCHAR},
336
+      </if>
337
+      <if test="businessType != null">
338
+        business_type = #{businessType,jdbcType=VARCHAR},
339
+      </if>
340
+      <if test="lspz != null">
341
+        lspz = #{lspz,jdbcType=INTEGER},
342
+      </if>
343
+      <if test="grainNumber != null">
344
+        grain_number = #{grainNumber,jdbcType=VARCHAR},
345
+      </if>
346
+      <if test="storehouseId != null">
347
+        storehouse_id = #{storehouseId,jdbcType=INTEGER},
348
+      </if>
349
+      <if test="warehouseId != null">
350
+        warehouse_id = #{warehouseId,jdbcType=INTEGER},
351
+      </if>
352
+      <if test="crkTime != null">
353
+        crk_time = #{crkTime,jdbcType=TIMESTAMP},
354
+      </if>
355
+      <if test="orgId != null">
356
+        org_id = #{orgId,jdbcType=INTEGER},
357
+      </if>
358
+      <if test="createTime != null">
359
+        create_time = #{createTime,jdbcType=TIMESTAMP},
360
+      </if>
361
+      <if test="sjly != null">
362
+        sjly = #{sjly,jdbcType=INTEGER},
363
+      </if>
364
+      <if test="updatetime != null">
365
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
366
+      </if>
367
+    </set>
368
+    where id = #{id,jdbcType=INTEGER}
369
+  </update>
370
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.agent.crk.model.BusinessAgentQc">
371
+    update business_agent_qc
372
+    set agent_id = #{agentId,jdbcType=INTEGER},
373
+      agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
374
+      notice = #{notice,jdbcType=VARCHAR},
375
+      business_number = #{businessNumber,jdbcType=VARCHAR},
376
+      car_brand = #{carBrand,jdbcType=VARCHAR},
377
+      business_type = #{businessType,jdbcType=VARCHAR},
378
+      lspz = #{lspz,jdbcType=INTEGER},
379
+      grain_number = #{grainNumber,jdbcType=VARCHAR},
380
+      storehouse_id = #{storehouseId,jdbcType=INTEGER},
381
+      warehouse_id = #{warehouseId,jdbcType=INTEGER},
382
+      crk_time = #{crkTime,jdbcType=TIMESTAMP},
383
+      org_id = #{orgId,jdbcType=INTEGER},
384
+      create_time = #{createTime,jdbcType=TIMESTAMP},
385
+      sjly = #{sjly,jdbcType=INTEGER},
386
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
387
+    where id = #{id,jdbcType=INTEGER}
388
+  </update>
389
+
390
+  <select id="getDataByExample" parameterType="java.util.Map" resultType="java.util.HashMap">
391
+    SELECT
392
+    a.*
393
+    FROM
394
+    (SELECT
395
+        qc.id,qc.agent_id,qc.agent_depot_id,qc.notice,qc.business_number,qc.car_brand,
396
+        qc.business_type,qc.lspz,qc.grain_number,qc.storehouse_id,
397
+        qc.warehouse_id,qc.crk_time,qc.org_id,qc.create_time,qc.sjly,
398
+        ware.warehouse_name,store.storehouse_name,agent.agent_name,
399
+        depot.agent_depot_name,qc.updatetime
400
+    FROM
401
+        business_agent_qc qc
402
+        LEFT JOIN business_agent agent ON agent.id = qc.agent_id AND agent.org_id = #{orgId,jdbcType=INTEGER}
403
+        LEFT JOIN business_agent_depot depot ON depot.id = qc.agent_depot_id AND depot.org_id = #{orgId,jdbcType=INTEGER}
404
+        LEFT JOIN basic_storehouse store ON store.storehouse_id = qc.storehouse_id AND store.org_id = #{orgId,jdbcType=INTEGER}
405
+        LEFT JOIN basic_warehouse ware ON ware.warehouse_id = qc.warehouse_id AND ware.org_id = #{orgId,jdbcType=INTEGER}
406
+    WHERE ware.library_type = 1 AND store.library_type = 1 AND qc.org_id = #{orgId,jdbcType=INTEGER}
407
+    <if test="agentId != null">
408
+      AND qc.agent_id = #{agentId,jdbcType=INTEGER}
409
+    </if>
410
+    <if test="agentDepotId != null">
411
+      AND qc.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
412
+    </if>
413
+    <if test="storehouseId != null">
414
+      AND qc.storehouse_id = #{storehouseId,jdbcType=INTEGER}
415
+    </if>
416
+    <if test="warehouseId != null">
417
+      AND qc.warehouse_id = #{warehouseId,jdbcType=INTEGER}
418
+    </if>
419
+    <if test="businessType != null">
420
+      AND qc.business_type = #{businessType,jdbcType=INTEGER}
421
+    </if>
422
+    <if test="lspz != null">
423
+      AND qc.lspz = #{lspz,jdbcType=INTEGER}
424
+    </if>
425
+    UNION ALL
426
+    SELECT
427
+        qc.id,qc.agent_id,qc.agent_depot_id,qc.notice,qc.business_number,qc.car_brand,
428
+        qc.business_type,qc.lspz,qc.grain_number,qc.storehouse_id,
429
+        qc.warehouse_id,qc.crk_time,qc.org_id,qc.create_time,qc.sjly,
430
+        ware.warehouse_name,store.storehouse_name,agent.agent_name,
431
+        depot.agent_depot_name,qc.updatetime
432
+    FROM
433
+    business_agent_qc qc
434
+        INNER JOIN business_agent_storehouse aStore ON aStore.storehouse_id = qc.storehouse_id
435
+        INNER JOIN business_agent_warehouse aWare ON aWare.warehouse_id = qc.warehouse_id
436
+        LEFT JOIN business_agent agent ON agent.id = qc.agent_id
437
+        LEFT JOIN business_agent_depot depot ON depot.id = qc.agent_depot_id
438
+        LEFT JOIN basic_storehouse store ON store.storehouse_id = aStore.storehouse_id
439
+        LEFT JOIN basic_warehouse ware ON ware.warehouse_id = aWare.warehouse_id
440
+    WHERE qc.org_id = #{orgId,jdbcType=INTEGER}
441
+    <if test="agentId != null">
442
+      AND qc.agent_id = #{agentId,jdbcType=INTEGER}
443
+    </if>
444
+    <if test="agentDepotId != null">
445
+      AND qc.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
446
+    </if>
447
+    <if test="storehouseId != null">
448
+      AND qc.storehouse_id = #{storehouseId,jdbcType=INTEGER}
449
+    </if>
450
+    <if test="warehouseId != null">
451
+      AND qc.warehouse_id = #{warehouseId,jdbcType=INTEGER}
452
+    </if>
453
+    <if test="businessType != null">
454
+      AND qc.business_type = #{businessType,jdbcType=INTEGER}
455
+    </if>
456
+    <if test="lspz != null">
457
+      AND qc.lspz = #{lspz,jdbcType=INTEGER}
458
+    </if>
459
+    ) a
460
+    ORDER BY a.updatetime DESC
461
+  </select>
462
+  
463
+  <!-- 查询代储库仓房货位信息 -->
464
+  <select id="selectAgentHouseWareList" parameterType="java.util.Map" resultType="java.util.Map">
465
+    SELECT 
466
+    	a.depot_id+"" unitid,
467
+    	c.warehouse_id hwh,
468
+    	c.qccrk_tbsj modifydate
469
+    FROM business_agent_depot a
470
+	LEFT JOIN business_agent_storehouse b ON b.agent_depot_id=a.id
471
+	LEFT JOIN business_agent_warehouse c ON c.agent_storehouse_id=b.id 
472
+	WHERE a.depot_id != 0 AND b.storehouse_id IS NOT NULL AND c.warehouse_id IS NOT NULL 
473
+	<if test="orgId != null">
474
+	and c.org_id=#{orgId,jdbcType=INTEGER}
475
+	</if>
476
+  </select>
477
+</mapper>

+ 293 - 0
src/main/java/com/chinaitop/depot/agent/crk/model/BusinessAgentHc.java

@@ -0,0 +1,293 @@
1
+package com.chinaitop.depot.agent.crk.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessAgentHc {
6
+    private Integer id;
7
+
8
+    private Integer agentId;
9
+
10
+    private Integer agentDepotId;
11
+
12
+    private String notice;
13
+
14
+    private String inbound;
15
+
16
+    private String trainNo;
17
+
18
+    private String businessType;
19
+
20
+    private Integer lspz;
21
+
22
+    private String grainNumber;
23
+
24
+    private Integer storehouseId;
25
+
26
+    private Integer warehouseId;
27
+
28
+    private Date crkTime;
29
+
30
+    private Integer orgId;
31
+
32
+    private Date createTime;
33
+
34
+    private Integer sjly;
35
+
36
+    private Date updatetime;
37
+
38
+    /**
39
+     * 
40
+     * @return id 
41
+     */
42
+    public Integer getId() {
43
+        return id;
44
+    }
45
+
46
+    /**
47
+     * 
48
+     * @param id 
49
+     */
50
+    public void setId(Integer id) {
51
+        this.id = id;
52
+    }
53
+
54
+    /**
55
+     * 代储点id
56
+     * @return agent_id 代储点id
57
+     */
58
+    public Integer getAgentId() {
59
+        return agentId;
60
+    }
61
+
62
+    /**
63
+     * 代储点id
64
+     * @param agentId 代储点id
65
+     */
66
+    public void setAgentId(Integer agentId) {
67
+        this.agentId = agentId;
68
+    }
69
+
70
+    /**
71
+     * 代储库id
72
+     * @return agent_depot_id 代储库id
73
+     */
74
+    public Integer getAgentDepotId() {
75
+        return agentDepotId;
76
+    }
77
+
78
+    /**
79
+     * 代储库id
80
+     * @param agentDepotId 代储库id
81
+     */
82
+    public void setAgentDepotId(Integer agentDepotId) {
83
+        this.agentDepotId = agentDepotId;
84
+    }
85
+
86
+    /**
87
+     * 通知单编号
88
+     * @return notice 通知单编号
89
+     */
90
+    public String getNotice() {
91
+        return notice;
92
+    }
93
+
94
+    /**
95
+     * 通知单编号
96
+     * @param notice 通知单编号
97
+     */
98
+    public void setNotice(String notice) {
99
+        this.notice = notice == null ? null : notice.trim();
100
+    }
101
+
102
+    /**
103
+     * 入站单号
104
+     * @return inbound 入站单号
105
+     */
106
+    public String getInbound() {
107
+        return inbound;
108
+    }
109
+
110
+    /**
111
+     * 入站单号
112
+     * @param inbound 入站单号
113
+     */
114
+    public void setInbound(String inbound) {
115
+        this.inbound = inbound == null ? null : inbound.trim();
116
+    }
117
+
118
+    /**
119
+     * 火车皮号
120
+     * @return train_no 火车皮号
121
+     */
122
+    public String getTrainNo() {
123
+        return trainNo;
124
+    }
125
+
126
+    /**
127
+     * 火车皮号
128
+     * @param trainNo 火车皮号
129
+     */
130
+    public void setTrainNo(String trainNo) {
131
+        this.trainNo = trainNo == null ? null : trainNo.trim();
132
+    }
133
+
134
+    /**
135
+     * 业务类型
136
+     * @return business_type 业务类型
137
+     */
138
+    public String getBusinessType() {
139
+        return businessType;
140
+    }
141
+
142
+    /**
143
+     * 业务类型
144
+     * @param businessType 业务类型
145
+     */
146
+    public void setBusinessType(String businessType) {
147
+        this.businessType = businessType == null ? null : businessType.trim();
148
+    }
149
+
150
+    /**
151
+     * 粮食品种
152
+     * @return lspz 粮食品种
153
+     */
154
+    public Integer getLspz() {
155
+        return lspz;
156
+    }
157
+
158
+    /**
159
+     * 粮食品种
160
+     * @param lspz 粮食品种
161
+     */
162
+    public void setLspz(Integer lspz) {
163
+        this.lspz = lspz;
164
+    }
165
+
166
+    /**
167
+     * 粮食数量
168
+     * @return grain_number 粮食数量
169
+     */
170
+    public String getGrainNumber() {
171
+        return grainNumber;
172
+    }
173
+
174
+    /**
175
+     * 粮食数量
176
+     * @param grainNumber 粮食数量
177
+     */
178
+    public void setGrainNumber(String grainNumber) {
179
+        this.grainNumber = grainNumber == null ? null : grainNumber.trim();
180
+    }
181
+
182
+    /**
183
+     * 仓房id
184
+     * @return storehouse_id 仓房id
185
+     */
186
+    public Integer getStorehouseId() {
187
+        return storehouseId;
188
+    }
189
+
190
+    /**
191
+     * 仓房id
192
+     * @param storehouseId 仓房id
193
+     */
194
+    public void setStorehouseId(Integer storehouseId) {
195
+        this.storehouseId = storehouseId;
196
+    }
197
+
198
+    /**
199
+     * 货位id
200
+     * @return warehouse_id 货位id
201
+     */
202
+    public Integer getWarehouseId() {
203
+        return warehouseId;
204
+    }
205
+
206
+    /**
207
+     * 货位id
208
+     * @param warehouseId 货位id
209
+     */
210
+    public void setWarehouseId(Integer warehouseId) {
211
+        this.warehouseId = warehouseId;
212
+    }
213
+
214
+    /**
215
+     * 出入库日期
216
+     * @return crk_time 出入库日期
217
+     */
218
+    public Date getCrkTime() {
219
+        return crkTime;
220
+    }
221
+
222
+    /**
223
+     * 出入库日期
224
+     * @param crkTime 出入库日期
225
+     */
226
+    public void setCrkTime(Date crkTime) {
227
+        this.crkTime = crkTime;
228
+    }
229
+
230
+    /**
231
+     * 组织结构id
232
+     * @return org_id 组织结构id
233
+     */
234
+    public Integer getOrgId() {
235
+        return orgId;
236
+    }
237
+
238
+    /**
239
+     * 组织结构id
240
+     * @param orgId 组织结构id
241
+     */
242
+    public void setOrgId(Integer orgId) {
243
+        this.orgId = orgId;
244
+    }
245
+
246
+    /**
247
+     * 创建时间
248
+     * @return create_time 创建时间
249
+     */
250
+    public Date getCreateTime() {
251
+        return createTime;
252
+    }
253
+
254
+    /**
255
+     * 创建时间
256
+     * @param createTime 创建时间
257
+     */
258
+    public void setCreateTime(Date createTime) {
259
+        this.createTime = createTime;
260
+    }
261
+
262
+    /**
263
+     * 数据来源(0是手动添加,1是同步出入库数据)
264
+     * @return sjly 数据来源(0是手动添加,1是同步出入库数据)
265
+     */
266
+    public Integer getSjly() {
267
+        return sjly;
268
+    }
269
+
270
+    /**
271
+     * 数据来源(0是手动添加,1是同步出入库数据)
272
+     * @param sjly 数据来源(0是手动添加,1是同步出入库数据)
273
+     */
274
+    public void setSjly(Integer sjly) {
275
+        this.sjly = sjly;
276
+    }
277
+
278
+    /**
279
+     * 
280
+     * @return updatetime 
281
+     */
282
+    public Date getUpdatetime() {
283
+        return updatetime;
284
+    }
285
+
286
+    /**
287
+     * 
288
+     * @param updatetime 
289
+     */
290
+    public void setUpdatetime(Date updatetime) {
291
+        this.updatetime = updatetime;
292
+    }
293
+}

File diff suppressed because it is too large
+ 1229 - 0
src/main/java/com/chinaitop/depot/agent/crk/model/BusinessAgentHcExample.java


+ 293 - 0
src/main/java/com/chinaitop/depot/agent/crk/model/BusinessAgentQc.java

@@ -0,0 +1,293 @@
1
+package com.chinaitop.depot.agent.crk.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessAgentQc {
6
+    private Integer id;
7
+
8
+    private Integer agentId;
9
+
10
+    private Integer agentDepotId;
11
+
12
+    private String notice;
13
+
14
+    private String businessNumber;
15
+
16
+    private String carBrand;
17
+
18
+    private String businessType;
19
+
20
+    private Integer lspz;
21
+
22
+    private String grainNumber;
23
+
24
+    private Integer storehouseId;
25
+
26
+    private Integer warehouseId;
27
+
28
+    private Date crkTime;
29
+
30
+    private Integer orgId;
31
+
32
+    private Date createTime;
33
+
34
+    private Integer sjly;
35
+
36
+    private Date updatetime;
37
+
38
+    /**
39
+     * 
40
+     * @return id 
41
+     */
42
+    public Integer getId() {
43
+        return id;
44
+    }
45
+
46
+    /**
47
+     * 
48
+     * @param id 
49
+     */
50
+    public void setId(Integer id) {
51
+        this.id = id;
52
+    }
53
+
54
+    /**
55
+     * 代储点id
56
+     * @return agent_id 代储点id
57
+     */
58
+    public Integer getAgentId() {
59
+        return agentId;
60
+    }
61
+
62
+    /**
63
+     * 代储点id
64
+     * @param agentId 代储点id
65
+     */
66
+    public void setAgentId(Integer agentId) {
67
+        this.agentId = agentId;
68
+    }
69
+
70
+    /**
71
+     * 代储库id
72
+     * @return agent_depot_id 代储库id
73
+     */
74
+    public Integer getAgentDepotId() {
75
+        return agentDepotId;
76
+    }
77
+
78
+    /**
79
+     * 代储库id
80
+     * @param agentDepotId 代储库id
81
+     */
82
+    public void setAgentDepotId(Integer agentDepotId) {
83
+        this.agentDepotId = agentDepotId;
84
+    }
85
+
86
+    /**
87
+     * 通知单编号
88
+     * @return notice 通知单编号
89
+     */
90
+    public String getNotice() {
91
+        return notice;
92
+    }
93
+
94
+    /**
95
+     * 通知单编号
96
+     * @param notice 通知单编号
97
+     */
98
+    public void setNotice(String notice) {
99
+        this.notice = notice == null ? null : notice.trim();
100
+    }
101
+
102
+    /**
103
+     * 业务单号
104
+     * @return business_number 业务单号
105
+     */
106
+    public String getBusinessNumber() {
107
+        return businessNumber;
108
+    }
109
+
110
+    /**
111
+     * 业务单号
112
+     * @param businessNumber 业务单号
113
+     */
114
+    public void setBusinessNumber(String businessNumber) {
115
+        this.businessNumber = businessNumber == null ? null : businessNumber.trim();
116
+    }
117
+
118
+    /**
119
+     * 汽车牌号
120
+     * @return car_brand 汽车牌号
121
+     */
122
+    public String getCarBrand() {
123
+        return carBrand;
124
+    }
125
+
126
+    /**
127
+     * 汽车牌号
128
+     * @param carBrand 汽车牌号
129
+     */
130
+    public void setCarBrand(String carBrand) {
131
+        this.carBrand = carBrand == null ? null : carBrand.trim();
132
+    }
133
+
134
+    /**
135
+     * 业务类型
136
+     * @return business_type 业务类型
137
+     */
138
+    public String getBusinessType() {
139
+        return businessType;
140
+    }
141
+
142
+    /**
143
+     * 业务类型
144
+     * @param businessType 业务类型
145
+     */
146
+    public void setBusinessType(String businessType) {
147
+        this.businessType = businessType == null ? null : businessType.trim();
148
+    }
149
+
150
+    /**
151
+     * 粮食品种
152
+     * @return lspz 粮食品种
153
+     */
154
+    public Integer getLspz() {
155
+        return lspz;
156
+    }
157
+
158
+    /**
159
+     * 粮食品种
160
+     * @param lspz 粮食品种
161
+     */
162
+    public void setLspz(Integer lspz) {
163
+        this.lspz = lspz;
164
+    }
165
+
166
+    /**
167
+     * 粮食数量
168
+     * @return grain_number 粮食数量
169
+     */
170
+    public String getGrainNumber() {
171
+        return grainNumber;
172
+    }
173
+
174
+    /**
175
+     * 粮食数量
176
+     * @param grainNumber 粮食数量
177
+     */
178
+    public void setGrainNumber(String grainNumber) {
179
+        this.grainNumber = grainNumber == null ? null : grainNumber.trim();
180
+    }
181
+
182
+    /**
183
+     * 仓房id
184
+     * @return storehouse_id 仓房id
185
+     */
186
+    public Integer getStorehouseId() {
187
+        return storehouseId;
188
+    }
189
+
190
+    /**
191
+     * 仓房id
192
+     * @param storehouseId 仓房id
193
+     */
194
+    public void setStorehouseId(Integer storehouseId) {
195
+        this.storehouseId = storehouseId;
196
+    }
197
+
198
+    /**
199
+     * 货位id
200
+     * @return warehouse_id 货位id
201
+     */
202
+    public Integer getWarehouseId() {
203
+        return warehouseId;
204
+    }
205
+
206
+    /**
207
+     * 货位id
208
+     * @param warehouseId 货位id
209
+     */
210
+    public void setWarehouseId(Integer warehouseId) {
211
+        this.warehouseId = warehouseId;
212
+    }
213
+
214
+    /**
215
+     * 出入库日期
216
+     * @return crk_time 出入库日期
217
+     */
218
+    public Date getCrkTime() {
219
+        return crkTime;
220
+    }
221
+
222
+    /**
223
+     * 出入库日期
224
+     * @param crkTime 出入库日期
225
+     */
226
+    public void setCrkTime(Date crkTime) {
227
+        this.crkTime = crkTime;
228
+    }
229
+
230
+    /**
231
+     * 组织结构id
232
+     * @return org_id 组织结构id
233
+     */
234
+    public Integer getOrgId() {
235
+        return orgId;
236
+    }
237
+
238
+    /**
239
+     * 组织结构id
240
+     * @param orgId 组织结构id
241
+     */
242
+    public void setOrgId(Integer orgId) {
243
+        this.orgId = orgId;
244
+    }
245
+
246
+    /**
247
+     * 创建时间
248
+     * @return create_time 创建时间
249
+     */
250
+    public Date getCreateTime() {
251
+        return createTime;
252
+    }
253
+
254
+    /**
255
+     * 创建时间
256
+     * @param createTime 创建时间
257
+     */
258
+    public void setCreateTime(Date createTime) {
259
+        this.createTime = createTime;
260
+    }
261
+
262
+    /**
263
+     * 数据来源(0是手动添加,1是同步出入库数据)
264
+     * @return sjly 数据来源(0是手动添加,1是同步出入库数据)
265
+     */
266
+    public Integer getSjly() {
267
+        return sjly;
268
+    }
269
+
270
+    /**
271
+     * 数据来源(0是手动添加,1是同步出入库数据)
272
+     * @param sjly 数据来源(0是手动添加,1是同步出入库数据)
273
+     */
274
+    public void setSjly(Integer sjly) {
275
+        this.sjly = sjly;
276
+    }
277
+
278
+    /**
279
+     * 
280
+     * @return updatetime 
281
+     */
282
+    public Date getUpdatetime() {
283
+        return updatetime;
284
+    }
285
+
286
+    /**
287
+     * 
288
+     * @param updatetime 
289
+     */
290
+    public void setUpdatetime(Date updatetime) {
291
+        this.updatetime = updatetime;
292
+    }
293
+}

File diff suppressed because it is too large
+ 1229 - 0
src/main/java/com/chinaitop/depot/agent/crk/model/BusinessAgentQcExample.java


+ 48 - 0
src/main/java/com/chinaitop/depot/agent/crk/service/agentHcService.java

@@ -0,0 +1,48 @@
1
+package com.chinaitop.depot.agent.crk.service;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+
6
+import com.chinaitop.depot.agent.crk.model.BusinessAgentHc;
7
+
8
+public interface agentHcService {
9
+
10
+    /**
11
+     * 查询代储点信息记录
12
+     * @param map
13
+     * @return
14
+     */
15
+    List<Map<String, Object>> getAgentHcList(Map<String, Object> map);
16
+
17
+    void add(BusinessAgentHc user);
18
+
19
+    void update(BusinessAgentHc user);
20
+
21
+    void updateDeleteById(Integer id);
22
+
23
+    BusinessAgentHc findById(Integer id);
24
+
25
+    /**
26
+     * 导入
27
+     *
28
+     * @param list
29
+     * @param orgId
30
+     * @return
31
+     */
32
+    String importData(List<List<String>> list, Integer orgId, Map<String, Object> agentMap);
33
+
34
+    /**
35
+     * 查询代储库正常使用的货位数据信息
36
+     * 
37
+     * @param paramMap 条件
38
+     * @return
39
+     */
40
+	List<Map<String, Object>> selectAgentHouseWareList(Map<String, Object> paramMap);
41
+
42
+	/**
43
+	 * 修改代储点货位表的汽车出入库最后同步时间
44
+	 * 
45
+	 * @param orgId 单位ID
46
+	 */
47
+	void updateAgentDepot(Integer orgId);
48
+}

+ 49 - 0
src/main/java/com/chinaitop/depot/agent/crk/service/agentQcService.java

@@ -0,0 +1,49 @@
1
+package com.chinaitop.depot.agent.crk.service;
2
+
3
+
4
+import java.util.List;
5
+import java.util.Map;
6
+
7
+import com.chinaitop.depot.agent.crk.model.BusinessAgentQc;
8
+
9
+public interface agentQcService {
10
+
11
+    /**
12
+     * 查询代储点信息记录
13
+     * @param map
14
+     * @return
15
+     */
16
+    List<Map<String, Object>> getAgentQcList(Map<String, Object> map);
17
+
18
+    void add(BusinessAgentQc user);
19
+
20
+    void update(BusinessAgentQc user);
21
+
22
+    void updateDeleteById(Integer id);
23
+
24
+    BusinessAgentQc findById(Integer id);
25
+
26
+    /**
27
+     * 导入
28
+     *
29
+     * @param list
30
+     * @param orgId
31
+     * @return
32
+     */
33
+    String importData(List<List<String>> list, Integer orgId, Map<String, Object> agentMap);
34
+
35
+    /**
36
+     * 修改代储点货位表的汽车出入库最后同步时间
37
+     * 
38
+     * @param orgId 单位ID
39
+     */
40
+	void updateAgentDepot(Integer orgId);
41
+
42
+	/**
43
+	 * 查询代储库正常使用的货位数据信息
44
+	 * 
45
+	 * @param paramMap 条件
46
+	 * @return
47
+	 */
48
+	List<Map<String, Object>> selectAgentHouseWareList(Map<String, Object> paramMap);
49
+}

+ 216 - 0
src/main/java/com/chinaitop/depot/agent/crk/service/impl/AgentHcServiceImpl.java

@@ -0,0 +1,216 @@
1
+package com.chinaitop.depot.agent.crk.service.impl;
2
+
3
+import java.util.Date;
4
+import java.util.HashMap;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import javax.annotation.Resource;
9
+
10
+import org.springframework.stereotype.Service;
11
+
12
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentMapper;
13
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentWarehouseMapper;
14
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse;
15
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouseExample;
16
+import com.chinaitop.depot.agent.crk.mapper.BusinessAgentHcMapper;
17
+import com.chinaitop.depot.agent.crk.model.BusinessAgentHc;
18
+import com.chinaitop.depot.agent.crk.service.agentHcService;
19
+import com.chinaitop.utils.ParameterUtil;
20
+
21
+@Service
22
+public class AgentHcServiceImpl implements agentHcService {
23
+
24
+    @Resource
25
+    private BusinessAgentHcMapper businessAgentHcMapper;
26
+
27
+    @Resource
28
+    private BusinessAgentMapper BusinessAgentMapper;
29
+
30
+    @Resource
31
+	private BusinessAgentWarehouseMapper agentWareHouseMapper;
32
+
33
+    /**
34
+     * 查询仓储处作业记录
35
+     * * @param map
36
+     * @return
37
+     */
38
+    @Override
39
+    public List<Map<String, Object>> getAgentHcList(Map<String, Object> map) {
40
+        return businessAgentHcMapper.getDataByExample(map);
41
+    }
42
+
43
+    @Override
44
+    public void add(BusinessAgentHc agent) {
45
+        businessAgentHcMapper.insert(agent);
46
+    }
47
+
48
+    @Override
49
+    public void update(BusinessAgentHc camera) {
50
+        businessAgentHcMapper.updateByPrimaryKey(camera);
51
+    }
52
+
53
+    @Override
54
+    public void updateDeleteById(Integer agentId) {
55
+        businessAgentHcMapper.deleteByPrimaryKey(agentId);
56
+    }
57
+
58
+    @Override
59
+    public BusinessAgentHc findById(Integer id) {
60
+        return businessAgentHcMapper.selectByPrimaryKey(id);
61
+    }
62
+
63
+    @Override
64
+    public String importData(List<List<String>> list, Integer orgId, Map<String, Object> agentMap) {
65
+        Date date = new Date();
66
+        BusinessAgentHc agent = null;
67
+        Map<String,Object> enumData = new HashMap<>();
68
+
69
+        String msg = "";
70
+        int len = 0;
71
+
72
+        for (int i = 0; i < list.size(); i++) {
73
+            List<String> revList = list.get(i);
74
+
75
+            for (int j = 0; j < revList.size(); j++) {
76
+                switch(j) {
77
+                    case 0:
78
+                        //通知单编号
79
+                        agent = new BusinessAgentHc();
80
+                        if (ParameterUtil.isnotnull(revList.get(j))) {
81
+                            len = revList.get(j).length();
82
+                            if (len > 50) {
83
+                                msg = "第 "+(i+3)+" 行第 1 列的值的长度不能超过50!";
84
+                                return msg;
85
+                            }
86
+                            agent.setNotice(revList.get(j));
87
+                        }
88
+                        agent.setCreateTime(date);//创建时间
89
+                        agent.setOrgId(orgId);
90
+                        break;
91
+                    case 1:
92
+                        //入站单号
93
+                        if (ParameterUtil.isnotnull(revList.get(j))) {
94
+                            len = revList.get(j).length();
95
+                            if (len > 50) {
96
+                                msg = "第 "+(i+3)+" 行第 2 列的值的长度不能超过50!";
97
+                                return msg;
98
+                            }
99
+                        }
100
+                        agent.setInbound(revList.get(j));
101
+                        break;
102
+                    case 2:
103
+                        //火车皮号
104
+                        if (ParameterUtil.isnotnull(revList.get(j))) {
105
+                            len = revList.get(j).length();
106
+                            if (len > 50) {
107
+                                msg = "第 "+(i+3)+" 行第 3 列的值的长度不能超过50!";
108
+                                return msg;
109
+                            }
110
+                        }
111
+                        agent.setTrainNo(revList.get(j));
112
+                        break;
113
+                    case 3:
114
+                        //业务类型
115
+                        len = revList.get(j).length();
116
+                        if (len > 20) {
117
+                            msg = "第 "+(i+3)+" 行第 4 列的值的长度不能超过20!";
118
+                            return msg;
119
+                        }
120
+                        agent.setBusinessType(revList.get(j));
121
+                        break;
122
+                    case 4:
123
+                        //粮油品种
124
+                        len = revList.get(j).length();
125
+                        if (len > 20) {
126
+                            msg = "第 "+(i+3)+" 行第 5 列的值的长度不能超过20!";
127
+                            return msg;
128
+                        }
129
+                        enumData.put("enumName", revList.get(j));
130
+                        enumData.put("parentId", "1061");
131
+                        Map<String,Object> enumId = BusinessAgentMapper.getEnumId(enumData);
132
+                        if(enumId.size() == 0){
133
+                            msg = "第 "+(i+3)+" 行第 5 列的值的不正确,请查询后再添加!";
134
+                            return msg;
135
+                        }
136
+                        agent.setLspz(Integer.parseInt(enumId.get("enumid").toString()));
137
+                        break;
138
+                    case 5:
139
+                        //数量(公斤)
140
+                        len = revList.get(j).length();
141
+                        if (len > 30) {
142
+                            msg = "第 "+(i+3)+" 行第 6 列的值的长度不能超过30!";
143
+                            return msg;
144
+                        }
145
+                        agent.setGrainNumber(revList.get(j));
146
+                        break;
147
+                    case 6:
148
+                        //仓房名称
149
+                        len = revList.get(j).length();
150
+                        if (len > 20) {
151
+                            msg = "第 "+(i+3)+" 行第 7 列的值的长度不能超过20!";
152
+                            return msg;
153
+                        }
154
+                        enumData.put("storehouseName", revList.get(j));
155
+                        enumData.put("depotId", agentMap.get("depotId"));
156
+                        Map<String,Object> storehouseId = BusinessAgentMapper.getStorehouseId(enumData);
157
+                        if(ParameterUtil.isnull(storehouseId)){
158
+                            msg = "第 "+(i+3)+" 行第 7 列的值的不正确,请查询后再添加!";
159
+                            return msg;
160
+                        }
161
+                        agent.setStorehouseId(Integer.parseInt(storehouseId.get("storehouseid").toString()));
162
+                        break;
163
+                    case 7:
164
+                        //货位名称
165
+                        len = revList.get(j).length();
166
+                        if (len > 20) {
167
+                            msg = "第 "+(i+3)+" 行第 8 列的值的长度不能超过20!";
168
+                            return msg;
169
+                        }
170
+                        enumData.put("warehouseName", revList.get(j));
171
+                        Map<String,Object> warehouseId = BusinessAgentMapper.getWarehouseId(enumData);
172
+                        if(ParameterUtil.isnull(warehouseId)){
173
+                            msg = "第 "+(i+3)+" 行第 8 列的值的不正确,请查询后再添加!";
174
+                            return msg;
175
+                        }
176
+                        agent.setWarehouseId(Integer.parseInt(warehouseId.get("warehouseid").toString()));
177
+                        break;
178
+                    case 8:
179
+                        //出入库日期
180
+                        len = revList.get(j).length();
181
+                        if (len > 100) {
182
+                            msg = "第 "+(i+3)+" 行第 5 列的值的长度不能超过100!";
183
+                            return msg;
184
+                        }
185
+                        agent.setCrkTime(ParameterUtil.string2date(revList.get(j)));
186
+                        break;
187
+                    default :
188
+                        break;
189
+                }
190
+            }
191
+            agent.setAgentId(Integer.parseInt(agentMap.get("agentid").toString()));
192
+            agent.setAgentDepotId(Integer.parseInt(agentMap.get("depotid").toString()));
193
+            businessAgentHcMapper.insert(agent);
194
+        }
195
+        return msg;
196
+    }
197
+
198
+	@Override
199
+	public List<Map<String, Object>> selectAgentHouseWareList(Map<String, Object> paramMap) {
200
+		List<Map<String, Object>> list = businessAgentHcMapper.selectAgentHouseWareList(paramMap);
201
+		return list;
202
+	}
203
+
204
+	@Override
205
+	public void updateAgentDepot(Integer orgId) {
206
+		//要修改的值
207
+		BusinessAgentWarehouse record = new BusinessAgentWarehouse();
208
+		record.setHccrkTbsj(new Date());
209
+		//修改条件
210
+		BusinessAgentWarehouseExample example = new BusinessAgentWarehouseExample();
211
+		BusinessAgentWarehouseExample.Criteria criteria = example.createCriteria();
212
+		criteria.andOrgIdEqualTo(orgId);
213
+		criteria.andDelFlagEqualTo(1);
214
+		agentWareHouseMapper.updateByExampleSelective(record, example);
215
+	}
216
+}

+ 216 - 0
src/main/java/com/chinaitop/depot/agent/crk/service/impl/AgentQcServiceImpl.java

@@ -0,0 +1,216 @@
1
+package com.chinaitop.depot.agent.crk.service.impl;
2
+
3
+import java.util.Date;
4
+import java.util.HashMap;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import javax.annotation.Resource;
9
+
10
+import org.springframework.stereotype.Service;
11
+
12
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentMapper;
13
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentWarehouseMapper;
14
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouse;
15
+import com.chinaitop.depot.agent.basic.model.BusinessAgentWarehouseExample;
16
+import com.chinaitop.depot.agent.crk.mapper.BusinessAgentQcMapper;
17
+import com.chinaitop.depot.agent.crk.model.BusinessAgentQc;
18
+import com.chinaitop.depot.agent.crk.service.agentQcService;
19
+import com.chinaitop.utils.ParameterUtil;
20
+
21
+@Service
22
+public class AgentQcServiceImpl implements agentQcService {
23
+
24
+    @Resource
25
+    private BusinessAgentQcMapper businessAgentQcMapper;
26
+
27
+    @Resource
28
+    private BusinessAgentMapper BusinessAgentMapper;
29
+
30
+    @Resource
31
+	private BusinessAgentWarehouseMapper agentWareHouseMapper;
32
+
33
+    /**
34
+     * 查询仓储处作业记录
35
+     * * @param map
36
+     * @return
37
+     */
38
+    @Override
39
+    public List<Map<String, Object>> getAgentQcList(Map<String, Object> map) {
40
+        return businessAgentQcMapper.getDataByExample(map);
41
+    }
42
+
43
+    @Override
44
+    public void add(BusinessAgentQc agent) {
45
+        businessAgentQcMapper.insert(agent);
46
+    }
47
+
48
+    @Override
49
+    public void update(BusinessAgentQc camera) {
50
+        businessAgentQcMapper.updateByPrimaryKey(camera);
51
+    }
52
+
53
+    @Override
54
+    public void updateDeleteById(Integer agentId) {
55
+        businessAgentQcMapper.deleteByPrimaryKey(agentId);
56
+    }
57
+
58
+    @Override
59
+    public BusinessAgentQc findById(Integer id) {
60
+        return businessAgentQcMapper.selectByPrimaryKey(id);
61
+    }
62
+
63
+    @Override
64
+    public String importData(List<List<String>> list, Integer orgId, Map<String, Object> agentMap) {
65
+        Date date = new Date();
66
+        BusinessAgentQc agent = null;
67
+        Map<String,Object> enumData = new HashMap<>();
68
+
69
+        String msg = "";
70
+        int len = 0;
71
+
72
+        for (int i = 0; i < list.size(); i++) {
73
+            List<String> revList = list.get(i);
74
+
75
+            for (int j = 0; j < revList.size(); j++) {
76
+                switch(j) {
77
+                    case 0:
78
+                        //通知单编号
79
+                        agent = new BusinessAgentQc();
80
+                        if (ParameterUtil.isnotnull(revList.get(j))) {
81
+                            len = revList.get(j).length();
82
+                            if (len > 50) {
83
+                                msg = "第 "+(i+3)+" 行第 1 列的值的长度不能超过50!";
84
+                                return msg;
85
+                            }
86
+                            agent.setNotice(revList.get(j));
87
+                        }
88
+                        agent.setCreateTime(date);//创建时间
89
+                        agent.setOrgId(orgId);
90
+                        break;
91
+                    case 1:
92
+                        //入站单号
93
+                        if (ParameterUtil.isnotnull(revList.get(j))) {
94
+                            len = revList.get(j).length();
95
+                            if (len > 50) {
96
+                                msg = "第 "+(i+3)+" 行第 2 列的值的长度不能超过50!";
97
+                                return msg;
98
+                            }
99
+                        }
100
+                        agent.setBusinessNumber(revList.get(j));
101
+                        break;
102
+                    case 2:
103
+                        //火车皮号
104
+                        if (ParameterUtil.isnotnull(revList.get(j))) {
105
+                            len = revList.get(j).length();
106
+                            if (len > 50) {
107
+                                msg = "第 "+(i+3)+" 行第 3 列的值的长度不能超过50!";
108
+                                return msg;
109
+                            }
110
+                        }
111
+                        agent.setCarBrand(revList.get(j));
112
+                        break;
113
+                    case 3:
114
+                        //业务类型
115
+                        len = revList.get(j).length();
116
+                        if (len > 20) {
117
+                            msg = "第 "+(i+3)+" 行第 4 列的值的长度不能超过20!";
118
+                            return msg;
119
+                        }
120
+                        agent.setBusinessType(revList.get(j));
121
+                        break;
122
+                    case 4:
123
+                        //粮油品种
124
+                        len = revList.get(j).length();
125
+                        if (len > 20) {
126
+                            msg = "第 "+(i+3)+" 行第 5 列的值的长度不能超过20!";
127
+                            return msg;
128
+                        }
129
+                        enumData.put("enumName", revList.get(j));
130
+                        enumData.put("parentId", "1061");
131
+                        Map<String,Object> enumId = BusinessAgentMapper.getEnumId(enumData);
132
+                        if(enumId.size() == 0){
133
+                            msg = "第 "+(i+3)+" 行第 5 列的值的不正确,请查询后再添加!";
134
+                            return msg;
135
+                        }
136
+                        agent.setLspz(Integer.parseInt(enumId.get("enumid").toString()));
137
+                        break;
138
+                    case 5:
139
+                        //数量(公斤)
140
+                        len = revList.get(j).length();
141
+                        if (len > 30) {
142
+                            msg = "第 "+(i+3)+" 行第 6 列的值的长度不能超过30!";
143
+                            return msg;
144
+                        }
145
+                        agent.setGrainNumber(revList.get(j));
146
+                        break;
147
+                    case 6:
148
+                        //仓房名称
149
+                        len = revList.get(j).length();
150
+                        if (len > 20) {
151
+                            msg = "第 "+(i+3)+" 行第 7 列的值的长度不能超过20!";
152
+                            return msg;
153
+                        }
154
+                        enumData.put("storehouseName", revList.get(j));
155
+                        enumData.put("depotId", agentMap.get("depotId"));
156
+                        Map<String,Object> storehouseId = BusinessAgentMapper.getStorehouseId(enumData);
157
+                        if(ParameterUtil.isnull(storehouseId)){
158
+                            msg = "第 "+(i+3)+" 行第 7 列的值的不正确,请查询后再添加!";
159
+                            return msg;
160
+                        }
161
+                        agent.setStorehouseId(Integer.parseInt(storehouseId.get("storehouseid").toString()));
162
+                        break;
163
+                    case 7:
164
+                        //货位名称
165
+                        len = revList.get(j).length();
166
+                        if (len > 20) {
167
+                            msg = "第 "+(i+3)+" 行第 8 列的值的长度不能超过20!";
168
+                            return msg;
169
+                        }
170
+                        enumData.put("warehouseName", revList.get(j));
171
+                        Map<String,Object> warehouseId = BusinessAgentMapper.getWarehouseId(enumData);
172
+                        if(ParameterUtil.isnull(warehouseId)){
173
+                            msg = "第 "+(i+3)+" 行第 8 列的值的不正确,请查询后再添加!";
174
+                            return msg;
175
+                        }
176
+                        agent.setWarehouseId(Integer.parseInt(warehouseId.get("warehouseid").toString()));
177
+                        break;
178
+                    case 8:
179
+                        //出入库日期
180
+                        len = revList.get(j).length();
181
+                        if (len > 100) {
182
+                            msg = "第 "+(i+3)+" 行第 5 列的值的长度不能超过100!";
183
+                            return msg;
184
+                        }
185
+                        agent.setCrkTime(ParameterUtil.string2date(revList.get(j)));
186
+                        break;
187
+                    default :
188
+                        break;
189
+                }
190
+            }
191
+            agent.setAgentId(Integer.parseInt(agentMap.get("agentid").toString()));
192
+            agent.setAgentDepotId(Integer.parseInt(agentMap.get("depotid").toString()));
193
+            businessAgentQcMapper.insert(agent);
194
+        }
195
+        return msg;
196
+    }
197
+
198
+	@Override
199
+	public void updateAgentDepot(Integer orgId) {
200
+		//要修改的值
201
+		BusinessAgentWarehouse record = new BusinessAgentWarehouse();
202
+		record.setQccrkTbsj(new Date());
203
+		//修改条件
204
+		BusinessAgentWarehouseExample example = new BusinessAgentWarehouseExample();
205
+		BusinessAgentWarehouseExample.Criteria criteria = example.createCriteria();
206
+		criteria.andOrgIdEqualTo(orgId);
207
+		criteria.andDelFlagEqualTo(1);
208
+		agentWareHouseMapper.updateByExampleSelective(record, example);
209
+	}
210
+
211
+	@Override
212
+	public List<Map<String, Object>> selectAgentHouseWareList(Map<String, Object> paramMap) {
213
+		List<Map<String, Object>> list = businessAgentQcMapper.selectAgentHouseWareList(paramMap);
214
+		return list;
215
+	}
216
+}

+ 283 - 0
src/main/java/com/chinaitop/depot/agent/number/controller/AgentNumberController.java

@@ -0,0 +1,283 @@
1
+package com.chinaitop.depot.agent.number.controller;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.HashMap;
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+import javax.annotation.Resource;
10
+import javax.servlet.http.HttpServletRequest;
11
+
12
+import org.springframework.http.MediaType;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RestController;
16
+import org.springframework.web.multipart.MultipartFile;
17
+
18
+import com.chinaitop.depot.agent.basic.model.BusinessAgentDepot;
19
+import com.chinaitop.depot.agent.basic.service.agentService;
20
+import com.chinaitop.depot.agent.bgz.service.BusinessAgentBgmxzService;
21
+import com.chinaitop.depot.agent.number.model.BusinessAgentNumber;
22
+import com.chinaitop.depot.agent.number.model.BusinessAgentNumberExample;
23
+import com.chinaitop.depot.agent.number.model.BusinessAgentNumberExample.Criteria;
24
+import com.chinaitop.depot.agent.number.service.agentNumberService;
25
+import com.chinaitop.depot.utils.ImportServiceImpl;
26
+import com.chinaitop.utils.ParameterUtil;
27
+import com.fasterxml.jackson.databind.ObjectMapper;
28
+import com.github.pagehelper.PageHelper;
29
+import com.github.pagehelper.PageInfo;
30
+
31
+import io.swagger.annotations.Api;
32
+import io.swagger.annotations.ApiImplicitParam;
33
+import io.swagger.annotations.ApiImplicitParams;
34
+import io.swagger.annotations.ApiOperation;
35
+import net.sf.json.JSONArray;
36
+import net.sf.json.JSONObject;
37
+
38
+@RestController
39
+@RequestMapping(value = "/agentNumber")
40
+@Api(description = "库存数量管理")
41
+public class AgentNumberController {
42
+
43
+    @Resource
44
+    private agentNumberService agentNumberService;
45
+
46
+    @Resource
47
+    private agentService agentService;
48
+
49
+    @Resource
50
+    private ImportServiceImpl importService;
51
+
52
+    @Resource
53
+    private BusinessAgentBgmxzService bgmxzService;
54
+
55
+    /**
56
+     * 查询库存数量信息记录
57
+     * @param pageNum
58
+     * @param pageSize
59
+     * @return
60
+     */
61
+    @RequestMapping(value = "/getAgentNumberList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
62
+    @ApiOperation(value="库存数量信息", notes = "查询库存数量信息记录")
63
+    @ApiImplicitParams({
64
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
65
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
66
+            @ApiImplicitParam(name = "agentId", value = "代储点id", paramType = "query"),
67
+            @ApiImplicitParam(name = "agentDepotId", value = "代储库id", paramType = "query"),
68
+            @ApiImplicitParam(name = "storehouseId", value = "仓房id", paramType = "query"),
69
+            @ApiImplicitParam(name = "warehouseId", value = "货位id", paramType = "query"),
70
+            @ApiImplicitParam(name = "orgid", value = "组织id", paramType = "query")
71
+    })
72
+    public PageInfo<Map<String, Object>> getAgentNumberList(Integer pageNum, Integer pageSize, Integer agentId, Integer agentDepotId,
73
+                                                                        Integer storehouseId, Integer warehouseId, String orgid){
74
+        Map<String,Object> map = new HashMap<>();
75
+        map.put("orgId",orgid);
76
+        if(ParameterUtil.isnotnull(agentId)){
77
+            map.put("agentId",agentId);
78
+        }
79
+        if(ParameterUtil.isnotnull(agentDepotId)){
80
+            map.put("agentDepotId",agentDepotId);
81
+        }
82
+        if(ParameterUtil.isnotnull(storehouseId)){
83
+            map.put("storehouseId",storehouseId);
84
+        }
85
+        if(ParameterUtil.isnotnull(warehouseId)){
86
+            map.put("warehouseId",warehouseId);
87
+        }
88
+
89
+        PageHelper.startPage(pageNum, pageSize);
90
+        List<Map<String, Object>> list = agentNumberService.getAgentNumberList(map);
91
+        PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(list);
92
+        //处理驼峰命名大写问题
93
+        List<Map<String, Object>> page_list = ParameterUtil.slashCapitals(pageInfo.getList());
94
+        pageInfo.setList(page_list);
95
+        return pageInfo;
96
+    }
97
+
98
+    /**
99
+     * 保存库存数量信息
100
+     * @param agentNumberJson 主键id
101
+     * @return
102
+     * @throws Exception
103
+     */
104
+    @RequestMapping(value="/saveAgent", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
105
+    @ApiOperation(value="保存库存数量", notes = "保存库存数量信息")
106
+    @ApiImplicitParams({
107
+            @ApiImplicitParam(name = "agentNumberJson", value = "库存数量信息", paramType = "form")
108
+    })
109
+    public Map<String, Object> saveAgent(String agentNumberJson,Integer orgId) throws Exception {
110
+        Map<String, Object> modelMap = new HashMap<String, Object>();
111
+        // JSON字符串转对象
112
+        ObjectMapper mapper = new ObjectMapper();
113
+        BusinessAgentNumber agent = (BusinessAgentNumber)mapper.readValue(agentNumberJson, BusinessAgentNumber.class);
114
+        if (ParameterUtil.isnull(agent.getId())) {
115
+            agent.setOrgId(orgId);
116
+            agent.setCreateTime(ParameterUtil.string2date(ParameterUtil.getSysDateTime()));//创建时间
117
+            agentNumberService.add(agent);
118
+        } else {
119
+            agentNumberService.update(agent);
120
+        }
121
+        modelMap.put("agentId", agent.getId());
122
+        modelMap.put("status", "success");
123
+        return modelMap;
124
+    }
125
+
126
+    /**
127
+     * 删除库存数量信息
128
+     * @param id 主键id
129
+     * @return
130
+     */
131
+    @RequestMapping(value="/removeAgentNumber", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
132
+    @ApiOperation(value="删除库存数量信息", notes = "删除库存数量信息")
133
+    @ApiImplicitParams({
134
+            @ApiImplicitParam(name = "id", value = "库存数量主键id", paramType = "form")
135
+    })
136
+    public Map<String, Object> removeAgentNumber(Integer id){
137
+        Map<String, Object> modelMap = new HashMap<>();
138
+        if (id != null) {
139
+            agentNumberService.updateDeleteById(id);
140
+            modelMap.put("status", "success");
141
+        }
142
+        return modelMap;
143
+    }
144
+
145
+    /**
146
+     * 根据id查找库存数量信息
147
+     * @param id 主键id
148
+     * @return
149
+     */
150
+    @RequestMapping(value="/getAgentNumberEdit", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
151
+    @ApiOperation(value="根据id查找库存数量信息", notes = "根据id查找库存数量信息")
152
+    @ApiImplicitParams({
153
+            @ApiImplicitParam(name = "id", value = "库存数量主键id", paramType = "query")
154
+    })
155
+    public BusinessAgentNumber getAgentNumberEdit(Integer id) {
156
+        BusinessAgentNumber agent = new BusinessAgentNumber();
157
+        if (id != null) {
158
+            agent = agentNumberService.findById(id);
159
+        }
160
+        return agent;
161
+    }
162
+
163
+    /**
164
+     * 导入excel
165
+     * @param file 文件
166
+     * @param fileType 类型:如xlsx
167
+     * @param orgId 组织机构id
168
+     * @return
169
+     */
170
+    @RequestMapping(value="/importFile", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
171
+    @ApiOperation(value="导入excel", notes = "导入excel")
172
+    @ApiImplicitParams({
173
+            @ApiImplicitParam(name = "file", value = "文件数据", paramType = "query"),
174
+            @ApiImplicitParam(name = "fileType", value = "文件名", paramType = "query"),
175
+            @ApiImplicitParam(name = "rootPath", value = "路径", paramType = "query"),
176
+            @ApiImplicitParam(name = "orgId", value = "组织机构id", paramType = "query")
177
+    })
178
+    public Map<String, Object> importFile(MultipartFile file, String fileType, HttpServletRequest request, Integer orgId){
179
+
180
+        String[] titleArr = {"仓房名称", "货位名称", "粮油品种", "粮油性质", "等级","收获年度", "库存数量(公斤)"};//第一行的title
181
+        boolean[] emptyArr = {false, false, false, false, false,false, false};//指定列可为空,不可为空值为false.
182
+
183
+        List<List<String>> list = new ArrayList<List<String>>();//该list为数据返回的list
184
+        Map<String, Object> fileMap = new HashMap<>();
185
+        String errormsg = null;
186
+        try {
187
+        	errormsg = importService.importFile(file, fileType, request, titleArr, emptyArr, list,1);
188
+
189
+            if (errormsg != null && !"".equals(errormsg)) {
190
+                fileMap.put("errormsg",errormsg);
191
+                return fileMap;
192
+            }
193
+
194
+            //查询代储点名称和代储库名称对应的id
195
+            Map<String, Object> agentMap = agentService.getNameId(importService.nameData(file, fileType, request));
196
+            if(ParameterUtil.isnull(agentMap)){
197
+                fileMap.put("errormsg","代储点与代储库无关联,请查询后添加!");
198
+                return fileMap;
199
+            }
200
+
201
+            if (list.size()>0) {
202
+                errormsg = agentNumberService.importData(list, orgId, agentMap);
203
+            }
204
+        } catch (Exception e) {
205
+            e.printStackTrace();
206
+        }
207
+        fileMap.put("errormsg",errormsg);
208
+        return fileMap;
209
+    }
210
+
211
+    @RequestMapping(value="/editCrkKcswData", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
212
+	@ApiOperation(value="把出入库拿来的库存实物数据插入到代储库业务的库存实物表中", notes = "把出入库拿来的库存实物数据插入到代储库业务的库存实物表中")
213
+	@ApiImplicitParams({
214
+		@ApiImplicitParam(name="kcswData", value="出入库库存实物数据", paramType="form"),
215
+		@ApiImplicitParam(name="orgId", value="当前单位ID", paramType="form"),
216
+		@ApiImplicitParam(name="realName", value="当前操作人", paramType="form")
217
+	})
218
+	public Map<String, Object> editCrkKcswData(String kcswData, Integer orgId, String realName) {
219
+
220
+		Map<String, Object> map = new HashMap<String, Object>();
221
+
222
+		try {
223
+			JSONArray json = JSONArray.fromObject(kcswData);
224
+			if (json.size() > 0) {
225
+				BusinessAgentNumber agentNumber = null;
226
+				for (int i = 0; i < json.size(); i++) {
227
+					
228
+					JSONObject job = json.getJSONObject(i);
229
+					Integer unitId = Integer.parseInt(job.get("unitid")+"");
230
+					BusinessAgentDepot agentDepot = bgmxzService.selectAgentDepotObj(orgId, unitId);
231
+					Integer agentDepotId = agentDepot.getId();
232
+					Integer agentId = Integer.parseInt(agentDepot.getAgentId());
233
+					Integer houseId = Integer.parseInt(job.get("ch")+"");
234
+					Integer wareId = Integer.parseInt(job.get("hwh")+"");
235
+
236
+					agentNumber = new BusinessAgentNumber();
237
+					agentNumber.setOrgId(orgId);
238
+					agentNumber.setAgentId(agentId);
239
+					agentNumber.setAgentDepotId(agentDepotId);
240
+					agentNumber.setStorehouseId(houseId);
241
+					agentNumber.setWarehouseId(wareId);
242
+					agentNumber.setLspz(Integer.parseInt(job.get("pz")+""));
243
+					agentNumber.setNature(job.get("hwxz")+"");
244
+					agentNumber.setLevel(Integer.parseInt(job.get("dj")+""));
245
+					agentNumber.setHarvestYear(Integer.parseInt(job.get("scnf")+""));
246
+                    if(ParameterUtil.isnull(job.get("scnf").toString())){
247
+                        agentNumber.setHarvestYear(0);
248
+                    }else{
249
+                        agentNumber.setHarvestYear(Integer.parseInt(job.get("scnf")+""));
250
+                    }
251
+					agentNumber.setInventory(job.get("kcsl")+"");
252
+
253
+					//检查这个仓房货位下的数据有没有,没有就新增,有就修改
254
+					BusinessAgentNumberExample example = new BusinessAgentNumberExample();
255
+					Criteria criteria = example.createCriteria();
256
+					criteria.andOrgIdEqualTo(orgId);
257
+					criteria.andAgentIdEqualTo(agentId);
258
+					criteria.andAgentDepotIdEqualTo(agentDepotId);
259
+					criteria.andStorehouseIdEqualTo(houseId);
260
+					criteria.andWarehouseIdEqualTo(wareId);
261
+					List<BusinessAgentNumber> list = agentNumberService.findByCondition(example);
262
+
263
+					if (null != list && list.size() > 0) {
264
+						agentNumber.setId(list.get(0).getId());
265
+						agentNumberService.update(agentNumber);
266
+					} else {
267
+						//插入代储点的库存实物表
268
+						agentNumber.setCreateTime(new Date());
269
+						agentNumberService.add(agentNumber);
270
+					}
271
+
272
+				}
273
+			}
274
+			map.put("status", "200");
275
+			map.put("msg", "操作成功!");
276
+		} catch (NumberFormatException e) {
277
+			map.put("msg", "操作失败!");
278
+			e.printStackTrace();
279
+		}
280
+
281
+		return map;
282
+	}
283
+}

+ 34 - 0
src/main/java/com/chinaitop/depot/agent/number/mapper/BusinessAgentNumberMapper.java

@@ -0,0 +1,34 @@
1
+package com.chinaitop.depot.agent.number.mapper;
2
+
3
+import com.chinaitop.depot.agent.number.model.BusinessAgentNumber;
4
+import com.chinaitop.depot.agent.number.model.BusinessAgentNumberExample;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+public interface BusinessAgentNumberMapper {
11
+    int countByExample(BusinessAgentNumberExample example);
12
+
13
+    int deleteByExample(BusinessAgentNumberExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessAgentNumber record);
18
+
19
+    int insertSelective(BusinessAgentNumber record);
20
+
21
+    List<BusinessAgentNumber> selectByExample(BusinessAgentNumberExample example);
22
+
23
+    BusinessAgentNumber selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessAgentNumber record, @Param("example") BusinessAgentNumberExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessAgentNumber record, @Param("example") BusinessAgentNumberExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessAgentNumber record);
30
+
31
+    int updateByPrimaryKey(BusinessAgentNumber record);
32
+
33
+    List<Map<String,Object>> getDataByExample(Map<String,Object> map);
34
+}

+ 370 - 0
src/main/java/com/chinaitop/depot/agent/number/mapper/BusinessAgentNumberMapper.xml

@@ -0,0 +1,370 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.agent.number.mapper.BusinessAgentNumberMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.number.model.BusinessAgentNumber" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="agent_id" property="agentId" jdbcType="INTEGER" />
7
+    <result column="agent_depot_id" property="agentDepotId" jdbcType="INTEGER" />
8
+    <result column="storehouse_id" property="storehouseId" jdbcType="INTEGER" />
9
+    <result column="warehouse_id" property="warehouseId" jdbcType="INTEGER" />
10
+    <result column="lspz" property="lspz" jdbcType="INTEGER" />
11
+    <result column="nature" property="nature" jdbcType="VARCHAR" />
12
+    <result column="level" property="level" jdbcType="INTEGER" />
13
+    <result column="harvest_year" property="harvestYear" jdbcType="INTEGER" />
14
+    <result column="inventory" property="inventory" jdbcType="VARCHAR" />
15
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
16
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
17
+    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
18
+  </resultMap>
19
+  <sql id="Example_Where_Clause" >
20
+    <where >
21
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
22
+        <if test="criteria.valid" >
23
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
24
+            <foreach collection="criteria.criteria" item="criterion" >
25
+              <choose >
26
+                <when test="criterion.noValue" >
27
+                  and ${criterion.condition}
28
+                </when>
29
+                <when test="criterion.singleValue" >
30
+                  and ${criterion.condition} #{criterion.value}
31
+                </when>
32
+                <when test="criterion.betweenValue" >
33
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
34
+                </when>
35
+                <when test="criterion.listValue" >
36
+                  and ${criterion.condition}
37
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
38
+                    #{listItem}
39
+                  </foreach>
40
+                </when>
41
+              </choose>
42
+            </foreach>
43
+          </trim>
44
+        </if>
45
+      </foreach>
46
+    </where>
47
+  </sql>
48
+  <sql id="Update_By_Example_Where_Clause" >
49
+    <where >
50
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
51
+        <if test="criteria.valid" >
52
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
53
+            <foreach collection="criteria.criteria" item="criterion" >
54
+              <choose >
55
+                <when test="criterion.noValue" >
56
+                  and ${criterion.condition}
57
+                </when>
58
+                <when test="criterion.singleValue" >
59
+                  and ${criterion.condition} #{criterion.value}
60
+                </when>
61
+                <when test="criterion.betweenValue" >
62
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
63
+                </when>
64
+                <when test="criterion.listValue" >
65
+                  and ${criterion.condition}
66
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
67
+                    #{listItem}
68
+                  </foreach>
69
+                </when>
70
+              </choose>
71
+            </foreach>
72
+          </trim>
73
+        </if>
74
+      </foreach>
75
+    </where>
76
+  </sql>
77
+  <sql id="Base_Column_List" >
78
+    id, agent_id, agent_depot_id, storehouse_id, warehouse_id, lspz, nature, level, harvest_year, 
79
+    inventory, org_id, create_time, updatetime
80
+  </sql>
81
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.agent.number.model.BusinessAgentNumberExample" >
82
+    select
83
+    <if test="distinct" >
84
+      distinct
85
+    </if>
86
+    <include refid="Base_Column_List" />
87
+    from business_agent_number
88
+    <if test="_parameter != null" >
89
+      <include refid="Example_Where_Clause" />
90
+    </if>
91
+    <if test="orderByClause != null" >
92
+      order by ${orderByClause}
93
+    </if>
94
+  </select>
95
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
96
+    select 
97
+    <include refid="Base_Column_List" />
98
+    from business_agent_number
99
+    where id = #{id,jdbcType=INTEGER}
100
+  </select>
101
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
102
+    delete from business_agent_number
103
+    where id = #{id,jdbcType=INTEGER}
104
+  </delete>
105
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.number.model.BusinessAgentNumberExample" >
106
+    delete from business_agent_number
107
+    <if test="_parameter != null" >
108
+      <include refid="Example_Where_Clause" />
109
+    </if>
110
+  </delete>
111
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.number.model.BusinessAgentNumber" >
112
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
113
+      select seq_business_agent_number.nextVal from dual
114
+    </selectKey>
115
+    insert into business_agent_number (id, agent_id, agent_depot_id, 
116
+      storehouse_id, warehouse_id, lspz, 
117
+      nature, level, harvest_year, 
118
+      inventory, org_id, create_time, 
119
+      updatetime)
120
+    values (#{id,jdbcType=INTEGER}, #{agentId,jdbcType=INTEGER}, #{agentDepotId,jdbcType=INTEGER},
121
+      #{storehouseId,jdbcType=INTEGER}, #{warehouseId,jdbcType=INTEGER}, #{lspz,jdbcType=INTEGER}, 
122
+      #{nature,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, #{harvestYear,jdbcType=INTEGER}, 
123
+      #{inventory,jdbcType=VARCHAR}, #{orgId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
124
+      #{updatetime,jdbcType=TIMESTAMP})
125
+  </insert>
126
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.number.model.BusinessAgentNumber" >
127
+    insert into business_agent_number
128
+    <trim prefix="(" suffix=")" suffixOverrides="," >
129
+      <if test="id != null" >
130
+        id,
131
+      </if>
132
+      <if test="agentId != null" >
133
+        agent_id,
134
+      </if>
135
+      <if test="agentDepotId != null" >
136
+        agent_depot_id,
137
+      </if>
138
+      <if test="storehouseId != null" >
139
+        storehouse_id,
140
+      </if>
141
+      <if test="warehouseId != null" >
142
+        warehouse_id,
143
+      </if>
144
+      <if test="lspz != null" >
145
+        lspz,
146
+      </if>
147
+      <if test="nature != null" >
148
+        nature,
149
+      </if>
150
+      <if test="level != null" >
151
+        level,
152
+      </if>
153
+      <if test="harvestYear != null" >
154
+        harvest_year,
155
+      </if>
156
+      <if test="inventory != null" >
157
+        inventory,
158
+      </if>
159
+      <if test="orgId != null" >
160
+        org_id,
161
+      </if>
162
+      <if test="createTime != null" >
163
+        create_time,
164
+      </if>
165
+      <if test="updatetime != null" >
166
+        updatetime,
167
+      </if>
168
+    </trim>
169
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
170
+      <if test="id != null" >
171
+        #{id,jdbcType=INTEGER},
172
+      </if>
173
+      <if test="agentId != null" >
174
+        #{agentId,jdbcType=INTEGER},
175
+      </if>
176
+      <if test="agentDepotId != null" >
177
+        #{agentDepotId,jdbcType=INTEGER},
178
+      </if>
179
+      <if test="storehouseId != null" >
180
+        #{storehouseId,jdbcType=INTEGER},
181
+      </if>
182
+      <if test="warehouseId != null" >
183
+        #{warehouseId,jdbcType=INTEGER},
184
+      </if>
185
+      <if test="lspz != null" >
186
+        #{lspz,jdbcType=INTEGER},
187
+      </if>
188
+      <if test="nature != null" >
189
+        #{nature,jdbcType=VARCHAR},
190
+      </if>
191
+      <if test="level != null" >
192
+        #{level,jdbcType=INTEGER},
193
+      </if>
194
+      <if test="harvestYear != null" >
195
+        #{harvestYear,jdbcType=INTEGER},
196
+      </if>
197
+      <if test="inventory != null" >
198
+        #{inventory,jdbcType=VARCHAR},
199
+      </if>
200
+      <if test="orgId != null" >
201
+        #{orgId,jdbcType=INTEGER},
202
+      </if>
203
+      <if test="createTime != null" >
204
+        #{createTime,jdbcType=TIMESTAMP},
205
+      </if>
206
+      <if test="updatetime != null" >
207
+        #{updatetime,jdbcType=TIMESTAMP},
208
+      </if>
209
+    </trim>
210
+  </insert>
211
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.number.model.BusinessAgentNumberExample" resultType="java.lang.Integer" >
212
+    select count(*) from business_agent_number
213
+    <if test="_parameter != null" >
214
+      <include refid="Example_Where_Clause" />
215
+    </if>
216
+  </select>
217
+  <update id="updateByExampleSelective" parameterType="map" >
218
+    update business_agent_number
219
+    <set >
220
+      <if test="record.id != null" >
221
+        id = #{record.id,jdbcType=INTEGER},
222
+      </if>
223
+      <if test="record.agentId != null" >
224
+        agent_id = #{record.agentId,jdbcType=INTEGER},
225
+      </if>
226
+      <if test="record.agentDepotId != null" >
227
+        agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
228
+      </if>
229
+      <if test="record.storehouseId != null" >
230
+        storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
231
+      </if>
232
+      <if test="record.warehouseId != null" >
233
+        warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
234
+      </if>
235
+      <if test="record.lspz != null" >
236
+        lspz = #{record.lspz,jdbcType=INTEGER},
237
+      </if>
238
+      <if test="record.nature != null" >
239
+        nature = #{record.nature,jdbcType=VARCHAR},
240
+      </if>
241
+      <if test="record.level != null" >
242
+        level = #{record.level,jdbcType=INTEGER},
243
+      </if>
244
+      <if test="record.harvestYear != null" >
245
+        harvest_year = #{record.harvestYear,jdbcType=INTEGER},
246
+      </if>
247
+      <if test="record.inventory != null" >
248
+        inventory = #{record.inventory,jdbcType=VARCHAR},
249
+      </if>
250
+      <if test="record.orgId != null" >
251
+        org_id = #{record.orgId,jdbcType=INTEGER},
252
+      </if>
253
+      <if test="record.createTime != null" >
254
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
255
+      </if>
256
+      <if test="record.updatetime != null" >
257
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
258
+      </if>
259
+    </set>
260
+    <if test="_parameter != null" >
261
+      <include refid="Update_By_Example_Where_Clause" />
262
+    </if>
263
+  </update>
264
+  <update id="updateByExample" parameterType="map" >
265
+    update business_agent_number
266
+    set id = #{record.id,jdbcType=INTEGER},
267
+      agent_id = #{record.agentId,jdbcType=INTEGER},
268
+      agent_depot_id = #{record.agentDepotId,jdbcType=INTEGER},
269
+      storehouse_id = #{record.storehouseId,jdbcType=INTEGER},
270
+      warehouse_id = #{record.warehouseId,jdbcType=INTEGER},
271
+      lspz = #{record.lspz,jdbcType=INTEGER},
272
+      nature = #{record.nature,jdbcType=VARCHAR},
273
+      level = #{record.level,jdbcType=INTEGER},
274
+      harvest_year = #{record.harvestYear,jdbcType=INTEGER},
275
+      inventory = #{record.inventory,jdbcType=VARCHAR},
276
+      org_id = #{record.orgId,jdbcType=INTEGER},
277
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
278
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
279
+    <if test="_parameter != null" >
280
+      <include refid="Update_By_Example_Where_Clause" />
281
+    </if>
282
+  </update>
283
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.number.model.BusinessAgentNumber" >
284
+    update business_agent_number
285
+    <set >
286
+      <if test="agentId != null" >
287
+        agent_id = #{agentId,jdbcType=INTEGER},
288
+      </if>
289
+      <if test="agentDepotId != null" >
290
+        agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
291
+      </if>
292
+      <if test="storehouseId != null" >
293
+        storehouse_id = #{storehouseId,jdbcType=INTEGER},
294
+      </if>
295
+      <if test="warehouseId != null" >
296
+        warehouse_id = #{warehouseId,jdbcType=INTEGER},
297
+      </if>
298
+      <if test="lspz != null" >
299
+        lspz = #{lspz,jdbcType=INTEGER},
300
+      </if>
301
+      <if test="nature != null" >
302
+        nature = #{nature,jdbcType=VARCHAR},
303
+      </if>
304
+      <if test="level != null" >
305
+        level = #{level,jdbcType=INTEGER},
306
+      </if>
307
+      <if test="harvestYear != null" >
308
+        harvest_year = #{harvestYear,jdbcType=INTEGER},
309
+      </if>
310
+      <if test="inventory != null" >
311
+        inventory = #{inventory,jdbcType=VARCHAR},
312
+      </if>
313
+      <if test="orgId != null" >
314
+        org_id = #{orgId,jdbcType=INTEGER},
315
+      </if>
316
+      <if test="createTime != null" >
317
+        create_time = #{createTime,jdbcType=TIMESTAMP},
318
+      </if>
319
+      <if test="updatetime != null" >
320
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
321
+      </if>
322
+    </set>
323
+    where id = #{id,jdbcType=INTEGER}
324
+  </update>
325
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.agent.number.model.BusinessAgentNumber" >
326
+    update business_agent_number
327
+    set agent_id = #{agentId,jdbcType=INTEGER},
328
+      agent_depot_id = #{agentDepotId,jdbcType=INTEGER},
329
+      storehouse_id = #{storehouseId,jdbcType=INTEGER},
330
+      warehouse_id = #{warehouseId,jdbcType=INTEGER},
331
+      lspz = #{lspz,jdbcType=INTEGER},
332
+      nature = #{nature,jdbcType=VARCHAR},
333
+      level = #{level,jdbcType=INTEGER},
334
+      harvest_year = #{harvestYear,jdbcType=INTEGER},
335
+      inventory = #{inventory,jdbcType=VARCHAR},
336
+      org_id = #{orgId,jdbcType=INTEGER},
337
+      create_time = #{createTime,jdbcType=TIMESTAMP},
338
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
339
+    where id = #{id,jdbcType=INTEGER}
340
+  </update>
341
+
342
+  <select id="getDataByExample" parameterType="java.util.Map" resultType="java.util.HashMap">
343
+    SELECT
344
+        num.id,num.agent_id,num.agent_depot_id,num.lspz,num.nature,num.level,
345
+        num.harvest_year,num.inventory,num.storehouse_id,
346
+        num.warehouse_id,num.create_time,num.org_id,
347
+        ware.warehouse_name,store.storehouse_name,agent.agent_name,
348
+        depot.agent_depot_name
349
+    FROM
350
+        business_agent_number num
351
+        LEFT JOIN business_agent agent ON agent.id = num.agent_id AND agent.org_id = #{orgId,jdbcType=INTEGER}
352
+        LEFT JOIN business_agent_depot depot ON depot.id = num.agent_depot_id AND depot.org_id = #{orgId,jdbcType=INTEGER}
353
+        LEFT JOIN basic_storehouse store ON store.storehouse_id = num.storehouse_id
354
+        LEFT JOIN basic_warehouse ware ON ware.warehouse_id = num.warehouse_id
355
+    WHERE num.org_id = #{orgId,jdbcType=INTEGER}
356
+    <if test="agentId != null">
357
+      AND num.agent_id = #{agentId,jdbcType=INTEGER}
358
+    </if>
359
+    <if test="agentDepotId != null">
360
+      AND num.agent_depot_id = #{agentDepotId,jdbcType=INTEGER}
361
+    </if>
362
+    <if test="storehouseId != null">
363
+      AND num.storehouse_id = #{storehouseId,jdbcType=INTEGER}
364
+    </if>
365
+    <if test="warehouseId != null">
366
+      AND num.warehouse_id = #{warehouseId,jdbcType=INTEGER}
367
+    </if>
368
+    order by num.updatetime desc
369
+  </select>
370
+</mapper>

+ 135 - 0
src/main/java/com/chinaitop/depot/agent/number/model/BusinessAgentNumber.java

@@ -0,0 +1,135 @@
1
+package com.chinaitop.depot.agent.number.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessAgentNumber {
6
+    private Integer id;
7
+
8
+    private Integer agentId;
9
+
10
+    private Integer agentDepotId;
11
+
12
+    private Integer storehouseId;
13
+
14
+    private Integer warehouseId;
15
+
16
+    private Integer lspz;
17
+
18
+    private String nature;
19
+
20
+    private Integer level;
21
+
22
+    private Integer harvestYear;
23
+
24
+    private String inventory;
25
+
26
+    private Integer orgId;
27
+
28
+    private Date createTime;
29
+
30
+    private Date updatetime;
31
+
32
+    public Integer getId() {
33
+        return id;
34
+    }
35
+
36
+    public void setId(Integer id) {
37
+        this.id = id;
38
+    }
39
+
40
+    public Integer getAgentId() {
41
+        return agentId;
42
+    }
43
+
44
+    public void setAgentId(Integer agentId) {
45
+        this.agentId = agentId;
46
+    }
47
+
48
+    public Integer getAgentDepotId() {
49
+        return agentDepotId;
50
+    }
51
+
52
+    public void setAgentDepotId(Integer agentDepotId) {
53
+        this.agentDepotId = agentDepotId;
54
+    }
55
+
56
+    public Integer getStorehouseId() {
57
+        return storehouseId;
58
+    }
59
+
60
+    public void setStorehouseId(Integer storehouseId) {
61
+        this.storehouseId = storehouseId;
62
+    }
63
+
64
+    public Integer getWarehouseId() {
65
+        return warehouseId;
66
+    }
67
+
68
+    public void setWarehouseId(Integer warehouseId) {
69
+        this.warehouseId = warehouseId;
70
+    }
71
+
72
+    public Integer getLspz() {
73
+        return lspz;
74
+    }
75
+
76
+    public void setLspz(Integer lspz) {
77
+        this.lspz = lspz;
78
+    }
79
+
80
+    public String getNature() {
81
+        return nature;
82
+    }
83
+
84
+    public void setNature(String nature) {
85
+        this.nature = nature == null ? null : nature.trim();
86
+    }
87
+
88
+    public Integer getLevel() {
89
+        return level;
90
+    }
91
+
92
+    public void setLevel(Integer level) {
93
+        this.level = level;
94
+    }
95
+
96
+    public Integer getHarvestYear() {
97
+        return harvestYear;
98
+    }
99
+
100
+    public void setHarvestYear(Integer harvestYear) {
101
+        this.harvestYear = harvestYear;
102
+    }
103
+
104
+    public String getInventory() {
105
+        return inventory;
106
+    }
107
+
108
+    public void setInventory(String inventory) {
109
+        this.inventory = inventory == null ? null : inventory.trim();
110
+    }
111
+
112
+    public Integer getOrgId() {
113
+        return orgId;
114
+    }
115
+
116
+    public void setOrgId(Integer orgId) {
117
+        this.orgId = orgId;
118
+    }
119
+
120
+    public Date getCreateTime() {
121
+        return createTime;
122
+    }
123
+
124
+    public void setCreateTime(Date createTime) {
125
+        this.createTime = createTime;
126
+    }
127
+
128
+    public Date getUpdatetime() {
129
+        return updatetime;
130
+    }
131
+
132
+    public void setUpdatetime(Date updatetime) {
133
+        this.updatetime = updatetime;
134
+    }
135
+}

File diff suppressed because it is too large
+ 1001 - 0
src/main/java/com/chinaitop/depot/agent/number/model/BusinessAgentNumberExample.java


+ 42 - 0
src/main/java/com/chinaitop/depot/agent/number/service/agentNumberService.java

@@ -0,0 +1,42 @@
1
+package com.chinaitop.depot.agent.number.service;
2
+
3
+import com.chinaitop.depot.agent.number.model.BusinessAgentNumber;
4
+import com.chinaitop.depot.agent.number.model.BusinessAgentNumberExample;
5
+
6
+import java.util.List;
7
+import java.util.Map;
8
+
9
+public interface agentNumberService {
10
+
11
+    /**
12
+     * 查询代储点信息记录
13
+     * @param map
14
+     * @return
15
+     */
16
+    List<Map<String, Object>> getAgentNumberList(Map<String, Object> map);
17
+
18
+    void add(BusinessAgentNumber user);
19
+
20
+    void update(BusinessAgentNumber user);
21
+
22
+    void updateDeleteById(Integer id);
23
+
24
+    BusinessAgentNumber findById(Integer id);
25
+
26
+    /**
27
+     * 导入
28
+     *
29
+     * @param list
30
+     * @param orgId
31
+     * @return
32
+     */
33
+    String importData(List<List<String>> list, Integer orgId, Map<String, Object> agentMap);
34
+
35
+    /**
36
+     * 按条件查询数据
37
+     * 
38
+     * @param example 条件
39
+     * @return
40
+     */
41
+	List<BusinessAgentNumber> findByCondition(BusinessAgentNumberExample example);
42
+}

+ 200 - 0
src/main/java/com/chinaitop/depot/agent/number/service/impl/AgentNumberServiceImpl.java

@@ -0,0 +1,200 @@
1
+package com.chinaitop.depot.agent.number.service.impl;
2
+
3
+import com.chinaitop.depot.agent.basic.mapper.BusinessAgentMapper;
4
+import com.chinaitop.depot.agent.number.mapper.BusinessAgentNumberMapper;
5
+import com.chinaitop.depot.agent.number.model.BusinessAgentNumber;
6
+import com.chinaitop.depot.agent.number.model.BusinessAgentNumberExample;
7
+import com.chinaitop.depot.agent.number.service.agentNumberService;
8
+import com.chinaitop.utils.ParameterUtil;
9
+import org.springframework.stereotype.Service;
10
+
11
+import javax.annotation.Resource;
12
+import java.util.Date;
13
+import java.util.HashMap;
14
+import java.util.List;
15
+import java.util.Map;
16
+
17
+@Service
18
+public class AgentNumberServiceImpl implements agentNumberService {
19
+
20
+    @Resource
21
+    private BusinessAgentNumberMapper businessAgentNumberMapper;
22
+
23
+    @Resource
24
+    private BusinessAgentMapper BusinessAgentMapper;
25
+
26
+    /**
27
+     * 查询仓储处作业记录
28
+     * * @param map
29
+     * @return
30
+     */
31
+    @Override
32
+    public List<Map<String, Object>> getAgentNumberList(Map<String, Object> map) {
33
+        return businessAgentNumberMapper.getDataByExample(map);
34
+    }
35
+
36
+    @Override
37
+    public void add(BusinessAgentNumber agent) {
38
+        businessAgentNumberMapper.insert(agent);
39
+    }
40
+
41
+    @Override
42
+    public void update(BusinessAgentNumber camera) {
43
+        businessAgentNumberMapper.updateByPrimaryKey(camera);
44
+    }
45
+
46
+    @Override
47
+    public void updateDeleteById(Integer agentId) {
48
+        businessAgentNumberMapper.deleteByPrimaryKey(agentId);
49
+    }
50
+
51
+    @Override
52
+    public BusinessAgentNumber findById(Integer id) {
53
+        return businessAgentNumberMapper.selectByPrimaryKey(id);
54
+    }
55
+
56
+    @Override
57
+    public String importData(List<List<String>> list, Integer orgId, Map<String, Object> agentMap) {
58
+        Date date = new Date();
59
+        BusinessAgentNumber agent = null;
60
+        Map<String,Object> enumData = new HashMap<>();
61
+
62
+        String msg = "";
63
+        int len = 0;
64
+
65
+        for (int i = 0; i < list.size(); i++) {
66
+            List<String> revList = list.get(i);
67
+
68
+            for (int j = 0; j < revList.size(); j++) {
69
+                switch(j) {
70
+                    case 0:
71
+                        //仓房名称
72
+                        agent = new BusinessAgentNumber();
73
+                        len = revList.get(j).length();
74
+                        if (len > 20) {
75
+                            msg = "第 "+(i+3)+" 行第 1 列的值的长度不能超过20!";
76
+                            return msg;
77
+                        }
78
+                        enumData.put("storehouseName", revList.get(j));
79
+                        enumData.put("depotId", agentMap.get("depotId"));
80
+                        Map<String,Object> storehouseId = BusinessAgentMapper.getStorehouseId(enumData);
81
+                        if(ParameterUtil.isnull(storehouseId)){
82
+                            msg = "第 "+(i+3)+" 行第 1 列的值的不正确,请查询后再添加!";
83
+                            return msg;
84
+                        }
85
+                        agent.setCreateTime(date);//创建时间
86
+                        agent.setOrgId(orgId);
87
+                        agent.setStorehouseId(Integer.parseInt(storehouseId.get("storehouseid").toString()));
88
+                        break;
89
+                    case 1:
90
+                        //货位名称
91
+                        len = revList.get(j).length();
92
+                        if (len > 20) {
93
+                            msg = "第 "+(i+3)+" 行第 2 列的值的长度不能超过20!";
94
+                            return msg;
95
+                        }
96
+                        enumData.put("warehouseName", revList.get(j));
97
+                        Map<String,Object> warehouseId = BusinessAgentMapper.getWarehouseId(enumData);
98
+                        if(ParameterUtil.isnull(warehouseId)){
99
+                            msg = "第 "+(i+3)+" 行第 2 列的值的不正确,请查询后再添加!";
100
+                            return msg;
101
+                        }
102
+                        agent.setWarehouseId(Integer.parseInt(warehouseId.get("warehouseid").toString()));
103
+                        break;
104
+                    case 2:
105
+                        //粮油品种
106
+                        len = revList.get(j).length();
107
+                        if (len > 20) {
108
+                            msg = "第 "+(i+3)+" 行第 3 列的值的长度不能超过20!";
109
+                            return msg;
110
+                        }
111
+                        enumData.put("enumName", revList.get(j));
112
+                        enumData.put("parentId", "1061");
113
+                        Map<String,Object> enumId = BusinessAgentMapper.getEnumId(enumData);
114
+                        if(enumId.size() == 0){
115
+                            msg = "第 "+(i+3)+" 行第 3 列的值的不正确,请查询后再添加!";
116
+                            return msg;
117
+                        }
118
+                        agent.setLspz(Integer.parseInt(enumId.get("enumid").toString()));
119
+                        break;
120
+                    case 3:
121
+                        //粮油性质
122
+                        len = revList.get(j).length();
123
+                        if (len > 20) {
124
+                            msg = "第 "+(i+3)+" 行第 4 列的值的长度不能超过20!";
125
+                            return msg;
126
+                        }
127
+                        if(ParameterUtil.isequal(revList.get(j),"其他粮")){
128
+                            agent.setNature("3103");
129
+                        }else{
130
+                            enumData.put("enumName", revList.get(j));
131
+                            enumData.put("parentId", "1032");
132
+                            Map<String,Object> natureId = BusinessAgentMapper.getEnumChildId(enumData);
133
+
134
+                            if(natureId.size() == 0){
135
+                                msg = "第 "+(i+3)+" 行第 5 列的值的不正确,请查询后再添加!";
136
+                                return msg;
137
+                            }
138
+                            agent.setNature(natureId.get("enumId").toString());
139
+                        }
140
+                        break;
141
+                    case 4:
142
+                        //等级
143
+                        len = revList.get(j).length();
144
+                        if (len > 20) {
145
+                            msg = "第 "+(i+3)+" 行第 5 列的值的长度不能超过20!";
146
+                            return msg;
147
+                        }
148
+                        enumData.put("enumName", revList.get(j));
149
+                        enumData.put("parentId", "1002");
150
+                        Map<String,Object> levelId = BusinessAgentMapper.getEnumId(enumData);
151
+                        if(levelId.size() == 0){
152
+                            msg = "第 "+(i+3)+" 行第 5 列的值的不正确,请查询后再添加!";
153
+                            return msg;
154
+                        }
155
+                        agent.setLevel(Integer.parseInt(levelId.get("enumid").toString()));
156
+                        break;
157
+                    case 5:
158
+                        //收获年度
159
+                        len = revList.get(j).length();
160
+                        if (len > 20) {
161
+                            msg = "第 "+(i+3)+" 行第 6 列的值的长度不能超过20!";
162
+                            return msg;
163
+                        }
164
+                        enumData.put("enumName", revList.get(j));
165
+                        enumData.put("parentId", "1004");
166
+                        Map<String,Object> yearId = BusinessAgentMapper.getEnumId(enumData);
167
+                        if(yearId.size() == 0){
168
+                            msg = "第 "+(i+3)+" 行第 6 列的值的不正确,请查询后再添加!";
169
+                            return msg;
170
+                        }
171
+                        agent.setHarvestYear(Integer.parseInt(yearId.get("enumid").toString()));
172
+                        break;
173
+                    case 6:
174
+                        //库存数量(公斤)
175
+                        if (ParameterUtil.isnotnull(revList.get(j))) {
176
+                            len = revList.get(j).length();
177
+                            if (len > 50) {
178
+                                msg = "第 "+(i+3)+" 行第 7 列的值的长度不能超过50!";
179
+                                return msg;
180
+                            }
181
+                        }
182
+                        agent.setInventory(revList.get(j));
183
+                        break;
184
+                    default :
185
+                        break;
186
+                }
187
+            }
188
+            agent.setAgentId(Integer.parseInt(agentMap.get("agentid").toString()));
189
+            agent.setAgentDepotId(Integer.parseInt(agentMap.get("depotid").toString()));
190
+            businessAgentNumberMapper.insert(agent);
191
+        }
192
+        return msg;
193
+    }
194
+
195
+	@Override
196
+	public List<BusinessAgentNumber> findByCondition(BusinessAgentNumberExample example) {
197
+		List<BusinessAgentNumber> list = businessAgentNumberMapper.selectByExample(example);
198
+		return list;
199
+	}
200
+}

+ 649 - 0
src/main/java/com/chinaitop/depot/agent/quality/controller/AgentQualityController.java

@@ -0,0 +1,649 @@
1
+package com.chinaitop.depot.agent.quality.controller;
2
+
3
+
4
+import com.chinaitop.depot.agent.basic.service.agentService;
5
+import com.chinaitop.depot.agent.quality.model.BusinessAgentQuality;
6
+import com.chinaitop.depot.agent.quality.model.BusinessAgentQualityExample;
7
+import com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySon;
8
+import com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySonExample;
9
+import com.chinaitop.depot.agent.quality.service.AgentQualityService;
10
+import com.chinaitop.depot.agent.quality.service.AgentQualitySonService;
11
+import com.chinaitop.depot.utils.ImportServiceImpl;
12
+import com.chinaitop.utils.ParameterUtil;
13
+import com.fasterxml.jackson.core.type.TypeReference;
14
+import com.fasterxml.jackson.databind.ObjectMapper;
15
+import com.github.pagehelper.PageHelper;
16
+import com.github.pagehelper.PageInfo;
17
+import io.swagger.annotations.Api;
18
+import io.swagger.annotations.ApiImplicitParam;
19
+import io.swagger.annotations.ApiImplicitParams;
20
+import io.swagger.annotations.ApiOperation;
21
+import org.apache.commons.lang3.StringUtils;
22
+import org.springframework.http.MediaType;
23
+import org.springframework.web.bind.annotation.RequestMapping;
24
+import org.springframework.web.bind.annotation.RequestMethod;
25
+import org.springframework.web.bind.annotation.RestController;
26
+import org.springframework.web.multipart.MultipartFile;
27
+
28
+import javax.annotation.Resource;
29
+import javax.servlet.http.HttpServletRequest;
30
+import java.io.IOException;
31
+import java.util.ArrayList;
32
+import java.util.HashMap;
33
+import java.util.List;
34
+import java.util.Map;
35
+
36
+/**
37
+ * Created by product on 2017/10/11.
38
+ */
39
+@RestController
40
+@RequestMapping(value = {"/agentQuality"})
41
+@Api(value= "AgentQualityController", description = "质量管理类")
42
+public class AgentQualityController {
43
+    @Resource
44
+    private AgentQualityService agentQualityService;
45
+
46
+    @Resource
47
+    private AgentQualitySonService agentQualitySonService;
48
+
49
+    @Resource
50
+    private ImportServiceImpl importService;
51
+
52
+    @Resource
53
+    private agentService agentService;
54
+
55
+    /**
56
+     * 封仓管理中查询出未封仓的质量管理信息,已经封仓的不要展示
57
+     * 分页获取
58
+     */
59
+    @RequestMapping(value = "/getList",produces = MediaType.APPLICATION_JSON_VALUE,method = RequestMethod.GET)
60
+    @ApiOperation(value="查询质量管理列表", notes = "查询质量管理信息列表,支持分页")
61
+    @ApiImplicitParams({
62
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
63
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
64
+            @ApiImplicitParam(name = "checktype", value = "检查的类型", paramType = "query"),
65
+            @ApiImplicitParam(name = "checkResult", value = "检查结果", paramType = "query"),
66
+            @ApiImplicitParam(name = "orgId", value = "粮库id", paramType = "query"),
67
+            @ApiImplicitParam(name = "agentId", value = "代储点名称", paramType = "query"),
68
+            @ApiImplicitParam(name = "agentDepotId", value = "粮库名称", paramType = "query"),
69
+            @ApiImplicitParam(name = "storehouseId", value = "仓房名称", paramType = "query"),
70
+            @ApiImplicitParam(name = "warehouseId", value = "货位名称", paramType = "query"),
71
+    })
72
+    public PageInfo<BusinessAgentQuality> listPage(Integer pageNum, Integer pageSize,String checktype, String checkResult, Integer orgId,
73
+    Integer agentId,Integer agentDepotId,Integer storehouseId,Integer warehouseId) {
74
+    	BusinessAgentQuality qualityCheck = new BusinessAgentQuality();
75
+        //根据后台传来的参数进行查找相应类型的类别0:初检 1:验收 2:质量普查 3:出库
76
+        if (StringUtils.isNotBlank(checktype)){
77
+            qualityCheck.setType(checktype);
78
+        }
79
+        // 粮库id.
80
+        if (ParameterUtil.isnotnull(orgId)) {
81
+            qualityCheck.setOrgId(orgId);
82
+        }
83
+        // 代储点名称.
84
+        if (ParameterUtil.isnotnull(agentId)) {
85
+            qualityCheck.setAgentId(agentId);
86
+        }
87
+        // 粮库名称.
88
+        if (ParameterUtil.isnotnull(agentDepotId)) {
89
+            qualityCheck.setAgentDepotId(agentDepotId);
90
+        }
91
+        // 仓房id.
92
+        if (ParameterUtil.isnotnull(storehouseId)) {
93
+            qualityCheck.setStorehouseId(storehouseId);
94
+
95
+        }
96
+        // 货位id.
97
+        if (ParameterUtil.isnotnull(warehouseId)) {
98
+            qualityCheck.setWarehouseId(warehouseId);
99
+        }
100
+
101
+        //检验结果(0:合格 , 1 :不合格)
102
+
103
+        if (StringUtils.isNotBlank(checkResult)) {
104
+            qualityCheck.setCheckResult(checkResult);
105
+        }
106
+        qualityCheck.setHistoryStatus(0);//0:最新数据  1:历史数据
107
+        //查询出未封仓的质量管理信息 封仓状态:0:未封仓,1:已封仓
108
+        qualityCheck.setSealStatus("0");
109
+        if (pageNum!=null && pageSize!=null) {
110
+            PageHelper.startPage(pageNum, pageSize);
111
+        }
112
+        List<BusinessAgentQuality> list = agentQualityService.queryByQualitycheck(qualityCheck);
113
+
114
+        PageInfo<BusinessAgentQuality> pageInfo = new PageInfo<BusinessAgentQuality>(list);
115
+        return pageInfo;
116
+    }
117
+    
118
+    /**
119
+     * 获取仓房或者货位(通过分组查询最新的满足条件的仓房或者货位).
120
+     * @param qualitycheck
121
+     * @return
122
+     */
123
+    @RequestMapping(value = "/getHouseOrWareList",produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
124
+    @ApiOperation(value="获取仓房或者货位(通过分组查询最新的满足条件的仓房或者货位)", notes = "获取仓房或者货位(通过分组查询最新的满足条件的仓房或者货位)")
125
+    @ApiImplicitParams({
126
+            @ApiImplicitParam(name = "qualitycheck", value = "质量管理对象", paramType = "query")
127
+    })
128
+    public List<BusinessAgentQuality> getHouseIdList(BusinessAgentQuality qualitycheck) {
129
+        List<BusinessAgentQuality> list = agentQualityService.getHouseOrWareList(qualitycheck);
130
+        return list;
131
+    }
132
+    
133
+    /**
134
+     * 获取第三方检验的质量标准字符串(手动拼写)
135
+     * @param id
136
+     * @return
137
+     */
138
+    @RequestMapping(value = "/getQualityStandardStr",produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
139
+    @ApiOperation(value="获取第三方检验的质量标准字符串(手动拼写)", notes = "获取第三方检验的质量标准字符串(手动拼写)")
140
+    @ApiImplicitParams({
141
+            @ApiImplicitParam(name = "id", value = "id", paramType = "form"),
142
+    })
143
+    public Map<String, Object> getQualityStandardStr(Integer id) {
144
+        Map<String, Object> modelMap = new HashMap<String, Object>();
145
+        if (id == null) {
146
+            modelMap.put("status", "error");
147
+            modelMap.put("msg", "id为空,查询质量标准失败!");
148
+        } else {
149
+            String qualityStandardStr = agentQualityService.getQualityStandardStr(id);
150
+            modelMap.put("status", "success");
151
+            modelMap.put("qualityStandard", qualityStandardStr);
152
+        }
153
+
154
+        return modelMap;
155
+    }
156
+    
157
+    
158
+
159
+    /**
160
+     * 新增和修改的数据进行保存
161
+     * @param qualitycheckJson
162
+     * @return
163
+     */
164
+    @RequestMapping(value="/save", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
165
+    @ApiOperation(value="新增/修改数据", notes = "新增/修改数据")
166
+    @ApiImplicitParams({
167
+            @ApiImplicitParam(name = "qualitycheckJson", value = "质量基础信息JSON数据对象", paramType = "form"),
168
+            @ApiImplicitParam(name = "qualityOneJson", value = "质量检测信息JSON数据对象", paramType = "form")
169
+    })
170
+    public Map<String, Object> save(String qualitycheckJson,String qualityOneJson) {
171
+        Map<String, Object> modelMap = new HashMap<>();
172
+        // JSON字符串转对象
173
+        ObjectMapper mapper = new ObjectMapper();
174
+        BusinessAgentQuality qualitycheck = null;
175
+        List<BusinessAgentQualitySon> qualitycheckone = null;
176
+        try {
177
+            qualitycheck = (BusinessAgentQuality)mapper.readValue(qualitycheckJson, BusinessAgentQuality.class);
178
+            //默认0:未封仓   1:已封仓
179
+            qualitycheck.setSealStatus("0");
180
+            qualitycheck.setHistoryStatus(0);//0:最新数据   1:历史数据
181
+            Integer qualityCheckId = agentQualityService.save(qualitycheck);
182
+            //关联保存日常检查和第三方检测的检测信息 如果为空则是对初检 验收等操作
183
+            if(StringUtils.isNoneBlank(qualityOneJson)){
184
+                qualitycheckone = mapper.readValue(qualityOneJson,  new TypeReference<List<BusinessAgentQualitySon>>(){});
185
+                for (int i = 0; i < qualitycheckone.size(); i++) {
186
+                    qualitycheckone.get(i).setQualitycheckId(qualityCheckId);
187
+                    agentQualityService.saveOne(qualitycheckone.get(i));
188
+                }
189
+            }
190
+            modelMap.put("status", "success");
191
+        } catch (IOException e) {
192
+            modelMap.put("status", "error");
193
+            e.printStackTrace();
194
+        }
195
+        return modelMap;
196
+    }
197
+
198
+    /**
199
+     * 根据id加载对应数据
200
+     * @param id
201
+     * @return
202
+     */
203
+    @RequestMapping(value = "/loadDataById" ,produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
204
+    @ApiOperation(value="根据id加载质量检查数据", notes = "根据id加载质量检查数据")
205
+    @ApiImplicitParams({
206
+            @ApiImplicitParam(name = "id", value = "id", paramType = "query"),
207
+    })
208
+    public BusinessAgentQuality loadDataById(Integer id){
209
+        BusinessAgentQuality qualitycheck=agentQualityService.loadDataById(id);
210
+        return qualitycheck;
211
+    }
212
+
213
+    /**
214
+     * 根据主键id移除数据
215
+     * @param id
216
+     * @return
217
+     */
218
+    @RequestMapping(value="/remove", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
219
+    @ApiOperation(value="按ID删除质量检查信息", notes = "按ID删除质量检查信息")
220
+    @ApiImplicitParams({
221
+            @ApiImplicitParam(name = "id", value = "数据ID", paramType = "form")
222
+    })
223
+    public Map<String, Object> remove(Integer id){
224
+        Map<String,Object> retMap = new HashMap<String,Object>();
225
+        agentQualityService.remove(id);
226
+
227
+        //删除管理的数据
228
+        BusinessAgentQualitySonExample qualitycheckSonExample = new BusinessAgentQualitySonExample();
229
+        BusinessAgentQualitySonExample.Criteria criteria = qualitycheckSonExample.createCriteria();
230
+        if(id != null){
231
+            criteria.andQualitycheckIdEqualTo(id);
232
+        }
233
+        agentQualitySonService.removeSon(qualitycheckSonExample);
234
+        retMap.put("msg","success");
235
+        return retMap;
236
+    }
237
+
238
+    /**
239
+     * 封仓管理中查询出所有仓已经封仓或者未封仓的质量管理信息
240
+     * @param houseId
241
+     * @param warehouseId
242
+     * @return
243
+     */
244
+    @RequestMapping(value="/getFoodsealList",produces = MediaType.APPLICATION_JSON_VALUE,method = RequestMethod.GET)
245
+    @ApiOperation(value="封仓管理列表中查询出封仓或未封仓的质量管理信息", notes = "封仓管理列表中查询出封仓或未封仓的质量管理信息")
246
+    @ApiImplicitParams({
247
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
248
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
249
+            @ApiImplicitParam(name = "houseId", value = "仓房ID", paramType = "query"),
250
+            @ApiImplicitParam(name = "warehouseId", value = "货位ID", paramType = "query")
251
+    })
252
+    public PageInfo<BusinessAgentQuality> listPage(Integer pageNum, Integer pageSize ,
253
+                                                  String houseId, String warehouseId) {
254
+    	BusinessAgentQuality qualityCheck = new BusinessAgentQuality();
255
+        if(StringUtils.isNoneBlank(houseId)){
256
+            qualityCheck.setStorehouseId(Integer.valueOf(houseId));
257
+
258
+        }
259
+        if(StringUtils.isNoneBlank(warehouseId)){
260
+            qualityCheck.setWarehouseId(Integer.valueOf(warehouseId));
261
+        }
262
+        qualityCheck.setType("1");///查找验收质量管理的信息
263
+
264
+        qualityCheck.setHistoryStatus(0);//0:最新数据  1:历史数据
265
+
266
+        if (pageNum!=null && pageSize!=null) {
267
+            PageHelper.startPage(pageNum, pageSize);
268
+        }
269
+
270
+        List<BusinessAgentQuality> list = agentQualityService.queryByQualitycheck(qualityCheck);
271
+
272
+        PageInfo<BusinessAgentQuality> pageInfo = new PageInfo<BusinessAgentQuality>(list);
273
+        return pageInfo;
274
+    }
275
+
276
+    /**
277
+     * 根据仓号,货位号以及类型查找对应质量检查信息
278
+     * @param houseId warehouseId
279
+     * @return
280
+     */
281
+    @RequestMapping(value = "/findByStoreWarehouse", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
282
+    @ApiOperation(value="根据仓号,货位号以及类型查找对应质量检查信息", notes = "根据仓号,货位号以及类型查找对应质量检查信息")
283
+    @ApiImplicitParams({
284
+            @ApiImplicitParam(name = "houseId", value = "仓房ID", paramType = "query"),
285
+            @ApiImplicitParam(name = "warehouseId", value = "货位ID", paramType = "query"),
286
+            @ApiImplicitParam(name = "type", value = "检查类型", paramType = "query"),
287
+            @ApiImplicitParam(name = "sealStatus", value = "封仓类型", paramType = "query")
288
+    })
289
+    public BusinessAgentQuality findByStoreWarehouse(Integer houseId, Integer warehouseId, String type,String sealStatus) {
290
+    	BusinessAgentQuality qualityCheckExample = new BusinessAgentQuality();
291
+        BusinessAgentQuality qualitycheck = null;
292
+        try {
293
+            if (houseId != null && !"".equals(houseId)) {
294
+                qualityCheckExample.setStorehouseId(houseId);
295
+
296
+            }
297
+            if(warehouseId != null && !"".equals(warehouseId)){
298
+                qualityCheckExample.setWarehouseId(warehouseId);
299
+            }
300
+            if(StringUtils.isNotBlank(type)){
301
+                qualityCheckExample.setType(type);//传入查找的质量类型
302
+            }
303
+
304
+            if(StringUtils.isNotBlank(sealStatus)){
305
+                qualityCheckExample.setSealStatus(sealStatus);//传入查找的质量类型
306
+            }
307
+            //0:最新数据  1:历史数据
308
+            qualityCheckExample.setHistoryStatus(0);
309
+            List<BusinessAgentQuality> list = agentQualityService.queryByQualitycheck(qualityCheckExample);
310
+            if (null != list && list.size() > 0) {
311
+            	qualitycheck = list.get(0);
312
+            }
313
+
314
+        } catch (Exception e) {
315
+            e.printStackTrace();
316
+        }
317
+        return qualitycheck;
318
+    }
319
+
320
+
321
+    /**
322
+     * 查询第三方检查
323
+     * @param  foodbasicinfoId
324
+     * @return getThirdCheckList
325
+     */
326
+    @RequestMapping(value="/getThirdCheckList",produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
327
+    @ApiOperation(value="查询获得第三方检查列表", notes = "查询获得第三方检查列表,支持分页")
328
+    @ApiImplicitParams({
329
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
330
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
331
+            @ApiImplicitParam(name = "houseId", value = "仓房id", paramType = "query"),
332
+            @ApiImplicitParam(name = "warehouseId", value = "货位Id", paramType = "query"),
333
+            @ApiImplicitParam(name = "foodbasicinfoId", value = "对应粮情专卡Id", paramType = "query"),
334
+
335
+    })
336
+    public PageInfo<BusinessAgentQuality> getThirdCheckList(Integer pageNum, Integer pageSize , Integer houseId, Integer warehouseId,
337
+                                                           Integer foodbasicinfoId) {
338
+        BusinessAgentQuality qualityCheck = new BusinessAgentQuality();
339
+
340
+        if(foodbasicinfoId != null){
341
+            qualityCheck.setId(foodbasicinfoId);
342
+        }
343
+        if(houseId != null){
344
+            qualityCheck.setStorehouseId(houseId);
345
+        }
346
+        if(warehouseId != null){
347
+            qualityCheck.setWarehouseId(warehouseId);
348
+        }
349
+
350
+        if (pageNum!=null && pageSize!=null) {
351
+            PageHelper.startPage(pageNum, pageSize);
352
+        }
353
+
354
+        List<BusinessAgentQuality> list = agentQualityService.getThirdCheckList(qualityCheck);
355
+
356
+        PageInfo<BusinessAgentQuality> pageInfo = new PageInfo<BusinessAgentQuality>(list);
357
+        return pageInfo;
358
+    }
359
+
360
+
361
+    /**
362
+     * 获取第三方检查的不宜存的可用数据
363
+     * @return
364
+     */
365
+    @RequestMapping(value = "/getStoreQualityList",produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET )
366
+    @ApiOperation(value="获取第三方检查的不宜存的可用数据", notes = "获取第三方检查的不宜存的可用数据")
367
+    public List<Map<String,Object>> getStoreQualityList(){
368
+        List<Map<String,Object>> listQuality=agentQualityService.getStoreQualityList();
369
+        return listQuality;
370
+    }
371
+
372
+    /**
373
+     * 获取第三方检查的不宜存的可用数据
374
+     * @return
375
+     */
376
+    @RequestMapping(value = "/getTrdStoreQualityList",produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET )
377
+    @ApiOperation(value="获取第三方检查的不宜存的可用数据(集合格式)", notes = "获取第三方检查的不宜存的可用数据(集合格式)")
378
+    public List<BusinessAgentQuality> getTrdStoreQualityList(){
379
+        List<BusinessAgentQuality> listQuality=agentQualityService.getTrdStoreQualityList();
380
+        
381
+        return listQuality;
382
+    }
383
+    
384
+    @RequestMapping(value = "/setQualityCheckByHistoryStatus", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
385
+    @ApiOperation(value = "根据仓房和货位名称更新当前质量管理为历史记录", notes = "根据仓房和货位名称更新当前质量管理为历史记录")
386
+    @ApiImplicitParams({
387
+            @ApiImplicitParam(name = "houseId", value = "仓房id", paramType = "query"),
388
+            @ApiImplicitParam(name = "warehouseId", value = "货位Id", paramType = "query"),
389
+    })
390
+    public Map<String, Object> setQualityCheckByHistoryStatus(Integer houseId, Integer warehouseId) {
391
+        Map<String, Object> modelMap = new HashMap<>();
392
+        if (ParameterUtil.isnotnull(houseId) &&ParameterUtil.isnotnull(warehouseId) ) {
393
+            agentQualityService.setQualityCheckByHistoryStatus(houseId,warehouseId);
394
+        }
395
+        modelMap.put("status", "success");
396
+        return modelMap;
397
+    }
398
+
399
+    /**
400
+     * 根据id查询质检信息
401
+     * @param ZZid
402
+     * @return
403
+     */
404
+    @RequestMapping(value="/getDataByZJId", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
405
+    @ApiOperation(value = "根据id查询质检信息", notes = "根据id查询质检信息,计划验收模块用到。")
406
+    @ApiImplicitParams({
407
+            @ApiImplicitParam(name = "ZZid", value = "质检id", paramType = "query")
408
+    })
409
+    public Map<String,Object> getDataByZJId(Integer ZZid) {
410
+        Map<String,Object> map = new HashMap<String, Object>();
411
+        Map<String,Object> paramMap = new HashMap<String, Object>();
412
+        paramMap.put("id", ZZid);
413
+        List<BusinessAgentQuality> list = agentQualityService.getDataByZJId(paramMap);
414
+        map.put("qualitycheck", list);
415
+        return map;
416
+    }
417
+    
418
+    
419
+    
420
+    /**
421
+     * 根据仓房和货位获取第三方检查的数据
422
+     * 分页获取
423
+     */
424
+    @RequestMapping(value = "/getListByhouseId",produces = MediaType.APPLICATION_JSON_VALUE,method = RequestMethod.GET)
425
+    @ApiOperation(value="根据仓房和货位获取第三方检查的数据", notes = "支持分页")
426
+    @ApiImplicitParams({
427
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
428
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
429
+            @ApiImplicitParam(name = "houseIds", value = "仓房id(数组)", paramType = "query"),
430
+            @ApiImplicitParam(name = "warehouseIds", value = "货位id(数组)", paramType = "query")
431
+    })
432
+    public PageInfo<BusinessAgentQuality> getListByhouseId(Integer pageNum, Integer pageSize,
433
+            Integer[] houseIds, Integer[] warehouseIds , String checktype) {
434
+    	BusinessAgentQuality qualityCheck = new BusinessAgentQuality();
435
+    	List<List<BusinessAgentQuality>> list = new ArrayList<List<BusinessAgentQuality>>();
436
+        //根据后台传来的参数进行查找相应类型的类别0:初检 1:验收 2:质量普查 3:出库
437
+        if (StringUtils.isNotBlank(checktype)){
438
+            qualityCheck.setType(checktype);
439
+        }
440
+        
441
+        qualityCheck.setHistoryStatus(0);//0:最新数据  1:历史数据
442
+        //查询出未封仓的质量管理信息 封仓状态:0:未封仓,1:已封仓
443
+        qualityCheck.setSealStatus("0");
444
+        
445
+        List<BusinessAgentQuality> qualityCheckList =null;
446
+        for (int i = 0; i < houseIds.length; i++) {
447
+        	for (int j = 0; j < warehouseIds.length; j++) {
448
+            	if(i==j){
449
+            		Integer houseId = houseIds[i];
450
+            		Integer warehouseId = warehouseIds[j];
451
+            		 	//仓房id.
452
+            	        if (qualityCheck.getStorehouseId() == null) {
453
+            	            qualityCheck.setStorehouseId(houseId);
454
+
455
+            	        }
456
+            	        // 货位id.
457
+            	        if (qualityCheck.getWarehouseId() == null) {
458
+            	            qualityCheck.setWarehouseId(warehouseId);
459
+            	        }
460
+            	        if (pageNum!=null && pageSize!=null) {
461
+            	            PageHelper.startPage(pageNum, pageSize);
462
+            	        }
463
+            	        
464
+            	        qualityCheckList = agentQualityService.queryByQualitycheck(qualityCheck);
465
+            	}
466
+    		}
467
+		}
468
+        
469
+       
470
+       
471
+        PageInfo<BusinessAgentQuality> pageInfo = new PageInfo<BusinessAgentQuality>(qualityCheckList);
472
+        return pageInfo;
473
+    }
474
+
475
+    @RequestMapping(value = "/getNewList",produces = MediaType.APPLICATION_JSON_VALUE,method = RequestMethod.GET)
476
+    @ApiOperation(value="查询质量管理列表", notes = "查询质量管理信息列表,支持分页")
477
+    @ApiImplicitParams({
478
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
479
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
480
+            @ApiImplicitParam(name = "houseId", value = "仓房ID", paramType = "query"),
481
+            @ApiImplicitParam(name = "wareId", value = "货位ID", paramType = "query"),
482
+            @ApiImplicitParam(name = "checktype", value = "检查的类型", paramType = "query"),
483
+            @ApiImplicitParam(name = "checkResult", value = "检查结果", paramType = "query"),
484
+            @ApiImplicitParam(name = "historyStatus", value = "数据状态", paramType = "query"),
485
+            @ApiImplicitParam(name = "orgId", value = "单位ID", paramType = "query")
486
+    })
487
+    public PageInfo<BusinessAgentQuality> newListPage(Integer pageNum, Integer pageSize, Integer houseId, Integer wareId,
488
+                                                  String checkType, String checkResult, Integer historyStatus, Integer orgId) {
489
+    	BusinessAgentQualityExample example = new BusinessAgentQualityExample();
490
+    	BusinessAgentQualityExample.Criteria criteria = example.createCriteria();
491
+
492
+        //根据后台传来的参数进行查找相应类型的类别0:初检 1:验收 2:质量普查 3:出库
493
+        if (StringUtils.isNotBlank(checkType)){
494
+        	criteria.andTypeEqualTo(checkType);
495
+        }
496
+        // 仓房id.
497
+        if (houseId != null) {
498
+        	criteria.andStorehouseIdEqualTo(houseId);
499
+        }
500
+        // 货位id.
501
+        if (wareId != null) {
502
+        	criteria.andWarehouseIdEqualTo(wareId);
503
+        }
504
+        // 粮库id.
505
+        if (orgId != null) {
506
+        	criteria.andOrgIdEqualTo(orgId);
507
+        }
508
+
509
+        //检验结果(0:合格 , 1 :不合格)
510
+        if (StringUtils.isNotBlank(checkResult)) {
511
+        	criteria.andCheckResultEqualTo(checkResult);
512
+        }
513
+        //数据状态
514
+        if (null != historyStatus) {
515
+        	//0:最新数据  1:历史数据
516
+        	criteria.andHistoryStatusEqualTo(historyStatus);
517
+        }
518
+
519
+        if (pageNum!=null && pageSize!=null) {
520
+            PageHelper.startPage(pageNum, pageSize);
521
+        }
522
+        List<BusinessAgentQuality> list = agentQualityService.findByCondition(example);
523
+
524
+        PageInfo<BusinessAgentQuality> pageInfo = new PageInfo<BusinessAgentQuality>(list);
525
+        return pageInfo;
526
+    }
527
+
528
+    /**
529
+     * 导入excel
530
+     * @param file 文件
531
+     * @param fileType 类型:如xlsx
532
+     * @param orgId 组织机构id
533
+     * @return
534
+     */
535
+    @RequestMapping(value="/importFile", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
536
+    @ApiOperation(value="导入excel", notes = "导入excel")
537
+    @ApiImplicitParams({
538
+            @ApiImplicitParam(name = "file", value = "文件数据", paramType = "query"),
539
+            @ApiImplicitParam(name = "fileType", value = "文件名", paramType = "query"),
540
+            @ApiImplicitParam(name = "rootPath", value = "路径", paramType = "query"),
541
+            @ApiImplicitParam(name = "orgId", value = "组织机构id", paramType = "query"),
542
+            @ApiImplicitParam(name = "checktype", value = "导入类型", paramType = "query")
543
+    })
544
+    public Map<String, Object> importFile(MultipartFile file, String fileType, HttpServletRequest request, Integer orgId,String checktype){
545
+        Map<String, Object> fileMap = new HashMap<>();
546
+        String errormsg = null;
547
+
548
+        //0:初检    4:日常检验    5:第三方检查    3:出库检验
549
+        if(ParameterUtil.isequal(checktype,"0") || ParameterUtil.isequal(checktype,"4") || ParameterUtil.isequal(checktype,"5") || ParameterUtil.isequal(checktype,"3")){
550
+            String[] titleArr = {"仓房名称","货位名称","粮油品种","明细品种","粮油性质","数量","入仓日期","收获年度","产地","保管员",
551
+                    "扦样日期","扦样人","检验日期","报告出具日期","检验结论","检验机构","储存品质","水分%","容量(g/L)","杂质%",
552
+                    "矿物质%","不完善颗粒%","生霉粒%","完整粒率%","损伤粒率%","热损伤粒%","出糙率%","整精米率%","黄粒米%","谷外糙米%",
553
+                    "互混率%","色泽气味","等级","是否虫粮","备注"};//第一行的title
554
+            boolean[] emptyArr = {false, false, false, false, false, false, false, false, false, false,
555
+                    false, false, false, false, false, false, false, false, false, false,
556
+                    false, false, false, false, false, false, false, false, false, false,
557
+                    false, false, false, false, false};//指定列可为空,不可为空值为false.
558
+
559
+            List<List<String>> list = new ArrayList<List<String>>();//该list为数据返回的list
560
+            try {
561
+                errormsg = importService.importFile(file, fileType, request, titleArr, emptyArr, list,1);
562
+
563
+                if (errormsg != null && !"".equals(errormsg)) {
564
+                    fileMap.put("errormsg",errormsg);
565
+                    return fileMap;
566
+                }
567
+
568
+                //查询代储点名称和代储库名称对应的id
569
+                Map<String, Object> agentMap = agentService.getNameId(importService.nameData(file, fileType, request));
570
+                if(ParameterUtil.isnull(agentMap)){
571
+                    fileMap.put("errormsg","代储点与代储库无关联,请查询后添加!");
572
+                    return fileMap;
573
+                }
574
+
575
+                if (list.size()>0) {
576
+                    errormsg = agentQualityService.importData(list, orgId, agentMap, checktype);
577
+                }
578
+            } catch (Exception e) {
579
+                e.printStackTrace();
580
+            }
581
+        }else if(ParameterUtil.isequal(checktype,"1")){//1:验收
582
+            String[] titleArr = {"仓房名称","货位名称","粮油品种","明细品种","粮油性质","数量","入仓日期","收获年度","产地","保管员",
583
+                    "申请验收日期","扦样日期","扦样人","检验日期","报告出具日期","检验结论","检验机构","储存品质","水分%","容量(g/L)",
584
+                    "杂质%","矿物质%","不完善颗粒%","生霉粒%","完整粒率%","损伤粒率%","热损伤粒%","出糙率%","整精米率%","黄粒米%",
585
+                    "谷外糙米%","互混率%","色泽气味","等级","是否虫粮","备注"};//第一行的title
586
+            boolean[] emptyArr = {false, false, false, false, false, false, false, false, false, false,
587
+                    false, false, false, false, false, false, false, false, false, false,
588
+                    false, false, false, false, false, false, false, false, false, false,
589
+                    false, false, false, false, false, false};//指定列可为空,不可为空值为false.
590
+
591
+            List<List<String>> list = new ArrayList<List<String>>();//该list为数据返回的list
592
+            try {
593
+                errormsg = importService.importFile(file, fileType, request, titleArr, emptyArr, list,1);
594
+
595
+                if (errormsg != null && !"".equals(errormsg)) {
596
+                    fileMap.put("errormsg",errormsg);
597
+                    return fileMap;
598
+                }
599
+
600
+                //查询代储点名称和代储库名称对应的id
601
+                Map<String, Object> agentMap = agentService.getNameId(importService.nameData(file, fileType, request));
602
+                if(ParameterUtil.isnull(agentMap)){
603
+                    fileMap.put("errormsg","代储点与代储库无关联,请查询后添加!");
604
+                    return fileMap;
605
+                }
606
+
607
+                if (list.size()>0) {
608
+                    errormsg = agentQualityService.importDataCQ(list, orgId, agentMap, checktype);
609
+                }
610
+            } catch (Exception e) {
611
+                e.printStackTrace();
612
+            }
613
+        }else if(ParameterUtil.isequal(checktype,"2")){//2:春秋普查
614
+            String[] titleArr = {"仓房名称","货位名称","粮油品种","明细品种","粮油性质","数量","入仓日期","收获年度","产地","保管员",
615
+                    "普查类型","扦样日期","扦样人","检验日期","报告出具日期","检验结论","检验机构","储存品质","水分%","容量(g/L)","杂质%",
616
+                    "矿物质%","不完善颗粒%","生霉粒%","完整粒率%","损伤粒率%","热损伤粒%","出糙率%","整精米率%","黄粒米%","谷外糙米%",
617
+                    "互混率%","色泽气味","等级","是否虫粮","备注"};//第一行的title
618
+            boolean[] emptyArr = {false, false, false, false, false, false, false, false, false, false,
619
+                    false, false, false, false, false, false, false, false, false, false,
620
+                    false, false, false, false, false, false, false, false, false, false,
621
+                    false, false, false, false, false, false};//指定列可为空,不可为空值为false.
622
+
623
+            List<List<String>> list = new ArrayList<List<String>>();//该list为数据返回的list
624
+            try {
625
+                errormsg = importService.importFile(file, fileType, request, titleArr, emptyArr, list,1);
626
+
627
+                if (errormsg != null && !"".equals(errormsg)) {
628
+                    fileMap.put("errormsg",errormsg);
629
+                    return fileMap;
630
+                }
631
+
632
+                //查询代储点名称和代储库名称对应的id
633
+                Map<String, Object> agentMap = agentService.getNameId(importService.nameData(file, fileType, request));
634
+                if(ParameterUtil.isnull(agentMap)){
635
+                    fileMap.put("errormsg","代储点与代储库无关联,请查询后添加!");
636
+                    return fileMap;
637
+                }
638
+
639
+                if (list.size()>0) {
640
+                    errormsg = agentQualityService.importDataCQ(list, orgId, agentMap, checktype);
641
+                }
642
+            } catch (Exception e) {
643
+                e.printStackTrace();
644
+            }
645
+        }
646
+        fileMap.put("errormsg",errormsg);
647
+        return fileMap;
648
+    }
649
+}

+ 80 - 0
src/main/java/com/chinaitop/depot/agent/quality/controller/AgentQualitySonController.java

@@ -0,0 +1,80 @@
1
+package com.chinaitop.depot.agent.quality.controller;
2
+
3
+import com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySon;
4
+import com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySonExample;
5
+import com.chinaitop.depot.agent.quality.service.AgentQualitySonService;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiImplicitParam;
8
+import io.swagger.annotations.ApiImplicitParams;
9
+import io.swagger.annotations.ApiOperation;
10
+import org.springframework.http.MediaType;
11
+import org.springframework.web.bind.annotation.RequestMapping;
12
+import org.springframework.web.bind.annotation.RequestMethod;
13
+import org.springframework.web.bind.annotation.RestController;
14
+
15
+import javax.annotation.Resource;
16
+import java.util.ArrayList;
17
+import java.util.HashMap;
18
+import java.util.List;
19
+import java.util.Map;
20
+
21
+/**
22
+ * @author sunhongbing
23
+ * @Date 2017/12/23
24
+ */
25
+@RestController
26
+@RequestMapping(value = {"/agentQualitySon"})
27
+@Api(value= "AgentQualitySonController", description = "质量管理中检测信息控制类")
28
+public class AgentQualitySonController {
29
+    @Resource
30
+    private AgentQualitySonService agentQualitySonService;
31
+
32
+    /**
33
+     * 接收主表的id关联着子表的ktId
34
+     * @param qcSonId
35
+     * @return
36
+     */
37
+    @RequestMapping(value = "/findQualitycheckSonBySonId",produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
38
+    @ApiOperation(value="根据质量检查id查询出关联的子表信息(包含检测信息)", notes = "根据质量检查id查询出关联的子表信息(包含检测信息)")
39
+    @ApiImplicitParams({
40
+            @ApiImplicitParam(name = "qcSonId", value = "qcSonId", paramType = "query"),
41
+    })
42
+    public List<BusinessAgentQualitySon> findKtDetailsByKtId(Integer qcSonId){
43
+        BusinessAgentQualitySonExample storageQualitycheckSonExample = new BusinessAgentQualitySonExample();
44
+        BusinessAgentQualitySonExample.Criteria criteria = storageQualitycheckSonExample.createCriteria();
45
+        if(qcSonId != null){
46
+            criteria.andQualitycheckIdEqualTo(qcSonId);
47
+        }
48
+        return  agentQualitySonService.findQualitycheckSonExample(storageQualitycheckSonExample);
49
+    }
50
+
51
+    /**
52
+     * 删除一条检测信息
53
+     * @param sonId 数据ID
54
+     * @return
55
+     */
56
+    @RequestMapping(value = "/removeSon", produces = MediaType.APPLICATION_JSON_VALUE,method = RequestMethod.POST)
57
+    @ApiOperation(value="根据子表id质量检查的子表信息", notes = "根据子表id质量检查的子表信息")
58
+    @ApiImplicitParams({
59
+            @ApiImplicitParam(name = "sonId", value = "sonId", paramType = "form"),
60
+    })
61
+    public Map<String, Object> removeSon(Integer sonId) {
62
+        Map<String, Object> map = new HashMap<String, Object>();
63
+        //删除管理的数据
64
+        BusinessAgentQualitySonExample qualitycheckSonExample = new BusinessAgentQualitySonExample();
65
+        BusinessAgentQualitySonExample.Criteria criteria = qualitycheckSonExample.createCriteria();
66
+        if(sonId != null){
67
+            criteria.andIdEqualTo(sonId);
68
+        }
69
+        try {
70
+            agentQualitySonService.removeSon(qualitycheckSonExample);
71
+            map.put("status", "success");
72
+        } catch (Exception e) {
73
+            e.printStackTrace();
74
+            map.put("status", "error");
75
+            map.put("msg", "删除失败!");
76
+        }
77
+        return map;
78
+    }
79
+
80
+}

+ 57 - 0
src/main/java/com/chinaitop/depot/agent/quality/mapper/BusinessAgentQualityMapper.java

@@ -0,0 +1,57 @@
1
+package com.chinaitop.depot.agent.quality.mapper;
2
+
3
+import com.chinaitop.depot.agent.quality.model.BusinessAgentQuality;
4
+import com.chinaitop.depot.agent.quality.model.BusinessAgentQualityExample;
5
+import java.util.List;
6
+import java.util.Map;
7
+
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+public interface BusinessAgentQualityMapper {
11
+    int countByExample(BusinessAgentQualityExample example);
12
+
13
+    int deleteByExample(BusinessAgentQualityExample example);
14
+
15
+    int deleteByPrimaryKey(Integer id);
16
+
17
+    int insert(BusinessAgentQuality record);
18
+
19
+    int insertSelective(BusinessAgentQuality record);
20
+
21
+    List<BusinessAgentQuality> selectByExample(BusinessAgentQualityExample example);
22
+
23
+    BusinessAgentQuality selectByPrimaryKey(Integer id);
24
+
25
+    int updateByExampleSelective(@Param("record") BusinessAgentQuality record, @Param("example") BusinessAgentQualityExample example);
26
+
27
+    int updateByExample(@Param("record") BusinessAgentQuality record, @Param("example") BusinessAgentQualityExample example);
28
+
29
+    int updateByPrimaryKeySelective(BusinessAgentQuality record);
30
+
31
+    int updateByPrimaryKey(BusinessAgentQuality record);
32
+
33
+    /**
34
+     * @param qualitycheck
35
+     * @return
36
+     */
37
+    List<BusinessAgentQuality> getHouseIdList(BusinessAgentQuality qualitycheck);
38
+
39
+    /**
40
+     * @param qualitycheck
41
+     * @return
42
+     */
43
+    List<BusinessAgentQuality> getWareHouseIdList(
44
+            BusinessAgentQuality qualitycheck);
45
+    List<BusinessAgentQuality> getThirdCheckList(BusinessAgentQuality qualitycheck);
46
+    List<BusinessAgentQuality> getQualitycheckListByFoodbasicinfoCheck(BusinessAgentQuality qualitycheck);
47
+    BusinessAgentQuality queryPrimaryKey(Integer id);
48
+    List<BusinessAgentQuality> queryByExample(BusinessAgentQuality example);
49
+    List<Map<String,Object>> getStoreQualityList();
50
+
51
+    List<BusinessAgentQuality> getTrdStoreQualityList();
52
+    List<BusinessAgentQuality> getDataByZJId(Map<String, Object> paramMap);
53
+
54
+    List<BusinessAgentQuality> queryByExampleData(BusinessAgentQuality example);
55
+
56
+    List<BusinessAgentQuality> queryByQualitycheckusiness(BusinessAgentQuality qualityCheckExample);
57
+}

File diff suppressed because it is too large
+ 1916 - 0
src/main/java/com/chinaitop/depot/agent/quality/mapper/BusinessAgentQualityMapper.xml


+ 32 - 0
src/main/java/com/chinaitop/depot/agent/quality/mapper/BusinessAgentQualitySonMapper.java

@@ -0,0 +1,32 @@
1
+package com.chinaitop.depot.agent.quality.mapper;
2
+
3
+import com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySon;
4
+import com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySonExample;
5
+import java.util.List;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+public interface BusinessAgentQualitySonMapper {
9
+    int countByExample(BusinessAgentQualitySonExample example);
10
+
11
+    int deleteByExample(BusinessAgentQualitySonExample example);
12
+
13
+    int deleteByPrimaryKey(Integer id);
14
+
15
+    int insert(BusinessAgentQualitySon record);
16
+
17
+    int insertSelective(BusinessAgentQualitySon record);
18
+
19
+    List<BusinessAgentQualitySon> selectByExample(BusinessAgentQualitySonExample example);
20
+
21
+    BusinessAgentQualitySon selectByPrimaryKey(Integer id);
22
+
23
+    int updateByExampleSelective(@Param("record") BusinessAgentQualitySon record, @Param("example") BusinessAgentQualitySonExample example);
24
+
25
+    int updateByExample(@Param("record") BusinessAgentQualitySon record, @Param("example") BusinessAgentQualitySonExample example);
26
+
27
+    int updateByPrimaryKeySelective(BusinessAgentQualitySon record);
28
+
29
+    int updateByPrimaryKey(BusinessAgentQualitySon record);
30
+
31
+    List<BusinessAgentQualitySon> getQualitycheckSonByFoodbasicinfoCheck(Integer id);
32
+}

+ 225 - 0
src/main/java/com/chinaitop/depot/agent/quality/mapper/BusinessAgentQualitySonMapper.xml

@@ -0,0 +1,225 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.chinaitop.depot.agent.quality.mapper.BusinessAgentQualitySonMapper" >
4
+  <resultMap id="BaseResultMap" type="com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySon" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="qualitycheck_id" property="qualitycheckId" jdbcType="INTEGER" />
7
+    <result column="numbering" property="numbering" jdbcType="INTEGER" />
8
+    <result column="set_value" property="setValue" jdbcType="VARCHAR" />
9
+    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
10
+  </resultMap>
11
+  <sql id="Example_Where_Clause" >
12
+    <where >
13
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
14
+        <if test="criteria.valid" >
15
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
16
+            <foreach collection="criteria.criteria" item="criterion" >
17
+              <choose >
18
+                <when test="criterion.noValue" >
19
+                  and ${criterion.condition}
20
+                </when>
21
+                <when test="criterion.singleValue" >
22
+                  and ${criterion.condition} #{criterion.value}
23
+                </when>
24
+                <when test="criterion.betweenValue" >
25
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
26
+                </when>
27
+                <when test="criterion.listValue" >
28
+                  and ${criterion.condition}
29
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
30
+                    #{listItem}
31
+                  </foreach>
32
+                </when>
33
+              </choose>
34
+            </foreach>
35
+          </trim>
36
+        </if>
37
+      </foreach>
38
+    </where>
39
+  </sql>
40
+  <sql id="Update_By_Example_Where_Clause" >
41
+    <where >
42
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
43
+        <if test="criteria.valid" >
44
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
45
+            <foreach collection="criteria.criteria" item="criterion" >
46
+              <choose >
47
+                <when test="criterion.noValue" >
48
+                  and ${criterion.condition}
49
+                </when>
50
+                <when test="criterion.singleValue" >
51
+                  and ${criterion.condition} #{criterion.value}
52
+                </when>
53
+                <when test="criterion.betweenValue" >
54
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
55
+                </when>
56
+                <when test="criterion.listValue" >
57
+                  and ${criterion.condition}
58
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
59
+                    #{listItem}
60
+                  </foreach>
61
+                </when>
62
+              </choose>
63
+            </foreach>
64
+          </trim>
65
+        </if>
66
+      </foreach>
67
+    </where>
68
+  </sql>
69
+  <sql id="Base_Column_List" >
70
+    id, qualitycheck_id, numbering, set_value, updatetime
71
+  </sql>
72
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySonExample" >
73
+    select
74
+    <if test="distinct" >
75
+      distinct
76
+    </if>
77
+    <include refid="Base_Column_List" />
78
+    from business_agent_quality_son
79
+    <if test="_parameter != null" >
80
+      <include refid="Example_Where_Clause" />
81
+    </if>
82
+    <if test="orderByClause != null" >
83
+      order by ${orderByClause}
84
+    </if>
85
+  </select>
86
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
87
+    select 
88
+    <include refid="Base_Column_List" />
89
+    from business_agent_quality_son
90
+    where id = #{id,jdbcType=INTEGER}
91
+  </select>
92
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
93
+    delete from business_agent_quality_son
94
+    where id = #{id,jdbcType=INTEGER}
95
+  </delete>
96
+  <delete id="deleteByExample" parameterType="com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySonExample" >
97
+    delete from business_agent_quality_son
98
+    <if test="_parameter != null" >
99
+      <include refid="Example_Where_Clause" />
100
+    </if>
101
+  </delete>
102
+  <insert id="insert" parameterType="com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySon" >
103
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
104
+      select seq_business_agent_quality_son.nextVal from dual
105
+    </selectKey>
106
+    insert into business_agent_quality_son (id, qualitycheck_id, numbering, 
107
+      set_value, updatetime)
108
+    values (#{id,jdbcType=INTEGER}, #{qualitycheckId,jdbcType=INTEGER}, #{numbering,jdbcType=INTEGER},
109
+      #{setValue,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP})
110
+  </insert>
111
+  <insert id="insertSelective" parameterType="com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySon" >
112
+    insert into business_agent_quality_son
113
+    <trim prefix="(" suffix=")" suffixOverrides="," >
114
+      <if test="id != null" >
115
+        id,
116
+      </if>
117
+      <if test="qualitycheckId != null" >
118
+        qualitycheck_id,
119
+      </if>
120
+      <if test="numbering != null" >
121
+        numbering,
122
+      </if>
123
+      <if test="setValue != null" >
124
+        set_value,
125
+      </if>
126
+      <if test="updatetime != null" >
127
+        updatetime,
128
+      </if>
129
+    </trim>
130
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
131
+      <if test="id != null" >
132
+        #{id,jdbcType=INTEGER},
133
+      </if>
134
+      <if test="qualitycheckId != null" >
135
+        #{qualitycheckId,jdbcType=INTEGER},
136
+      </if>
137
+      <if test="numbering != null" >
138
+        #{numbering,jdbcType=INTEGER},
139
+      </if>
140
+      <if test="setValue != null" >
141
+        #{setValue,jdbcType=VARCHAR},
142
+      </if>
143
+      <if test="updatetime != null" >
144
+        #{updatetime,jdbcType=TIMESTAMP},
145
+      </if>
146
+    </trim>
147
+  </insert>
148
+  <select id="countByExample" parameterType="com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySonExample" resultType="java.lang.Integer" >
149
+    select count(*) from business_agent_quality_son
150
+    <if test="_parameter != null" >
151
+      <include refid="Example_Where_Clause" />
152
+    </if>
153
+  </select>
154
+  <update id="updateByExampleSelective" parameterType="map" >
155
+    update business_agent_quality_son
156
+    <set >
157
+      <if test="record.id != null" >
158
+        id = #{record.id,jdbcType=INTEGER},
159
+      </if>
160
+      <if test="record.qualitycheckId != null" >
161
+        qualitycheck_id = #{record.qualitycheckId,jdbcType=INTEGER},
162
+      </if>
163
+      <if test="record.numbering != null" >
164
+        numbering = #{record.numbering,jdbcType=INTEGER},
165
+      </if>
166
+      <if test="record.setValue != null" >
167
+        set_value = #{record.setValue,jdbcType=VARCHAR},
168
+      </if>
169
+      <if test="record.updatetime != null" >
170
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
171
+      </if>
172
+    </set>
173
+    <if test="_parameter != null" >
174
+      <include refid="Update_By_Example_Where_Clause" />
175
+    </if>
176
+  </update>
177
+  <update id="updateByExample" parameterType="map" >
178
+    update business_agent_quality_son
179
+    set id = #{record.id,jdbcType=INTEGER},
180
+      qualitycheck_id = #{record.qualitycheckId,jdbcType=INTEGER},
181
+      numbering = #{record.numbering,jdbcType=INTEGER},
182
+      set_value = #{record.setValue,jdbcType=VARCHAR},
183
+      updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
184
+    <if test="_parameter != null" >
185
+      <include refid="Update_By_Example_Where_Clause" />
186
+    </if>
187
+  </update>
188
+  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySon" >
189
+    update business_agent_quality_son
190
+    <set >
191
+      <if test="qualitycheckId != null" >
192
+        qualitycheck_id = #{qualitycheckId,jdbcType=INTEGER},
193
+      </if>
194
+      <if test="numbering != null" >
195
+        numbering = #{numbering,jdbcType=INTEGER},
196
+      </if>
197
+      <if test="setValue != null" >
198
+        set_value = #{setValue,jdbcType=VARCHAR},
199
+      </if>
200
+      <if test="updatetime != null" >
201
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
202
+      </if>
203
+    </set>
204
+    where id = #{id,jdbcType=INTEGER}
205
+  </update>
206
+  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.agent.quality.model.BusinessAgentQualitySon" >
207
+    update business_agent_quality_son
208
+    set qualitycheck_id = #{qualitycheckId,jdbcType=INTEGER},
209
+      numbering = #{numbering,jdbcType=INTEGER},
210
+      set_value = #{setValue,jdbcType=VARCHAR},
211
+      updatetime = #{updatetime,jdbcType=TIMESTAMP}
212
+    where id = #{id,jdbcType=INTEGER}
213
+  </update>
214
+
215
+  <select id="getQualitycheckSonByFoodbasicinfoCheck" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
216
+    SELECT
217
+    <include refid="Base_Column_List" />
218
+    FROM storage_qualitycheck_son sqk
219
+    WHERE sqk.qualitycheck_id in (
220
+    SELECT qualitycheck_id
221
+    FROM storage_foodbasicinfochecks fcs
222
+    WHERE fcs.foodbasicinfo_id =#{id}
223
+    )
224
+  </select>
225
+</mapper>

File diff suppressed because it is too large
+ 1029 - 0
src/main/java/com/chinaitop/depot/agent/quality/model/BusinessAgentQuality.java


File diff suppressed because it is too large
+ 6061 - 0
src/main/java/com/chinaitop/depot/agent/quality/model/BusinessAgentQualityExample.java


+ 55 - 0
src/main/java/com/chinaitop/depot/agent/quality/model/BusinessAgentQualitySon.java

@@ -0,0 +1,55 @@
1
+package com.chinaitop.depot.agent.quality.model;
2
+
3
+import java.util.Date;
4
+
5
+public class BusinessAgentQualitySon {
6
+    private Integer id;
7
+
8
+    private Integer qualitycheckId;
9
+
10
+    private Integer numbering;
11
+
12
+    private String setValue;
13
+
14
+    private Date updatetime;
15
+
16
+    public Integer getId() {
17
+        return id;
18
+    }
19
+
20
+    public void setId(Integer id) {
21
+        this.id = id;
22
+    }
23
+
24
+    public Integer getQualitycheckId() {
25
+        return qualitycheckId;
26
+    }
27
+
28
+    public void setQualitycheckId(Integer qualitycheckId) {
29
+        this.qualitycheckId = qualitycheckId;
30
+    }
31
+
32
+    public Integer getNumbering() {
33
+        return numbering;
34
+    }
35
+
36
+    public void setNumbering(Integer numbering) {
37
+        this.numbering = numbering;
38
+    }
39
+
40
+    public String getSetValue() {
41
+        return setValue;
42
+    }
43
+
44
+    public void setSetValue(String setValue) {
45
+        this.setValue = setValue == null ? null : setValue.trim();
46
+    }
47
+
48
+    public Date getUpdatetime() {
49
+        return updatetime;
50
+    }
51
+
52
+    public void setUpdatetime(Date updatetime) {
53
+        this.updatetime = updatetime;
54
+    }
55
+}

+ 511 - 0
src/main/java/com/chinaitop/depot/agent/quality/model/BusinessAgentQualitySonExample.java

@@ -0,0 +1,511 @@
1
+package com.chinaitop.depot.agent.quality.model;
2
+
3
+import java.util.ArrayList;
4
+import java.util.Date;
5
+import java.util.List;
6
+
7
+public class BusinessAgentQualitySonExample {
8
+    protected String orderByClause;
9
+
10
+    protected boolean distinct;
11
+
12
+    protected List<Criteria> oredCriteria;
13
+
14
+    public BusinessAgentQualitySonExample() {
15
+        oredCriteria = new ArrayList<Criteria>();
16
+    }
17
+
18
+    public void setOrderByClause(String orderByClause) {
19
+        this.orderByClause = orderByClause;
20
+    }
21
+
22
+    public String getOrderByClause() {
23
+        return orderByClause;
24
+    }
25
+
26
+    public void setDistinct(boolean distinct) {
27
+        this.distinct = distinct;
28
+    }
29
+
30
+    public boolean isDistinct() {
31
+        return distinct;
32
+    }
33
+
34
+    public List<Criteria> getOredCriteria() {
35
+        return oredCriteria;
36
+    }
37
+
38
+    public void or(Criteria criteria) {
39
+        oredCriteria.add(criteria);
40
+    }
41
+
42
+    public Criteria or() {
43
+        Criteria criteria = createCriteriaInternal();
44
+        oredCriteria.add(criteria);
45
+        return criteria;
46
+    }
47
+
48
+    public Criteria createCriteria() {
49
+        Criteria criteria = createCriteriaInternal();
50
+        if (oredCriteria.size() == 0) {
51
+            oredCriteria.add(criteria);
52
+        }
53
+        return criteria;
54
+    }
55
+
56
+    protected Criteria createCriteriaInternal() {
57
+        Criteria criteria = new Criteria();
58
+        return criteria;
59
+    }
60
+
61
+    public void clear() {
62
+        oredCriteria.clear();
63
+        orderByClause = null;
64
+        distinct = false;
65
+    }
66
+
67
+    protected abstract static class GeneratedCriteria {
68
+        protected List<Criterion> criteria;
69
+
70
+        protected GeneratedCriteria() {
71
+            super();
72
+            criteria = new ArrayList<Criterion>();
73
+        }
74
+
75
+        public boolean isValid() {
76
+            return criteria.size() > 0;
77
+        }
78
+
79
+        public List<Criterion> getAllCriteria() {
80
+            return criteria;
81
+        }
82
+
83
+        public List<Criterion> getCriteria() {
84
+            return criteria;
85
+        }
86
+
87
+        protected void addCriterion(String condition) {
88
+            if (condition == null) {
89
+                throw new RuntimeException("Value for condition cannot be null");
90
+            }
91
+            criteria.add(new Criterion(condition));
92
+        }
93
+
94
+        protected void addCriterion(String condition, Object value, String property) {
95
+            if (value == null) {
96
+                throw new RuntimeException("Value for " + property + " cannot be null");
97
+            }
98
+            criteria.add(new Criterion(condition, value));
99
+        }
100
+
101
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
102
+            if (value1 == null || value2 == null) {
103
+                throw new RuntimeException("Between values for " + property + " cannot be null");
104
+            }
105
+            criteria.add(new Criterion(condition, value1, value2));
106
+        }
107
+
108
+        public Criteria andIdIsNull() {
109
+            addCriterion("id is null");
110
+            return (Criteria) this;
111
+        }
112
+
113
+        public Criteria andIdIsNotNull() {
114
+            addCriterion("id is not null");
115
+            return (Criteria) this;
116
+        }
117
+
118
+        public Criteria andIdEqualTo(Integer value) {
119
+            addCriterion("id =", value, "id");
120
+            return (Criteria) this;
121
+        }
122
+
123
+        public Criteria andIdNotEqualTo(Integer value) {
124
+            addCriterion("id <>", value, "id");
125
+            return (Criteria) this;
126
+        }
127
+
128
+        public Criteria andIdGreaterThan(Integer value) {
129
+            addCriterion("id >", value, "id");
130
+            return (Criteria) this;
131
+        }
132
+
133
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
134
+            addCriterion("id >=", value, "id");
135
+            return (Criteria) this;
136
+        }
137
+
138
+        public Criteria andIdLessThan(Integer value) {
139
+            addCriterion("id <", value, "id");
140
+            return (Criteria) this;
141
+        }
142
+
143
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
144
+            addCriterion("id <=", value, "id");
145
+            return (Criteria) this;
146
+        }
147
+
148
+        public Criteria andIdIn(List<Integer> values) {
149
+            addCriterion("id in", values, "id");
150
+            return (Criteria) this;
151
+        }
152
+
153
+        public Criteria andIdNotIn(List<Integer> values) {
154
+            addCriterion("id not in", values, "id");
155
+            return (Criteria) this;
156
+        }
157
+
158
+        public Criteria andIdBetween(Integer value1, Integer value2) {
159
+            addCriterion("id between", value1, value2, "id");
160
+            return (Criteria) this;
161
+        }
162
+
163
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
164
+            addCriterion("id not between", value1, value2, "id");
165
+            return (Criteria) this;
166
+        }
167
+
168
+        public Criteria andQualitycheckIdIsNull() {
169
+            addCriterion("qualitycheck_id is null");
170
+            return (Criteria) this;
171
+        }
172
+
173
+        public Criteria andQualitycheckIdIsNotNull() {
174
+            addCriterion("qualitycheck_id is not null");
175
+            return (Criteria) this;
176
+        }
177
+
178
+        public Criteria andQualitycheckIdEqualTo(Integer value) {
179
+            addCriterion("qualitycheck_id =", value, "qualitycheckId");
180
+            return (Criteria) this;
181
+        }
182
+
183
+        public Criteria andQualitycheckIdNotEqualTo(Integer value) {
184
+            addCriterion("qualitycheck_id <>", value, "qualitycheckId");
185
+            return (Criteria) this;
186
+        }
187
+
188
+        public Criteria andQualitycheckIdGreaterThan(Integer value) {
189
+            addCriterion("qualitycheck_id >", value, "qualitycheckId");
190
+            return (Criteria) this;
191
+        }
192
+
193
+        public Criteria andQualitycheckIdGreaterThanOrEqualTo(Integer value) {
194
+            addCriterion("qualitycheck_id >=", value, "qualitycheckId");
195
+            return (Criteria) this;
196
+        }
197
+
198
+        public Criteria andQualitycheckIdLessThan(Integer value) {
199
+            addCriterion("qualitycheck_id <", value, "qualitycheckId");
200
+            return (Criteria) this;
201
+        }
202
+
203
+        public Criteria andQualitycheckIdLessThanOrEqualTo(Integer value) {
204
+            addCriterion("qualitycheck_id <=", value, "qualitycheckId");
205
+            return (Criteria) this;
206
+        }
207
+
208
+        public Criteria andQualitycheckIdIn(List<Integer> values) {
209
+            addCriterion("qualitycheck_id in", values, "qualitycheckId");
210
+            return (Criteria) this;
211
+        }
212
+
213
+        public Criteria andQualitycheckIdNotIn(List<Integer> values) {
214
+            addCriterion("qualitycheck_id not in", values, "qualitycheckId");
215
+            return (Criteria) this;
216
+        }
217
+
218
+        public Criteria andQualitycheckIdBetween(Integer value1, Integer value2) {
219
+            addCriterion("qualitycheck_id between", value1, value2, "qualitycheckId");
220
+            return (Criteria) this;
221
+        }
222
+
223
+        public Criteria andQualitycheckIdNotBetween(Integer value1, Integer value2) {
224
+            addCriterion("qualitycheck_id not between", value1, value2, "qualitycheckId");
225
+            return (Criteria) this;
226
+        }
227
+
228
+        public Criteria andNumberingIsNull() {
229
+            addCriterion("numbering is null");
230
+            return (Criteria) this;
231
+        }
232
+
233
+        public Criteria andNumberingIsNotNull() {
234
+            addCriterion("numbering is not null");
235
+            return (Criteria) this;
236
+        }
237
+
238
+        public Criteria andNumberingEqualTo(Integer value) {
239
+            addCriterion("numbering =", value, "numbering");
240
+            return (Criteria) this;
241
+        }
242
+
243
+        public Criteria andNumberingNotEqualTo(Integer value) {
244
+            addCriterion("numbering <>", value, "numbering");
245
+            return (Criteria) this;
246
+        }
247
+
248
+        public Criteria andNumberingGreaterThan(Integer value) {
249
+            addCriterion("numbering >", value, "numbering");
250
+            return (Criteria) this;
251
+        }
252
+
253
+        public Criteria andNumberingGreaterThanOrEqualTo(Integer value) {
254
+            addCriterion("numbering >=", value, "numbering");
255
+            return (Criteria) this;
256
+        }
257
+
258
+        public Criteria andNumberingLessThan(Integer value) {
259
+            addCriterion("numbering <", value, "numbering");
260
+            return (Criteria) this;
261
+        }
262
+
263
+        public Criteria andNumberingLessThanOrEqualTo(Integer value) {
264
+            addCriterion("numbering <=", value, "numbering");
265
+            return (Criteria) this;
266
+        }
267
+
268
+        public Criteria andNumberingIn(List<Integer> values) {
269
+            addCriterion("numbering in", values, "numbering");
270
+            return (Criteria) this;
271
+        }
272
+
273
+        public Criteria andNumberingNotIn(List<Integer> values) {
274
+            addCriterion("numbering not in", values, "numbering");
275
+            return (Criteria) this;
276
+        }
277
+
278
+        public Criteria andNumberingBetween(Integer value1, Integer value2) {
279
+            addCriterion("numbering between", value1, value2, "numbering");
280
+            return (Criteria) this;
281
+        }
282
+
283
+        public Criteria andNumberingNotBetween(Integer value1, Integer value2) {
284
+            addCriterion("numbering not between", value1, value2, "numbering");
285
+            return (Criteria) this;
286
+        }
287
+
288
+        public Criteria andSetValueIsNull() {
289
+            addCriterion("set_value is null");
290
+            return (Criteria) this;
291
+        }
292
+
293
+        public Criteria andSetValueIsNotNull() {
294
+            addCriterion("set_value is not null");
295
+            return (Criteria) this;
296
+        }
297
+
298
+        public Criteria andSetValueEqualTo(String value) {
299
+            addCriterion("set_value =", value, "setValue");
300
+            return (Criteria) this;
301
+        }
302
+
303
+        public Criteria andSetValueNotEqualTo(String value) {
304
+            addCriterion("set_value <>", value, "setValue");
305
+            return (Criteria) this;
306
+        }
307
+
308
+        public Criteria andSetValueGreaterThan(String value) {
309
+            addCriterion("set_value >", value, "setValue");
310
+            return (Criteria) this;
311
+        }
312
+
313
+        public Criteria andSetValueGreaterThanOrEqualTo(String value) {
314
+            addCriterion("set_value >=", value, "setValue");
315
+            return (Criteria) this;
316
+        }
317
+
318
+        public Criteria andSetValueLessThan(String value) {
319
+            addCriterion("set_value <", value, "setValue");
320
+            return (Criteria) this;
321
+        }
322
+
323
+        public Criteria andSetValueLessThanOrEqualTo(String value) {
324
+            addCriterion("set_value <=", value, "setValue");
325
+            return (Criteria) this;
326
+        }
327
+
328
+        public Criteria andSetValueLike(String value) {
329
+            addCriterion("set_value like", value, "setValue");
330
+            return (Criteria) this;
331
+        }
332
+
333
+        public Criteria andSetValueNotLike(String value) {
334
+            addCriterion("set_value not like", value, "setValue");
335
+            return (Criteria) this;
336
+        }
337
+
338
+        public Criteria andSetValueIn(List<String> values) {
339
+            addCriterion("set_value in", values, "setValue");
340
+            return (Criteria) this;
341
+        }
342
+
343
+        public Criteria andSetValueNotIn(List<String> values) {
344
+            addCriterion("set_value not in", values, "setValue");
345
+            return (Criteria) this;
346
+        }
347
+
348
+        public Criteria andSetValueBetween(String value1, String value2) {
349
+            addCriterion("set_value between", value1, value2, "setValue");
350
+            return (Criteria) this;
351
+        }
352
+
353
+        public Criteria andSetValueNotBetween(String value1, String value2) {
354
+            addCriterion("set_value not between", value1, value2, "setValue");
355
+            return (Criteria) this;
356
+        }
357
+
358
+        public Criteria andUpdatetimeIsNull() {
359
+            addCriterion("updatetime is null");
360
+            return (Criteria) this;
361
+        }
362
+
363
+        public Criteria andUpdatetimeIsNotNull() {
364
+            addCriterion("updatetime is not null");
365
+            return (Criteria) this;
366
+        }
367
+
368
+        public Criteria andUpdatetimeEqualTo(Date value) {
369
+            addCriterion("updatetime =", value, "updatetime");
370
+            return (Criteria) this;
371
+        }
372
+
373
+        public Criteria andUpdatetimeNotEqualTo(Date value) {
374
+            addCriterion("updatetime <>", value, "updatetime");
375
+            return (Criteria) this;
376
+        }
377
+
378
+        public Criteria andUpdatetimeGreaterThan(Date value) {
379
+            addCriterion("updatetime >", value, "updatetime");
380
+            return (Criteria) this;
381
+        }
382
+
383
+        public Criteria andUpdatetimeGreaterThanOrEqualTo(Date value) {
384
+            addCriterion("updatetime >=", value, "updatetime");
385
+            return (Criteria) this;
386
+        }
387
+
388
+        public Criteria andUpdatetimeLessThan(Date value) {
389
+            addCriterion("updatetime <", value, "updatetime");
390
+            return (Criteria) this;
391
+        }
392
+
393
+        public Criteria andUpdatetimeLessThanOrEqualTo(Date value) {
394
+            addCriterion("updatetime <=", value, "updatetime");
395
+            return (Criteria) this;
396
+        }
397
+
398
+        public Criteria andUpdatetimeIn(List<Date> values) {
399
+            addCriterion("updatetime in", values, "updatetime");
400
+            return (Criteria) this;
401
+        }
402
+
403
+        public Criteria andUpdatetimeNotIn(List<Date> values) {
404
+            addCriterion("updatetime not in", values, "updatetime");
405
+            return (Criteria) this;
406
+        }
407
+
408
+        public Criteria andUpdatetimeBetween(Date value1, Date value2) {
409
+            addCriterion("updatetime between", value1, value2, "updatetime");
410
+            return (Criteria) this;
411
+        }
412
+
413
+        public Criteria andUpdatetimeNotBetween(Date value1, Date value2) {
414
+            addCriterion("updatetime not between", value1, value2, "updatetime");
415
+            return (Criteria) this;
416
+        }
417
+    }
418
+
419
+    public static class Criteria extends GeneratedCriteria {
420
+
421
+        protected Criteria() {
422
+            super();
423
+        }
424
+    }
425
+
426
+    public static class Criterion {
427
+        private String condition;
428
+
429
+        private Object value;
430
+
431
+        private Object secondValue;
432
+
433
+        private boolean noValue;
434
+
435
+        private boolean singleValue;
436
+
437
+        private boolean betweenValue;
438
+
439
+        private boolean listValue;
440
+
441
+        private String typeHandler;
442
+
443
+        public String getCondition() {
444
+            return condition;
445
+        }
446
+
447
+        public Object getValue() {
448
+            return value;
449
+        }
450
+
451
+        public Object getSecondValue() {
452
+            return secondValue;
453
+        }
454
+
455
+        public boolean isNoValue() {
456
+            return noValue;
457
+        }
458
+
459
+        public boolean isSingleValue() {
460
+            return singleValue;
461
+        }
462
+
463
+        public boolean isBetweenValue() {
464
+            return betweenValue;
465
+        }
466
+
467
+        public boolean isListValue() {
468
+            return listValue;
469
+        }
470
+
471
+        public String getTypeHandler() {
472
+            return typeHandler;
473
+        }
474
+
475
+        protected Criterion(String condition) {
476
+            super();
477
+            this.condition = condition;
478
+            this.typeHandler = null;
479
+            this.noValue = true;
480
+        }
481
+
482
+        protected Criterion(String condition, Object value, String typeHandler) {
483
+            super();
484
+            this.condition = condition;
485
+            this.value = value;
486
+            this.typeHandler = typeHandler;
487
+            if (value instanceof List<?>) {
488
+                this.listValue = true;
489
+            } else {
490
+                this.singleValue = true;
491
+            }
492
+        }
493
+
494
+        protected Criterion(String condition, Object value) {
495
+            this(condition, value, null);
496
+        }
497
+
498
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
499
+            super();
500
+            this.condition = condition;
501
+            this.value = value;
502
+            this.secondValue = secondValue;
503
+            this.typeHandler = typeHandler;
504
+            this.betweenValue = true;
505
+        }
506
+
507
+        protected Criterion(String condition, Object value, Object secondValue) {
508
+            this(condition, value, secondValue, null);
509
+        }
510
+    }
511
+}

+ 0 - 0
src/main/java/com/chinaitop/depot/agent/quality/service/AgentQualityService.java


Some files were not shown because too many files changed in this diff