@@ -0,0 +1,32 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<classpath> | |||
<classpathentry kind="src" output="target/classes" path="src/main/java"> | |||
<attributes> | |||
<attribute name="optional" value="true"/> | |||
<attribute name="maven.pomderived" value="true"/> | |||
</attributes> | |||
</classpathentry> | |||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> | |||
<attributes> | |||
<attribute name="maven.pomderived" value="true"/> | |||
</attributes> | |||
</classpathentry> | |||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> | |||
<attributes> | |||
<attribute name="optional" value="true"/> | |||
<attribute name="maven.pomderived" value="true"/> | |||
</attributes> | |||
</classpathentry> | |||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | |||
<attributes> | |||
<attribute name="maven.pomderived" value="true"/> | |||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> | |||
</attributes> | |||
</classpathentry> | |||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> | |||
<attributes> | |||
<attribute name="maven.pomderived" value="true"/> | |||
</attributes> | |||
</classpathentry> | |||
<classpathentry kind="output" path="target/classes"/> | |||
</classpath> |
@@ -0,0 +1,2 @@ | |||
.idea | |||
target |
@@ -0,0 +1,48 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<projectDescription> | |||
<name>yearBooks</name> | |||
<comment></comment> | |||
<projects> | |||
</projects> | |||
<buildSpec> | |||
<buildCommand> | |||
<name>org.eclipse.jdt.core.javabuilder</name> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
<buildCommand> | |||
<name>org.eclipse.wst.common.project.facet.core.builder</name> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
<buildCommand> | |||
<name>org.eclipse.wst.validation.validationbuilder</name> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
<buildCommand> | |||
<name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
<buildCommand> | |||
<name>com.genuitec.eclipse.springframework.springbuilder</name> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
<buildCommand> | |||
<name>org.eclipse.m2e.core.maven2Builder</name> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
</buildSpec> | |||
<natures> | |||
<nature>com.genuitec.eclipse.springframework.springnature</nature> | |||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature> | |||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> | |||
<nature>org.eclipse.jdt.core.javanature</nature> | |||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | |||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> | |||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> | |||
</natures> | |||
</projectDescription> |
@@ -0,0 +1,13 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<classpath> | |||
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/> | |||
<classpathentry kind="src" path="target/m2e-jee/web-resources"/> | |||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> | |||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"> | |||
<attributes> | |||
<attribute name="hide" value="true"/> | |||
</attributes> | |||
</classpathentry> | |||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/> | |||
<classpathentry kind="output" path=""/> | |||
</classpath> |
@@ -0,0 +1,4 @@ | |||
eclipse.preferences.version=1 | |||
encoding//src/main/resources/config.properties=UTF-8 | |||
encoding//src/main/resources/log4j.properties=UTF-8 | |||
encoding/<project>=UTF-8 |
@@ -0,0 +1,13 @@ | |||
eclipse.preferences.version=1 | |||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | |||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate | |||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | |||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | |||
org.eclipse.jdt.core.compiler.compliance=1.8 | |||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | |||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | |||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | |||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | |||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | |||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning | |||
org.eclipse.jdt.core.compiler.source=1.8 |
@@ -0,0 +1,4 @@ | |||
activeProfiles= | |||
eclipse.preferences.version=1 | |||
resolveWorkspaceProjects=true | |||
version=1 |
@@ -0,0 +1,10 @@ | |||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> | |||
<wb-module deploy-name="Base2021"> | |||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> | |||
<wb-resource deploy-path="/" source-path="/target/m2e-jee/web-resources"/> | |||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> | |||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> | |||
<property name="java-output-path" value="/LionBase2021/target/classes"/> | |||
<property name="context-root" value="/yb"/> | |||
</wb-module> | |||
</project-modules> |
@@ -0,0 +1,7 @@ | |||
<root> | |||
<facet id="me.spring"> | |||
<node name="libprov"> | |||
<attribute name="provider-id" value="maven-lib-provider"/> | |||
</node> | |||
</facet> | |||
</root> |
@@ -0,0 +1,9 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<faceted-project> | |||
<fixed facet="wst.jsdt.web"/> | |||
<installed facet="maven" version="1.0"/> | |||
<installed facet="wst.jsdt.web" version="1.0"/> | |||
<installed facet="jst.web" version="2.4"/> | |||
<installed facet="java" version="1.8"/> | |||
<installed facet="me.spring" version="4.1"/> | |||
</faceted-project> |
@@ -0,0 +1 @@ | |||
org.eclipse.wst.jsdt.launching.baseBrowserLibrary |
@@ -0,0 +1 @@ | |||
Window |
@@ -0,0 +1,2 @@ | |||
disabled=06target | |||
eclipse.preferences.version=1 |
@@ -0,0 +1,19 @@ | |||
attributeHasNoValue=2 | |||
eclipse.preferences.version=1 | |||
endTagWithAttributes=2 | |||
honourAllSchemaLocations=false | |||
indicateNoGrammar=1 | |||
indicateReferencedFileContainsErrors=2 | |||
indiciateNoDocumentElement=-1 | |||
markupValidation=false | |||
missingClosingBracket=2 | |||
missingClosingQuote=2 | |||
missingEndTag=2 | |||
missingQuotes=2 | |||
missingStartTag=2 | |||
missingTagName=2 | |||
namespaceInPITarget=2 | |||
use-project-settings=true | |||
whitespaceAtStart=2 | |||
whitespaceBeforeTagName=2 | |||
xinclude=false |
@@ -0,0 +1,12 @@ | |||
{ | |||
"ecmaVersion": 6, | |||
"plugins": { | |||
"guess-types": { | |||
} | |||
}, | |||
"libs": [ | |||
"ecma5", | |||
"browser" | |||
] | |||
} |
@@ -0,0 +1,15 @@ | |||
# yearBooks | |||
--- | |||
### 需手动导入以下2包 | |||
> [执行脚本](maven/导入依赖.bat ':include') | |||
1. com.aspose.aspose-words 15.8.0 | |||
``` | |||
mvn install:install-file -Dfile=aspose-words-15.8.0-jdk16.jar -DgroupId=com.aspose -DartifactId=aspose-words -Dversion=15.8.0 -Dpackaging=jar | |||
``` | |||
2. com.aspose.aspose-cells 8.5.2 | |||
``` | |||
call mvn install:install-file -Dfile=aspose-cells-8.5.2.jar -DgroupId=com.aspose -DartifactId=aspose-cells -Dversion=8.5.2 -Dpackaging=jar | |||
``` |
@@ -0,0 +1,18 @@ | |||
@echo off | |||
echo 导入额外依赖..... | |||
call :extract %0 | |||
goto :eof | |||
:extract | |||
@echo 进入目录: %~dp1 | |||
%~d1 | |||
cd %~dp1 | |||
rem com.aspose.aspose-words 15.8.0 | |||
call mvn install:install-file -Dfile=aspose-words-15.8.0-jdk16.jar -DgroupId=com.aspose -DartifactId=aspose-words -Dversion=15.8.0 -Dpackaging=jar | |||
rem com.aspose.aspose-cells 8.5.2 | |||
call mvn install:install-file -Dfile=aspose-cells-8.5.2.jar -DgroupId=com.aspose -DartifactId=aspose-cells -Dversion=8.5.2 -Dpackaging=jar | |||
echo 成功! | |||
pause |
@@ -0,0 +1,279 @@ | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<groupId>com.lion</groupId> | |||
<artifactId>yearBooks</artifactId> | |||
<packaging>war</packaging> | |||
<version>0.0.1-SNAPSHOT</version> | |||
<name>yearBooks</name> | |||
<url>http://maven.apache.org</url> | |||
<dependencies> | |||
<!-- <dependency> | |||
<groupId>junit</groupId> | |||
<artifactId>junit</artifactId> | |||
<version>3.8.1</version> | |||
<scope>test</scope> | |||
</dependency> --> | |||
<dependency> | |||
<groupId>org.springframework</groupId> | |||
<artifactId>spring-test</artifactId> | |||
<version>4.2.6.RELEASE</version> | |||
<scope>test</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework</groupId> | |||
<artifactId>spring-context</artifactId> | |||
<version>4.2.6.RELEASE</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework</groupId> | |||
<artifactId>spring-jdbc</artifactId> | |||
<version>4.2.6.RELEASE</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework</groupId> | |||
<artifactId>spring-web</artifactId> | |||
<version>4.2.6.RELEASE</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework</groupId> | |||
<artifactId>spring-core</artifactId> | |||
<version>4.2.6.RELEASE</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework</groupId> | |||
<artifactId>spring-messaging</artifactId> | |||
<version>4.2.6.RELEASE</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework.data</groupId> | |||
<artifactId>spring-data-commons</artifactId> | |||
<version>1.9.0.RELEASE</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework</groupId> | |||
<artifactId>spring-expression</artifactId> | |||
<version>4.2.6.RELEASE</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework</groupId> | |||
<artifactId>spring-webmvc</artifactId> | |||
<version>4.2.6.RELEASE</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework</groupId> | |||
<artifactId>spring-beans</artifactId> | |||
<version>4.2.6.RELEASE</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework</groupId> | |||
<artifactId>spring-tx</artifactId> | |||
<version>4.2.6.RELEASE</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.springframework</groupId> | |||
<artifactId>spring-aop</artifactId> | |||
<version>4.2.6.RELEASE</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.aspectj</groupId> | |||
<artifactId>aspectjweaver</artifactId> | |||
<version>1.9.6</version> | |||
<scope>runtime</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>mysql</groupId> | |||
<artifactId>mysql-connector-java</artifactId> | |||
<version>5.1.47</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>javax.servlet</groupId> | |||
<artifactId>javax.servlet-api</artifactId> | |||
<version>4.0.1</version> | |||
<scope>provided</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.commons</groupId> | |||
<artifactId>commons-dbcp2</artifactId> | |||
<version>2.1.1</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.commons</groupId> | |||
<artifactId>commons-lang3</artifactId> | |||
<version>3.7</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>commons-fileupload</groupId> | |||
<artifactId>commons-fileupload</artifactId> | |||
<version>1.2.1</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>commons-collections</groupId> | |||
<artifactId>commons-collections</artifactId> | |||
<version>3.2.1</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.commons</groupId> | |||
<artifactId>commons-pool2</artifactId> | |||
<version>2.4.2</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.commons</groupId> | |||
<artifactId>commons-text</artifactId> | |||
<version>1.3</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>log4j</groupId> | |||
<artifactId>log4j</artifactId> | |||
<version>1.2.16</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>commons-beanutils</groupId> | |||
<artifactId>commons-beanutils</artifactId> | |||
<version>1.9.4</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>commons-io</groupId> | |||
<artifactId>commons-io</artifactId> | |||
<version>2.8.0</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.fasterxml.jackson.core</groupId> | |||
<artifactId>jackson-databind</artifactId> | |||
<version>2.5.0</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.fasterxml.jackson.core</groupId> | |||
<artifactId>jackson-core</artifactId> | |||
<version>2.5.0</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.codehaus.jackson</groupId> | |||
<artifactId>jackson-mapper-asl</artifactId> | |||
<version>1.8.8</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.jodd</groupId> | |||
<artifactId>jodd-core</artifactId> | |||
<version>3.7</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.json</groupId> | |||
<artifactId>json</artifactId> | |||
<version>20160212</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>net.sf.json-lib</groupId> | |||
<artifactId>json-lib</artifactId> | |||
<version>2.4</version> | |||
<classifier>jdk15</classifier> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.httpcomponents</groupId> | |||
<artifactId>httpclient</artifactId> | |||
<version>4.5.6</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.alibaba</groupId> | |||
<artifactId>fastjson</artifactId> | |||
<version>1.2.11</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>com.itextpdf</groupId> | |||
<artifactId>itext-asian</artifactId> | |||
<version>5.2.0</version> | |||
</dependency> | |||
<!-- <dependency> | |||
<groupId>org.apache.poi</groupId> | |||
<artifactId>poi</artifactId> | |||
<version>4.1.2</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.poi</groupId> | |||
<artifactId>poi-scratchpad</artifactId> | |||
<version>4.1.2</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.poi</groupId> | |||
<artifactId>poi-ooxml</artifactId> | |||
<version>4.1.2</version> | |||
</dependency> --> | |||
<dependency> | |||
<groupId>org.apache.poi</groupId> | |||
<artifactId>poi</artifactId> | |||
<version>3.10-FINAL</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.poi</groupId> | |||
<artifactId>poi-ooxml</artifactId> | |||
<version>3.10-FINAL</version> | |||
</dependency> | |||
<!-- | |||
mvn install:install-file -Dfile=aspose-words-15.8.0-jdk16.jar -DgroupId=com.aspose -DartifactId=aspose-words -Dversion=15.8.0 -Dpackaging=jar | |||
--> | |||
<dependency> | |||
<groupId>com.aspose</groupId> | |||
<artifactId>aspose-words</artifactId> | |||
<version>15.8.0</version> | |||
</dependency> | |||
<!-- | |||
mvn install:install-file -Dfile=aspose-cells-8.5.2.jar -DgroupId=com.aspose -DartifactId=aspose-cells -Dversion=8.5.2 -Dpackaging=jar | |||
--> | |||
<dependency> | |||
<groupId>com.aspose</groupId> | |||
<artifactId>aspose-cells</artifactId> | |||
<version>8.5.2</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.slf4j</groupId> | |||
<artifactId>slf4j-simple</artifactId> | |||
<version>1.7.25</version> | |||
<scope>compile</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.projectlombok</groupId> | |||
<artifactId>lombok</artifactId> | |||
<version>1.18.12</version> | |||
<scope>provided</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.java-websocket</groupId> | |||
<artifactId>Java-WebSocket</artifactId> | |||
<version>1.5.1</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.mybatis</groupId> | |||
<artifactId>mybatis</artifactId> | |||
<version>3.3.1</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.mybatis</groupId> | |||
<artifactId>mybatis-spring</artifactId> | |||
<version>1.2.2</version> | |||
</dependency> | |||
</dependencies> | |||
<build> | |||
<finalName>Base2021</finalName> | |||
<plugins> | |||
<plugin> | |||
<groupId>org.apache.maven.plugins</groupId> | |||
<artifactId>maven-compiler-plugin</artifactId> | |||
<version>2.3.2</version> | |||
<configuration> | |||
<source>1.8</source> | |||
<target>1.8</target> | |||
</configuration> | |||
</plugin> | |||
</plugins> | |||
</build> | |||
</project> |
@@ -0,0 +1,14 @@ | |||
package com.lion.config; | |||
import javax.servlet.ServletContextEvent; | |||
import javax.servlet.ServletContextListener; | |||
import javax.servlet.annotation.WebListener; | |||
@WebListener | |||
public class Config implements ServletContextListener{ | |||
public void contextDestroyed(ServletContextEvent arg0) { | |||
} | |||
public void contextInitialized(ServletContextEvent arg0) { | |||
LoginUserInfoCache.load(); | |||
} | |||
} |
@@ -0,0 +1,63 @@ | |||
package com.lion.config; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.util.PropertiesUtil; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.Util; | |||
public class LoginUserInfoCache { | |||
public static Map<String,LoginUserInfo> mapUser=new HashMap<String, LoginUserInfo>(); | |||
/** 重启时清空 | |||
* @return | |||
*/ | |||
public static Map<String,LoginUserInfo> load(){ | |||
mapUser=new HashMap<String, LoginUserInfo>(); | |||
String openID=PropertiesUtil.getProperty("openID"); | |||
if(openID.equals("1")){ | |||
JdbcTemplate jdbc=Util.jdbc(); | |||
List<Map<String,Object>> list=jdbc.queryForList("select s.cookie,id,userAccount,roleid,orgid " | |||
+ "from org_user o INNER JOIN sys_login s on o.id=s.userid " | |||
+ "where s.logintime like '"+TimeUtil.getNowTimeNYR()+"%'"); | |||
if(list.size()>0){ | |||
for(Map<String,Object> map:list){ | |||
LoginUserInfo user=new LoginUserInfo(); | |||
user.setOrgid(map.get("orgid").toString()); | |||
user.setRoleid(map.get("roleid").toString()); | |||
user.setUserId(map.get("id").toString()); | |||
user.setUserAccount(map.get("userAccount").toString()); | |||
mapUser.put(map.get("cookie").toString(),user); | |||
} | |||
} | |||
} | |||
return mapUser; | |||
} | |||
/** 删除人员时操作 | |||
*/ | |||
public static void remove(String cookie){ | |||
mapUser.remove(cookie); | |||
} | |||
/** 登录成功后操作 | |||
*/ | |||
public static void add(String cookie,LoginUserInfo user){ | |||
mapUser.put(cookie,user); | |||
} | |||
/**根据token获取用户信息 | |||
* @param token | |||
* @return | |||
*/ | |||
public static LoginUserInfo getLoginUserInfoByToken(String cookie){ | |||
return mapUser.get(cookie); | |||
} | |||
/**更新用户信息 | |||
* @param user | |||
*/ | |||
public static void updateUserInfo(String cookie,LoginUserInfo user){ | |||
mapUser.put(cookie, user); | |||
} | |||
} |
@@ -0,0 +1,94 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧软件有限公司 | |||
* 工程名:SpringMVCLion | |||
* 文件名:AuthorityController.java | |||
* 创建日期:2019年3月5日 上午8:32:44 | |||
* 作者:cpf | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import javax.servlet.http.HttpSession; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.service.AuthorityService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 权限管理 | |||
* | |||
* @author cpf | |||
* @since 2019年3月5日 | |||
*/ | |||
@RestController | |||
@RequestMapping("authority") | |||
public class AuthorityController { | |||
@Autowired | |||
private AuthorityService service; | |||
/** | |||
* 方法描述 查询角色表 | |||
* | |||
* @author cpf | |||
* @since 2019年3月5日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getAuthority.service") | |||
public Map<String, Object> getAuthority(HttpServletRequest req) { | |||
return service.getAuthority(); | |||
} | |||
/** | |||
* 方法描述 查询菜单列表 | |||
* | |||
* @author cpf | |||
* @since 2019年3月5日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getAuthorityTreeList.service") | |||
public Map<String, Object> getAuthorityTreeList(HttpServletRequest req, HttpSession session) { | |||
LoginUserInfo s = TokenUtil.getUserInfo(req); | |||
return service.getAuthorityTreeList(s); | |||
} | |||
/** | |||
* 方法描述 根据角色id 查询列表id 回显 | |||
* | |||
* @author cpf | |||
* @since 2019年3月5日 | |||
* @param req | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("getAuth.service") | |||
public Map<String, Object> getAuth(HttpServletRequest req, int id) { | |||
return service.getAuth(id); | |||
} | |||
/** | |||
* 方法描述 | |||
* | |||
* @author cpf 删除后添加权限 | |||
* @since 2019年3月5日 | |||
* @param req | |||
* @param roleid | |||
* @param resourceid | |||
* //1,2,3,5,6,10,11,12,13,14 | |||
* @return | |||
*/ | |||
@RequestMapping("DeleteAndAdd.service") | |||
public String DeleteAndAdd(HttpServletRequest req, HttpSession session, String roleid, String resourceid) { | |||
return service.DeleteAndAdd(roleid, resourceid); | |||
} | |||
} |
@@ -0,0 +1,42 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:CommentController.java | |||
* 创建日期:2021年10月21日 上午9:37:18 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.lion.service.CommentService; | |||
/** | |||
* 类描述 共用方法controller | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("comment") | |||
public class CommentController { | |||
@Autowired | |||
private CommentService service; | |||
/** | |||
* | |||
* 方法描述 获取年度信息 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param tableName 数据所在表 | |||
* @return | |||
*/ | |||
@RequestMapping("loadYears.service") | |||
public Map<String,Object> loadYears(String tableName){ | |||
return service.loadYears(tableName); | |||
} | |||
} |
@@ -0,0 +1,92 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:FruitController.java | |||
* 创建日期:2021年10月28日 上午10:15:24 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import javax.servlet.http.HttpServletResponse; | |||
import org.apache.http.HttpResponse; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.lion.entity.Fruit; | |||
import com.lion.service.FruitService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 种植业指标-水果类别 controller | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
*/ | |||
@RestController | |||
@RequestMapping("fruit") | |||
public class FruitController { | |||
@Autowired | |||
private FruitService service; | |||
/** | |||
* | |||
* 方法描述 查询类别列表 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param rows | |||
* @param page | |||
* @param name | |||
* @return | |||
*/ | |||
@RequestMapping("getTypeList.service") | |||
public Map<String, Object> getTypeList(String rows,String page,String name){ | |||
return service.getTypeList(rows, page, name); | |||
} | |||
/** | |||
* | |||
* 方法描述 保存类别信息 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param req | |||
* @param f | |||
* @return | |||
*/ | |||
@RequestMapping("saveTypeInfo.service") | |||
public Map<String,Object> saveTypeInfo(HttpServletRequest req,Fruit f){ | |||
return service.saveTypeInfo(f, TokenUtil.getUserInfo(req).getUserId()); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除类别 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("deleteType.service") | |||
public Map<String,Object> deleteType(String id){ | |||
return service.deleteType(id); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询水果类别 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @return | |||
*/ | |||
@RequestMapping("getTypeAllList.service") | |||
public Map<String,Object> getTypeList(){ | |||
return service.getTypeList(); | |||
} | |||
@RequestMapping("getTypeAllList.do") | |||
public Map<String,Object> getTypeListDo(HttpServletResponse response){ | |||
response.addHeader("Content-Security-Policy","object-src 'self'"); | |||
return service.getTypeList(); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:HomeController.java | |||
* 创建日期:2021年10月28日 下午3:45:12 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.service.HomeService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月28日 | |||
*/ | |||
@RestController | |||
@RequestMapping("home") | |||
public class HomeController { | |||
@Resource | |||
private HomeService service; | |||
/** | |||
* 方法描述 农村与农村经济 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月29日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getNcjjInfo.service") | |||
public Map<String,Object> getNcjjInfo(HttpServletRequest req,String year){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
String orgid=user.getOrgid(); | |||
return service.getNcjjInfo(year, orgid); | |||
} | |||
/** | |||
* 方法描述 农业技术装备统计 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月29日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getNyzbInfo.service") | |||
public Map<String,Object> getNyzbInfo(HttpServletRequest req,String year){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
String orgid=user.getOrgid(); | |||
return service.getNyzbInfo(year, orgid); | |||
} | |||
/** | |||
* 方法描述 农村科技与教育 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月29日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getNckjInfo.service") | |||
public Map<String,Object> getNckjInfo(HttpServletRequest req,String year){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
String orgid=user.getOrgid(); | |||
return service.getNckjInfo(year, orgid); | |||
} | |||
/** | |||
* 方法描述 种植业 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月29日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getZzyInfo.service") | |||
public Map<String,Object> getZzyInfo(HttpServletRequest req,String year){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
String orgid=user.getOrgid(); | |||
return service.getZzyInfo(year, orgid); | |||
} | |||
/** | |||
* 方法描述 畜牧业 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月29日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getXmyInfo.service") | |||
public Map<String,Object> getXmyInfo(HttpServletRequest req,String year){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
String orgid=user.getOrgid(); | |||
return service.getXmyInfo(year, orgid); | |||
} | |||
/** | |||
* 方法描述 农村与农村经济 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月29日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getYyInfo.service") | |||
public Map<String,Object> getYyInfo(HttpServletRequest req,String year){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
String orgid=user.getOrgid(); | |||
return service.getYyInfo(year, orgid); | |||
} | |||
} |
@@ -0,0 +1,107 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:InoutController.java | |||
* 创建日期:2021年10月21日 上午9:12:03 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.Inout; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.service.InoutService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("inout") | |||
public class InoutController { | |||
@Autowired | |||
private InoutService service; | |||
/** | |||
* | |||
* 方法描述 查询居民收入与支出记录 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param rows | |||
* @param page | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getInoutRecordList.service") | |||
public Map<String,Object> getInoutRecordList(HttpServletRequest req,String rows,String page,String year){ | |||
return service.getInoutRecordList(rows, page, TokenUtil.getUserInfo(req).getOrgid(), year); | |||
} | |||
/** | |||
* | |||
* 方法描述 保存居民收入与支出信息 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param t | |||
* @return | |||
*/ | |||
@RequestMapping("saveInoutRecord.service") | |||
public Map<String,Object> saveInoutRecord(HttpServletRequest req,Inout t){ | |||
return service.saveInoutRecord(t, TokenUtil.getUserInfo(req).getOrgid(), TokenUtil.getUserInfo(req).getUserId()); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除居民收入与支出信息 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("deleteInoutRecord.service") | |||
public Map<String,Object> deleteInoutRecord(String id){ | |||
return service.deleteInoutRecord(id); | |||
} | |||
/** | |||
* | |||
* 方法描述 导出居民收入与支出信息 | |||
* @author mt.W | |||
* @since 2021年10月22日 | |||
* @param req | |||
* @param year | |||
* @param orgid | |||
* @param flag | |||
* @return | |||
*/ | |||
@RequestMapping("exprotInoutRecord.service") | |||
public Map<String,Object> exprotInoutRecord(HttpServletRequest req,String year){ | |||
return service.exprotInoutRecord(req, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 导入文件 | |||
* @author mt.W | |||
* @since 2021年10月22日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} | |||
@@ -0,0 +1,99 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:JinChuKouController.java | |||
* 创建日期:2021年10月21日 下午3:08:04 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.JinChuKou; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.service.JinChuKouService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("jck") | |||
public class JinChuKouController { | |||
@Autowired | |||
private JinChuKouService service; | |||
/** | |||
* | |||
* 方法描述 查询进出口贸易信息 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param rows | |||
* @param page | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getJinChuKouRecord.service") | |||
public Map<String,Object> getJinChuKouRecord(HttpServletRequest req,String rows,String page,String year){ | |||
return service.getJinChuKouRecord(rows, page, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 保存进出口贸易信息 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param j | |||
* @return | |||
*/ | |||
@RequestMapping("saveJinChuKouInfo.service") | |||
public Map<String,Object> saveJinChuKouInfo(HttpServletRequest req,JinChuKou j){ | |||
return service.saveJinChuKouInfo(j, TokenUtil.getUserInfo(req).getOrgid(), TokenUtil.getUserInfo(req).getUserId()); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除进出口贸易信息 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("deleteJinChuKouInfo.service") | |||
public Map<String,Object> deleteJinChuKouInfo(String id){ | |||
return service.deleteJinChuKouInfo(id); | |||
} | |||
/** | |||
* | |||
* 方法描述 导出进出口贸易信息 | |||
* @author mt.W | |||
* @since 2021年10月22日 | |||
* @param req | |||
* @param year | |||
* @param orgid | |||
* @param flag | |||
* @return | |||
*/ | |||
@RequestMapping("exprotJinChuKouRecord.service") | |||
public Map<String,Object> exprotJinChuKouRecord(HttpServletRequest req,String year){ | |||
return service.exprotJinChuKouRecord(req, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,45 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧软件有限公司 | |||
* 工程名:SpringMvcLion | |||
* 文件名:LogController.java | |||
* 创建日期:2019年3月2日 上午11:35:41 | |||
* 作者:dlm | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.lion.service.LogService; | |||
/** | |||
* 类描述 | |||
* @author dlm | |||
* @since 2019年3月2日 | |||
*/ | |||
@RestController | |||
@RequestMapping("log") | |||
public class LogController { | |||
@Autowired | |||
private LogService service; | |||
/** | |||
* 方法描述 获取日志记录 | |||
* @author dlm | |||
* @since 2019年3月2日 | |||
* @param req | |||
* @param page 当前页 | |||
* @param rows 条数 | |||
* @param startTime | |||
* @param endTime | |||
* @return | |||
*/ | |||
@RequestMapping("getLog.service") | |||
public Map<String,Object> getLog(HttpServletRequest req,String page,String rows,String startTime,String endTime,String text){ | |||
return service.getLog(page, rows, startTime, endTime, text); | |||
} | |||
} |
@@ -0,0 +1,138 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧软件有限公司 | |||
* 工程名:testMvc | |||
* 文件名:LiginController.java | |||
* 创建日期:2019年2月26日 下午2:04:31 | |||
* 作者:dlm | |||
*/ | |||
package com.lion.controller; | |||
import java.awt.Color; | |||
import java.awt.Font; | |||
import java.awt.Graphics; | |||
import java.awt.image.BufferedImage; | |||
import java.io.IOException; | |||
import java.util.Map; | |||
import java.util.Random; | |||
import javax.imageio.ImageIO; | |||
import javax.servlet.http.HttpServletRequest; | |||
import javax.servlet.http.HttpServletResponse; | |||
import javax.servlet.http.HttpSession; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.lion.service.LoginService; | |||
import com.lion.util.Util; | |||
/** | |||
* 类描述 登录 | |||
* @author dlm | |||
* @since 2019年2月26日 | |||
*/ | |||
@RestController | |||
@RequestMapping("login") | |||
public class LoginController { | |||
@Autowired | |||
private LoginService service; | |||
@Value("#{configProperties['loginOut']}") | |||
private String loginOut; | |||
@Value("#{configProperties['private_key']}") // 读取配置文件的属性 | |||
private String private_key; | |||
/** | |||
* 方法描述 组织机构用户登录 | |||
* @author dlm | |||
* @since 2019年3月14日 | |||
* @param req | |||
* @param session | |||
* @param userName | |||
* @param password | |||
* @param code | |||
* @return | |||
*/ | |||
@RequestMapping("userLogin.do") | |||
public String userLoginManager(HttpServletRequest req,HttpServletResponse res,HttpSession session,String userName,String password,String code){ | |||
return service.userLoginManager(req, res, session, userName, password, code,private_key); | |||
} | |||
/** | |||
* 方法描述 根据当前用户登录的角色获取资源 | |||
* @author dlm | |||
* @since 2019年2月27日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getResourcesByRole.service") | |||
public Map<String,Object> getResourcesByRole(HttpServletRequest req,HttpSession session){ | |||
return service.getResourcesByRole(req, session); | |||
} | |||
/** | |||
* 方法描述 安全退出 | |||
* @author dlm | |||
* @since 2019年3月1日 | |||
* @param req | |||
* @param session | |||
* @return | |||
*/ | |||
@RequestMapping("loginOut.service") | |||
public String loginOut(HttpServletRequest req,HttpSession session){ | |||
service.loginOut(session,loginOut); | |||
return Util.responseString("true", "../login.html"); | |||
} | |||
@RequestMapping("loginOut.do") | |||
public String loginOutDo(HttpServletRequest req,HttpSession session){ | |||
service.loginOut(session,loginOut); | |||
return Util.responseString("true", "../login.html"); | |||
} | |||
/** | |||
* 方法描述 生成验证码 | |||
* @author dlm | |||
* @since 2019年3月1日 | |||
* @param req | |||
* @param timestamp 时间戳 | |||
* @return | |||
* @throws IOException | |||
*/ | |||
@RequestMapping("createImg.do") | |||
public void createImg(HttpServletRequest req,HttpSession session,String timestamp,HttpServletResponse res) throws IOException{ | |||
String str="ABCDEFGHIGKLMNOPQRSTUVWXYZ0123456789"; | |||
int width=80;//宽度 | |||
int height=38;//验证码高度 | |||
BufferedImage buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); | |||
Graphics gd = buffImg.getGraphics(); | |||
gd.setColor(Color.WHITE); | |||
gd.fillRect(0, 0, width, height); | |||
Random r = new Random(); | |||
StringBuffer sb = new StringBuffer(); | |||
for (int i = 0; i < 4; i++) { | |||
gd.setColor(new Color(r.nextInt(88), r.nextInt(210), r.nextInt(150))); | |||
String code=str.charAt(new Random().nextInt(str.length()))+""; | |||
gd.setFont(new Font("微软雅黑",Font.PLAIN,22));//字体及大小 | |||
gd.drawString(code, 15 * i + 7, 27); | |||
sb.append(code); | |||
} | |||
session.setAttribute("ecode",sb.toString()); | |||
gd.drawRect(0, 0, width - 1, height - 1); | |||
ImageIO.write(buffImg, "jpg", res.getOutputStream()); | |||
} | |||
/** | |||
* 方法描述 修改密码 | |||
* @author cpf | |||
* @since 2019年3月7日 | |||
* @return | |||
*/ | |||
@RequestMapping("submitPassword.service") | |||
public String updatePassword(HttpServletRequest req,HttpSession session,String password,String confirm_password){ | |||
return service.updatePassword(req, session, password, confirm_password); | |||
} | |||
@RequestMapping("returnUserInfo.service") | |||
public Map<String,Object> returnUserInfo(HttpServletRequest req){ | |||
return service.returnUserInfo(req); | |||
} | |||
} |
@@ -0,0 +1,45 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:LoginSignController.java | |||
* 创建日期:2021年11月11日 上午9:14:07 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import javax.servlet.http.HttpSession; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.beans.factory.annotation.Value; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.lion.service.LoginSignService; | |||
/** | |||
* 类描述 | |||
* @author mt.W | |||
* @since 2021年11月11日 | |||
*/ | |||
@RequestMapping("loginSign") | |||
@RestController | |||
public class LoginSignController { | |||
@Value("#{configProperties['tokenUrl']}") | |||
private String tokenUrl; | |||
@Value("#{configProperties['appkey']}") | |||
private String appkey; | |||
@Value("#{configProperties['appsecret']}") | |||
private String appsecret; | |||
@Autowired | |||
private LoginSignService service; | |||
@RequestMapping("login.do") | |||
public String login(String code,String exiturl,HttpSession session){ | |||
return service.login(session,code, exiturl,tokenUrl,appkey,appsecret); | |||
} | |||
@RequestMapping("loginIn.do") | |||
public String loginIn(HttpSession session){ | |||
return service.loginIn(session); | |||
} | |||
} |
@@ -0,0 +1,51 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:MainShowController.java | |||
* 创建日期:2021年10月29日 下午2:39:22 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletResponse; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.lion.service.MainShowService; | |||
/** | |||
* 类描述 | |||
* @author mt.W | |||
* @since 2021年10月29日 | |||
*/ | |||
@RestController | |||
@RequestMapping("mainshow") | |||
public class MainShowController { | |||
@Autowired | |||
private MainShowService service; | |||
/** | |||
* | |||
* 方法描述 | |||
* @author mt.W | |||
* @since 2021年10月29日 | |||
* @param tableName | |||
* @return | |||
*/ | |||
@RequestMapping("getInfo.do") | |||
public Map<String, Object> getInfo(String tableName,String colNumNames,String year,HttpServletResponse response){ | |||
response.addHeader("Content-Security-Policy","object-src 'self'"); | |||
return service.getNongYeShengChanZongZhiInfo(tableName,colNumNames,year); | |||
} | |||
@RequestMapping("getMainShowSgInfo.do") | |||
public Map<String,Object> getMainShowSgInfo(String fruitId,String type,String year,HttpServletResponse response){ | |||
response.addHeader("Content-Security-Policy","object-src 'self'"); | |||
return service.getMainShowSgInfo(fruitId, type,year); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NcjjLhs; | |||
import com.lion.service.NcjjLhsService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 汇总村级经济联合社 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("ncjjlhs") | |||
public class NcjjLhsController { | |||
@Resource | |||
private NcjjLhsService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(NcjjLhs z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NcjjNhs; | |||
import com.lion.service.NcjjNhsService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 汇总农户数 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("ncjjnhs") | |||
public class NcjjNhsController { | |||
@Resource | |||
private NcjjNhsService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(NcjjNhs z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NcjjSy; | |||
import com.lion.service.NcjjSyService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 集体经济收益 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("ncjjsy") | |||
public class NcjjSyController { | |||
@Resource | |||
private NcjjSyService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(NcjjSy z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NcjjXh; | |||
import com.lion.service.NcjjXhService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农业总产值 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("ncjjxh") | |||
public class NcjjXhController { | |||
@Resource | |||
private NcjjXhService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(NcjjXh z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NcjjZcz; | |||
import com.lion.service.NcjjZczService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农业总产值 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("ncjjzcz") | |||
public class NcjjZczController { | |||
@Resource | |||
private NcjjZczService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(NcjjZcz z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NcjjZjz; | |||
import com.lion.service.NcjjZjzService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农业增加值 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("ncjjzjz") | |||
public class NcjjZjzController { | |||
@Resource | |||
private NcjjZjzService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(NcjjZjz z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NckjSfh; | |||
import com.lion.service.NckjSfhService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 科普示范户 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("nckjsfh") | |||
public class NckjSfhController { | |||
@Resource | |||
private NckjSfhService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(NckjSfh z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NckjSfjd; | |||
import com.lion.service.NckjSfjdService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 科普示范基地 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("nckjsfjd") | |||
public class NckjSfjdController { | |||
@Resource | |||
private NckjSfjdService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(NckjSfjd z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NckjSfq; | |||
import com.lion.service.NckjSfqService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 科普示范区 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("nckjsfq") | |||
public class NckjSfqController { | |||
@Resource | |||
private NckjSfqService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(NckjSfq z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NcjjZyjs; | |||
import com.lion.service.NckjZyjsService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 专业技术协会 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("nckjzyjs") | |||
public class NckjZyjsController { | |||
@Resource | |||
private NckjZyjsService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(NcjjZyjs z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NyzbUser; | |||
import com.lion.service.NyzbUserService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农机社会化组织及人员 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("nyzbuser") | |||
public class NyzbUserController { | |||
@Resource | |||
private NyzbUserService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(NyzbUser z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,104 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:NyzbYdhxhController.java | |||
* 创建日期:2021年10月25日 下午4:03:03 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NyzbYdhxh; | |||
import com.lion.service.NyzbYdhxhService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 农业技术装备统计指标-用电与农业化学化Controller | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
*/ | |||
@RestController | |||
@RequestMapping("ydhxh") | |||
public class NyzbYdhxhController { | |||
@Autowired | |||
private NyzbYdhxhService service; | |||
/** | |||
* | |||
* 方法描述 查询记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param rows | |||
* @param page | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getRecordList.service") | |||
public Map<String, Object> getRecordList(HttpServletRequest req,String rows,String page,String year){ | |||
return service.getRecordList(rows, page, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 保存记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param n | |||
* @return | |||
*/ | |||
@RequestMapping("saveRecord.service") | |||
public Map<String,Object> saveRecord(HttpServletRequest req,NyzbYdhxh n){ | |||
return service.saveRecord(n, TokenUtil.getUserInfo(req).getUserId(), TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("deleteRecord.service") | |||
public Map<String,Object> deleteRecord(String id){ | |||
return service.deleteRecord(id); | |||
} | |||
/** | |||
* | |||
* 方法描述 导出记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("exprotRecord.service") | |||
public Map<String,Object> exprotRecord(HttpServletRequest req,String year){ | |||
return service.exprotRecord(req, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 导入记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.NyzbZyqk; | |||
import com.lion.service.NyzbZyqkService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农业机械作业情况 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("nyzbzyqk") | |||
public class NyzbZyqkController { | |||
@Resource | |||
private NyzbZyqkService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(NyzbZyqk z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,105 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:NyzbnjzlController.java | |||
* 创建日期:2021年10月25日 上午8:50:55 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.Nyzbnjzl; | |||
import com.lion.service.NyzbnjzlService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 农业技术装备-农业机械年末拥有量Controller | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
*/ | |||
@RestController | |||
@RequestMapping("njzl") | |||
public class NyzbnjzlController { | |||
@Autowired | |||
private NyzbnjzlService service; | |||
/** | |||
* | |||
* 方法描述 查询农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param rows | |||
* @param page | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getRecordList.service") | |||
public Map<String,Object> getRecordList(HttpServletRequest req,String rows,String page,String year){ | |||
return service.getRecordList(rows, page, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 保存农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param n | |||
* @return | |||
*/ | |||
@RequestMapping("saveRecord.service") | |||
public Map<String,Object> saveRecord(HttpServletRequest req,Nyzbnjzl n){ | |||
return service.saveRecord(n, TokenUtil.getUserInfo(req).getUserId(), TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("deleteRecord.service") | |||
public Map<String,Object> deleteRecord(String id){ | |||
return service.deleteRecord(id); | |||
} | |||
/** | |||
* | |||
* 方法描述 导出农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("exprotRecord.service") | |||
public Map<String,Object> exprotRecord(HttpServletRequest req,String year){ | |||
return service.exprotRecord(req, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 导入农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,96 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧有限公司 | |||
* 工程名:SpringMvcLion | |||
* 文件名:OrganizationTreeController.java | |||
* 创建日期:2019年3月1日 下午3:11:29 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.io.UnsupportedEncodingException; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import javax.servlet.http.HttpSession; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.service.OrganizationTreeService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 组织树列 | |||
* @author mt.W | |||
* @since 2019年3月1日 | |||
*/ | |||
@RestController | |||
@RequestMapping("organization") | |||
public class OrganizationTreeController { | |||
@Autowired | |||
private OrganizationTreeService service; | |||
/** | |||
* | |||
* 方法描述 保存节点信息 | |||
* @author mt.W | |||
* @since 2019年3月4日 | |||
* @param id | |||
* @return | |||
* @throws UnsupportedEncodingException | |||
*/ | |||
@RequestMapping("save.service") | |||
public String updateNode(HttpServletRequest req,HttpSession session,String name,String id,String level,String pid,String oid,String otherId) throws UnsupportedEncodingException{ | |||
LoginUserInfo s=TokenUtil.getUserInfo(req); | |||
return service.updateNode(s, name, id, level, pid, oid,otherId); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除节点 | |||
* @author mt.W | |||
* @since 2019年3月4日 | |||
* @param req | |||
* @param session | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public String deleteNode(HttpServletRequest req,HttpSession session,String id){ | |||
LoginUserInfo s=TokenUtil.getUserInfo(req); | |||
return service.deleteNode(s, id); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询组织架构树(当前查到3级节点) | |||
* @author mt.W | |||
* @since 2020年9月8日 | |||
* @param req | |||
* @param session | |||
* @param flag | |||
* @return | |||
*/ | |||
@RequestMapping("getorgdept.service") | |||
public Map<String,Object> getOrgdeptAll(HttpServletRequest req,HttpSession session,String flag){ | |||
return service.getOrgdeptAll(flag,req); | |||
} | |||
/** | |||
* 方法描述 根据当前登录人员获取部门 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月22日 | |||
* @param req | |||
* @return | |||
*//* | |||
@RequestMapping("getOrgByUserOrg.service") | |||
public Map<String,Object> getOrgByUserOrg(HttpServletRequest req){ | |||
}*/ | |||
@RequestMapping("getOrgdeptListInfo.service") | |||
public Map<String,Object> getOrgdeptListInfo(HttpServletRequest req){ | |||
return service.getOrgdeptListInfo(TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
} |
@@ -0,0 +1,108 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧有限公司 | |||
* 工程名:SpringMvcLion | |||
* 文件名:ResourceController.java | |||
* 创建日期:2019年3月18日 上午9:02:41 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import javax.servlet.http.HttpSession; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.lion.entity.Resources; | |||
import com.lion.service.ResourceService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 | |||
* @author mt.W | |||
* @since 2019年3月18日 | |||
*/ | |||
@RestController | |||
@RequestMapping("resource") | |||
public class ResourceController { | |||
@Autowired | |||
private ResourceService service; | |||
/** | |||
* | |||
* 方法描述 获取资源菜单树 | |||
* @author mt.W | |||
* @since 2019年3月18日 | |||
* @param req | |||
* @param session | |||
* @return | |||
*/ | |||
@RequestMapping("getResourceTree.service") | |||
public Map<String, Object> getResourceTree(HttpServletRequest req,HttpSession session){ | |||
return service.getResourceTree(); | |||
} | |||
/** | |||
* | |||
* 方法描述 菜单提交保存 | |||
* @author mt.W | |||
* @since 2019年3月18日 | |||
* @param req | |||
* @param session | |||
* @param r | |||
* @return | |||
*/ | |||
@RequestMapping("saveResource.service") | |||
public String saveResource(HttpServletRequest req,HttpSession session,Resources r){ | |||
String userId=TokenUtil.getUserInfo(req).getUserId(); | |||
return service.saveResource(userId, r); | |||
} | |||
/** | |||
* | |||
* 方法描述 菜单删除 | |||
* @author mt.W | |||
* @since 2019年3月18日 | |||
* @param req | |||
* @param session | |||
* @param r | |||
* @return | |||
*/ | |||
@RequestMapping("deleteResource.service") | |||
public String deleteResourcr(HttpServletRequest req,HttpSession session,Resources r){ | |||
//父菜单下存在子菜单,无法进行删除 | |||
return service.deleteResourcr(r); | |||
} | |||
/** | |||
* | |||
* 方法描述 菜单节点迁移 | |||
* @author mt.W | |||
* @since 2019年10月30日 | |||
* @param req | |||
* @param id 菜单id | |||
* @param pid 目标父节点id | |||
* @return | |||
*/ | |||
@RequestMapping("qianyi.service") | |||
public String qianyiNode(HttpServletRequest req,String id,String pid){ | |||
return service.qianyiNode(id, pid); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询一级菜单 | |||
* @author mt.W | |||
* @since 2019年10月30日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getfirst.service") | |||
public Map<String,Object> getFirstMunu(HttpServletRequest req){ | |||
return service.getFirstMunu(); | |||
} | |||
} |
@@ -0,0 +1,67 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧软件有限公司 | |||
* 工程名:SpringMVCLion | |||
* 文件名:RoleController.java | |||
* 创建日期:2019年2月28日 上午9:05:18 | |||
* 作者:chengpengfei | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import javax.servlet.http.HttpSession; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.lion.service.RoleService; | |||
/** | |||
* 类描述 角色操作 | |||
* @author chengpengfei | |||
* @since 2019年2月28日 | |||
*/ | |||
@RestController | |||
@RequestMapping("role") | |||
public class RoleController { | |||
@Autowired | |||
private RoleService service; | |||
/** | |||
* 方法描述 全查角色 | |||
* @author chengpengfei | |||
* @since 2019年2月28日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getRole.service") | |||
public Map<String,Object> getUser(HttpServletRequest req,HttpSession session){ | |||
return service.getUser(req, session); | |||
} | |||
/** | |||
* 方法描述 删除角色 | |||
* @author chengpengfei | |||
* @since 2019年2月28日 | |||
* @param req | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("deleteRole.service") | |||
public String deleteRole(HttpServletRequest req,String roleId,HttpSession session){ | |||
return service.deleteRole(req, roleId, session); | |||
} | |||
/** | |||
* 方法描述 添加修改用户 | |||
* @author ASUS | |||
* @since 2019年2月28日 | |||
* @param req | |||
* @param name | |||
* @return | |||
*/ | |||
@RequestMapping("addAndUpdateRole.service") | |||
public String addAndUpdateRole(HttpServletRequest req,HttpSession session,String name,String content,String id){ | |||
return service.addAndUpdateRole(req, session, name, content, id); | |||
} | |||
} |
@@ -0,0 +1,40 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:szjgpt | |||
* 文件名:TianQiControllr.java | |||
* 创建日期:2021年9月1日 上午9:48:23 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.io.UnsupportedEncodingException; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.json.JSONObject; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.alibaba.fastjson.JSONArray; | |||
import com.lion.util.HttpUtil; | |||
import com.lion.util.Util; | |||
/** | |||
* 类描述 | |||
* @author mt.W | |||
* @since 2021年9月1日 | |||
*/ | |||
@RestController | |||
@RequestMapping("tianqi") | |||
public class TianQiController { | |||
@RequestMapping("returnTianqiInfo.do") | |||
public Map<String,Object> returnTianqiInfo() throws UnsupportedEncodingException{ | |||
String url = "http://wthrcdn.etouch.cn/weather_mini?city=惠州市"; | |||
String rs = HttpUtil.httpGet(url); | |||
JSONObject json = new JSONObject(new String(rs.getBytes("iso8859-1"),"utf-8")); | |||
@SuppressWarnings("unchecked") | |||
List<Map<String,Object>> list = (List<Map<String, Object>>) JSONArray.parse(json.getJSONObject("data").get("forecast").toString()); | |||
return Util.responseMap("true", list); | |||
} | |||
} |
@@ -0,0 +1,111 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧有限公司 | |||
* 工程名:SpringMvcLion | |||
* 文件名:UserController.java | |||
* 创建日期:2019年3月5日 下午3:17:16 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import javax.servlet.http.HttpSession; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import com.lion.entity.User; | |||
import com.lion.service.UserService; | |||
/** | |||
* 类描述 | |||
* @author mt.W | |||
* @since 2019年3月5日 | |||
*/ | |||
@RestController | |||
@RequestMapping("user") | |||
public class UserController { | |||
@Autowired | |||
private UserService service; | |||
/** | |||
* 方法描述 通过orgid查询人员 条件查询人员 | |||
* @author cpf | |||
* @since 2019年7月19日 | |||
* @return | |||
*/ | |||
@RequestMapping("getUser.service") | |||
public Map<String,Object> getUser(HttpServletRequest req,HttpSession session,String page,String rows,String orgid,String phname){ | |||
return service.getUser(page, rows, orgid, phname,req); | |||
} | |||
/** | |||
* | |||
* 方法描述 迁移人员 | |||
* @author mt.W | |||
* @since 2019年10月30日 | |||
* @param req | |||
* @param id 人员 id | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
@RequestMapping("qianyi.service") | |||
public String updateUser(HttpServletRequest req,String id,String orgid){ | |||
return service.updateUser(id, orgid); | |||
} | |||
/** | |||
* 方法描述 保存人员信息修改 | |||
* @author wcj | |||
* @since 2019年11月6日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("save.service") | |||
public String updataUser(HttpServletRequest req, HttpSession session, User u) { | |||
return service.updataUser(req, session, u); | |||
} | |||
/** | |||
* 方法描述 删除人员 | |||
* @author wcj | |||
* @since 2019年11月7日 | |||
* @param req | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public String deleteUser(HttpServletRequest req,String id){ | |||
return service.deleteUser(req, id); | |||
} | |||
/** | |||
* 方法描述 查询所有角色 | |||
* @author wcj | |||
* @since 2019年11月7日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getrole.service") | |||
public Map<String,Object> getrole(HttpServletRequest req){ | |||
return service.getrole(req); | |||
} | |||
/** | |||
* | |||
* 方法描述 初始化人员密码 | |||
* @author mt.W | |||
* @since 2020年2月25日 | |||
* @param req | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("initpwd.service") | |||
public String initPwd(HttpServletRequest req,String id){ | |||
return service.initPwd(req, id); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.XmyCpcl; | |||
import com.lion.service.XmyCpclService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 产品产量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("xmycpcl") | |||
public class XmyCpclController { | |||
@Resource | |||
private XmyCpclService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(XmyCpcl z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.XmyDncl; | |||
import com.lion.service.XmyDnclService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 当年出栏 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("xmydncl") | |||
public class XmyDnclController { | |||
@Resource | |||
private XmyDnclService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(XmyDncl z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.XmyNmcl; | |||
import com.lion.service.XmyNmclService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 年末存栏 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("xmynmcl") | |||
public class XmyNmclController { | |||
@Resource | |||
private XmyNmclService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(XmyNmcl z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.XmySl; | |||
import com.lion.service.XmySlService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 饲料 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("xmysl") | |||
public class XmySlController { | |||
@Resource | |||
private XmySlService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(XmySl z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.YyScjg; | |||
import com.lion.service.YyScjgService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 水产加工 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("yyscjg") | |||
public class YyScjgController { | |||
@Resource | |||
private YyScjgService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(YyScjg z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.YyUser; | |||
import com.lion.service.YyUserService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 渔业从业人员 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("yyuser") | |||
public class YyUserController { | |||
@Resource | |||
private YyUserService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(YyUser z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,104 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:YyzbHsyzblController.java | |||
* 创建日期:2021年10月26日 下午4:18:54 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.YyzbYzbl; | |||
import com.lion.service.YyzbDsyzblService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 渔业统计指标-淡水养殖与捕捞 controller | |||
* @author mt.W | |||
* @since 2021年10月26日 | |||
*/ | |||
@RestController | |||
@RequestMapping("dsyzbl") | |||
public class YyzbDsyzblController { | |||
@Autowired | |||
private YyzbDsyzblService service; | |||
/** | |||
* | |||
* 方法描述 查询记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param rows | |||
* @param page | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getRecordList.service") | |||
public Map<String,Object> getRecordList(HttpServletRequest req,String rows,String page,String year){ | |||
return service.getRecordList(rows, page, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 保存记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param n | |||
* @return | |||
*/ | |||
@RequestMapping("saveRecord.service") | |||
public Map<String,Object> saveRecord(HttpServletRequest req,YyzbYzbl n){ | |||
return service.saveRecord(n, TokenUtil.getUserInfo(req).getUserId(), TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("deleteRecord.service") | |||
public Map<String,Object> deleteRecord(String id){ | |||
return service.deleteRecord(id); | |||
} | |||
/** | |||
* | |||
* 方法描述 导出记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("exprotRecord.service") | |||
public Map<String,Object> exprotRecord(HttpServletRequest req,String year){ | |||
return service.exprotRecord(req, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 导入记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,104 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:YyzbHsyzblController.java | |||
* 创建日期:2021年10月26日 下午4:18:54 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.YyzbYzbl; | |||
import com.lion.service.YyzbHsyzblService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 渔业统计指标-海水养殖与捕捞 controller | |||
* @author mt.W | |||
* @since 2021年10月26日 | |||
*/ | |||
@RestController | |||
@RequestMapping("hsyzbl") | |||
public class YyzbHsyzblController { | |||
@Autowired | |||
private YyzbHsyzblService service; | |||
/** | |||
* | |||
* 方法描述 查询记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param rows | |||
* @param page | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getRecordList.service") | |||
public Map<String,Object> getRecordList(HttpServletRequest req,String rows,String page,String year){ | |||
return service.getRecordList(rows, page, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 保存农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param n | |||
* @return | |||
*/ | |||
@RequestMapping("saveRecord.service") | |||
public Map<String,Object> saveRecord(HttpServletRequest req,YyzbYzbl n){ | |||
return service.saveRecord(n, TokenUtil.getUserInfo(req).getUserId(), TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("deleteRecord.service") | |||
public Map<String,Object> deleteRecord(String id){ | |||
return service.deleteRecord(id); | |||
} | |||
/** | |||
* | |||
* 方法描述 导出记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("exprotRecord.service") | |||
public Map<String,Object> exprotRecord(HttpServletRequest req,String year){ | |||
return service.exprotRecord(req, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 导入记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.ZzyGdmj; | |||
import com.lion.service.ZzyGdmjService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 耕地面积 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("zzygdmj") | |||
public class ZzyGdmjController { | |||
@Resource | |||
private ZzyGdmjService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(ZzyGdmj z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,104 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:ZzyJjzwController.java | |||
* 创建日期:2021年10月26日 下午3:02:03 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.ZzyJjzw; | |||
import com.lion.service.ZzyJjzwService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 种植业指标-主要经济作物 | |||
* @author mt.W | |||
* @since 2021年10月26日 | |||
*/ | |||
@RestController | |||
@RequestMapping("jjzw") | |||
public class ZzyJjzwController { | |||
@Autowired | |||
private ZzyJjzwService service; | |||
/** | |||
* | |||
* 方法描述 查询记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param rows | |||
* @param page | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getRecordList.service") | |||
public Map<String,Object> getRecordList(HttpServletRequest req,String rows,String page,String year){ | |||
return service.getRecordList(rows, page, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 保存农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param n | |||
* @return | |||
*/ | |||
@RequestMapping("saveRecord.service") | |||
public Map<String,Object> saveRecord(HttpServletRequest req,ZzyJjzw n){ | |||
return service.saveRecord(n, TokenUtil.getUserInfo(req).getUserId(), TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("deleteRecord.service") | |||
public Map<String,Object> deleteRecord(String id){ | |||
return service.deleteRecord(id); | |||
} | |||
/** | |||
* | |||
* 方法描述 导出记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("exprotRecord.service") | |||
public Map<String,Object> exprotRecord(HttpServletRequest req,String year){ | |||
return service.exprotRecord(req, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 导入记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,104 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:ZzyLszwController.java | |||
* 创建日期:2021年10月26日 上午10:15:06 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.ZzyLszw; | |||
import com.lion.service.ZzyLszwService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 种植业指标-粮食作物统计 controller | |||
* @author mt.W | |||
* @since 2021年10月26日 | |||
*/ | |||
@RestController | |||
@RequestMapping("lszw") | |||
public class ZzyLszwController { | |||
@Autowired | |||
private ZzyLszwService service; | |||
/** | |||
* | |||
* 方法描述 查询记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param rows | |||
* @param page | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getRecordList.service") | |||
public Map<String,Object> getRecordList(HttpServletRequest req,String rows,String page,String year){ | |||
return service.getRecordList(rows, page, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 保存农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param n | |||
* @return | |||
*/ | |||
@RequestMapping("saveRecord.service") | |||
public Map<String,Object> saveRecord(HttpServletRequest req,ZzyLszw n){ | |||
return service.saveRecord(n, TokenUtil.getUserInfo(req).getUserId(), TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("deleteRecord.service") | |||
public Map<String,Object> deleteRecord(String id){ | |||
return service.deleteRecord(id); | |||
} | |||
/** | |||
* | |||
* 方法描述 导出记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("exprotRecord.service") | |||
public Map<String,Object> exprotRecord(HttpServletRequest req,String year){ | |||
return service.exprotRecord(req, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 导入记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.ZzyNcpzy; | |||
import com.lion.service.ZzyNcpzyService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 作物灾害 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("zzyncpzy") | |||
public class ZzyNcpzyController { | |||
@Resource | |||
private ZzyNcpzyService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(ZzyNcpzy z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,104 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:ZzySclController.java | |||
* 创建日期:2021年10月26日 下午2:20:10 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.ZzyScl; | |||
import com.lion.service.ZzySclService; | |||
import com.lion.util.TokenUtil; | |||
/** | |||
* 类描述 种植业指标-蔬菜类统计 controller | |||
* @author mt.W | |||
* @since 2021年10月26日 | |||
*/ | |||
@RestController | |||
@RequestMapping("scl") | |||
public class ZzySclController { | |||
@Autowired | |||
private ZzySclService service; | |||
/** | |||
* | |||
* 方法描述 查询记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param rows | |||
* @param page | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getRecordList.service") | |||
public Map<String,Object> getRecordList(HttpServletRequest req,String rows,String page,String year){ | |||
return service.getRecordList(rows, page, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 保存农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param n | |||
* @return | |||
*/ | |||
@RequestMapping("saveRecord.service") | |||
public Map<String,Object> saveRecord(HttpServletRequest req,ZzyScl n){ | |||
return service.saveRecord(n, TokenUtil.getUserInfo(req).getUserId(), TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("deleteRecord.service") | |||
public Map<String,Object> deleteRecord(String id){ | |||
return service.deleteRecord(id); | |||
} | |||
/** | |||
* | |||
* 方法描述 导出记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("exprotRecord.service") | |||
public Map<String,Object> exprotRecord(HttpServletRequest req,String year){ | |||
return service.exprotRecord(req, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 导入记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,141 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:ZzySgController.java | |||
* 创建日期:2021年10月28日 上午11:15:46 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.controller; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.RequestBody; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.ZzySg; | |||
import com.lion.service.ZzySgService; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
*/ | |||
@RestController | |||
@RequestMapping("sg") | |||
public class ZzySgController { | |||
@Autowired | |||
private ZzySgService service; | |||
/** | |||
* | |||
* 方法描述 查询记录 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param req | |||
* @param rows | |||
* @param page | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getRecordList.service") | |||
public Map<String, Object> getRecordList(HttpServletRequest req,String rows,String page,String year,String orgid){ | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid = TokenUtil.getUserInfo(req).getOrgid(); | |||
} | |||
return service.getRecordList(rows, page, year,orgid ); | |||
} | |||
/** | |||
* | |||
* 方法描述 保存记录 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param req | |||
* @param n | |||
* @return | |||
*/ | |||
@RequestMapping("saveRecord.service") | |||
public Map<String,Object> saveRecord(HttpServletRequest req,ZzySg n){ | |||
return service.saveRecord(n, TokenUtil.getUserInfo(req).getUserId(), TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除记录 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param id | |||
* @return | |||
*/ | |||
@RequestMapping("deleteRecord.service") | |||
public Map<String,Object> deleteRecord(String id){ | |||
return service.deleteRecord(id); | |||
} | |||
/** | |||
* | |||
* 方法描述 导出记录 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("exprotRecord.service") | |||
public Map<String,Object> exprotRecord(HttpServletRequest req,String year){ | |||
return service.exprotRecord(req, year, TokenUtil.getUserInfo(req).getOrgid()); | |||
} | |||
/** | |||
* | |||
* 方法描述 导入记录 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
/** | |||
* | |||
* 方法描述 | |||
* @author mt.W | |||
* @since 2021年10月30日 | |||
* @param req | |||
* @param dataJson | |||
* @return | |||
*/ | |||
@RequestMapping("saveAddSgInfo.service") | |||
public Map<String,Object> saveAddSgInfo(HttpServletRequest req,@RequestBody List<ZzySg> dataJson){ | |||
return service.saveAddSgInfo(dataJson, TokenUtil.getUserInfo(req).getOrgid(), TokenUtil.getUserInfo(req).getUserId()); | |||
} | |||
/** | |||
* | |||
* 方法描述 获取合计 | |||
* @author mt.W | |||
* @since 2021年11月5日 | |||
* @param req | |||
* @param year | |||
* @return | |||
*/ | |||
@RequestMapping("getSumHj.service") | |||
public Map<String,Object> getSumHj(HttpServletRequest req,String year,String orgid){ | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid = TokenUtil.getUserInfo(req).getOrgid(); | |||
} | |||
return service.getSumHj(orgid, year); | |||
} | |||
} |
@@ -0,0 +1,116 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczController.java | |||
* 创建日期:2021年10月21日 上午9:18:24 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.controller; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import javax.servlet.http.HttpServletRequest; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RequestParam; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import org.springframework.web.multipart.MultipartFile; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.entity.ZzyZwzh; | |||
import com.lion.service.ZzyZwzhService; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.TokenUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 作物灾害 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@RestController | |||
@RequestMapping("zzyzwzh") | |||
public class ZzyZwzhController { | |||
@Resource | |||
private ZzyZwzhService service; | |||
/** | |||
* 方法描述 新增或修改某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("addOrUpdate.service") | |||
public Map<String,Object> add(ZzyZwzh z,HttpServletRequest req){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
z.setUpdateTime(TimeUtil.getNowTime()); | |||
z.setUpdateUser(user.getUserId()); | |||
}else{ | |||
z.setCreateUser(user.getUserId()); | |||
z.setCreateTime(TimeUtil.getNowTime()); | |||
} | |||
z.setOrgid(user.getOrgid()); | |||
return service.addOrUpdate(z); | |||
} | |||
/** | |||
* 方法描述 删除某条数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("delete.service") | |||
public Map<String,Object> delete(int id,HttpServletRequest req){ | |||
return service.delete(id); | |||
} | |||
/** | |||
* 方法描述 查询数据列表 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("getList.service") | |||
public Map<String,Object> getList(String year,String orgid,HttpServletRequest req,int page,int rows){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.getList(year, orgid,page,rows); | |||
} | |||
/** | |||
* 方法描述 导出 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @return | |||
*/ | |||
@RequestMapping("exportData.service") | |||
public Map<String,Object> exportData(HttpServletRequest req,String year,String orgid){ | |||
LoginUserInfo user=TokenUtil.getUserInfo(req); | |||
if(StringUtil.isEmpty(orgid)){ | |||
orgid=user.getOrgid(); | |||
} | |||
return service.exportData(year, orgid, req); | |||
} | |||
/** | |||
* 方法描述 导入数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param req | |||
* @param file | |||
* @return | |||
*/ | |||
@RequestMapping("importData.service") | |||
public Map<String,Object> importData(HttpServletRequest req,@RequestParam("fileElement") MultipartFile file){ | |||
LoginUserInfo user = TokenUtil.getUserInfo(req); | |||
return service.importData(file, user); | |||
} | |||
} |
@@ -0,0 +1,82 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧软件有限公司 | |||
* 工程名:SpringMVCLion | |||
* 文件名:AuthorityDao.java | |||
* 创建日期:2019年3月5日 上午8:33:39 | |||
* 作者:cpf | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
/** | |||
* 类描述 权限 | |||
* @author cpf | |||
* @since 2019年3月5日 | |||
*/ | |||
@Repository | |||
public class AuthorityDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* 方法描述 查询角色表 | |||
* @author cpf | |||
* @since 2019年3月5日 | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getAuthority( ){ | |||
String sql="select * from role where id!=0"; | |||
return jdbc.queryForList(sql); | |||
} | |||
/** | |||
* 方法描述 查询子节点的菜单 | |||
* @author cpf | |||
* @since 2019年3月5日 | |||
* @param resourceId | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getChildResources(String resourceId){ | |||
String sql="select id,name text,level from resources where pid = ? "; | |||
return jdbc.queryForList(sql,new Object[]{resourceId}); | |||
} | |||
/** | |||
* 方法描述 添加权限 | |||
* @author cpf | |||
* @since 2019年3月5日 | |||
* @param roleid | |||
* @param resourceid | |||
* @return | |||
*/ | |||
public int addRole_resource(String roleid,String resourceid){ | |||
String sql="insert into role_resources(roleid,resourceid) values(?,?)"; | |||
return jdbc.update(sql,new Object[]{roleid,resourceid}); | |||
} | |||
/** | |||
* 方法描述 删除权限 | |||
* @author cpf | |||
* @since 2019年3月5日 | |||
* @param roleid | |||
* @return | |||
*/ | |||
public int deleteRole_resource(String roleid){ | |||
String sql="delete from role_resources where roleid=?"; | |||
return jdbc.update(sql,new Object[]{roleid}); | |||
} | |||
/** | |||
* 方法描述 点击按钮 回显权限 | |||
* @author cpf | |||
* @since 2019年3月5日 | |||
* @param roleid | |||
* @param resourceid | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getAuth(int id){//,int resourceid | |||
String sql="select resourceid from role_resources r where r.roleid = ?"; | |||
return jdbc.queryForList(sql,new Object[]{id}); | |||
} | |||
} |
@@ -0,0 +1,84 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧有限公司 | |||
* 工程名:nmgjw | |||
* 文件名:CommentDao.java | |||
* 创建日期:2019年12月25日 下午2:02:44 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.util.Util; | |||
/** | |||
* 类描述 共用方法 Dao层 | |||
* @author mt.W | |||
* @since 2019年12月25日 | |||
*/ | |||
@Repository | |||
public class CommentDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* | |||
* 方法描述 回显附件查询 | |||
* @author mt.W | |||
* @since 2019年12月26日 | |||
* @param tableName 表名 | |||
* @param colName 列名 | |||
* @param relevancy_id 关联id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getFileToShow(String tableName ,String colName,String relevancy_id,String deletepath){ | |||
String sql ="select id 'key',filepath,fileoldname as 'caption' ,ifnull(pdfpath,'') pdf,'80px' as width,concat(?,id,'&url=',filepath,'&tableName=',?) as url from ? where ? =? order by filepath asc"; | |||
return jdbc.queryForList(sql,new Object[]{deletepath,tableName,tableName,colName,relevancy_id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除附件 | |||
* @author mt.W | |||
* @since 2019年12月26日 | |||
* @param tableName 表名 | |||
* @param id 附件记录id | |||
* @return | |||
*/ | |||
public int deleteFiles(String tableName ,String id){ | |||
String sql = "delete from ? where id = ? "; | |||
return jdbc.update(sql,new Object[]{tableName,id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 保存上传附件 | |||
* @author mt.W | |||
* @since 2020年3月20日 | |||
* @param tableName | |||
* @param rowId | |||
* @param fileName | |||
* @param filePath | |||
* @param pdfPath | |||
* @return | |||
*/ | |||
public int saveUploadFile(String tableName,String rowId,String fileName,String filePath,String pdfPath){ | |||
String sql = "insert into ? values(?,?,?,?,?)"; | |||
return jdbc.update(sql,new Object[]{tableName,Util.getUUID(),rowId,fileName,filePath,pdfPath}); | |||
} | |||
/** | |||
* | |||
* 方法描述 获取年度 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param tableName | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> loadYears(String tableName){ | |||
String sql = "select DISTINCT year from "+tableName+" order by year desc "; | |||
return jdbc.queryForList(sql); | |||
} | |||
} |
@@ -0,0 +1,133 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:FruitDao.java | |||
* 创建日期:2021年10月28日 上午8:54:07 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.Fruit; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 种植业指标-水果类别 Dao | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
*/ | |||
@Repository | |||
public class FruitDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* | |||
* 方法描述 查询类别列表 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param start | |||
* @param limit | |||
* @param name | |||
* @return | |||
*/ | |||
public List<Map<String, Object>> getTypeList(int start,int limit,String name){ | |||
String sql = "select * from zzy_jcsg "; | |||
if(StringUtil.isNotEmpty(name)){ | |||
sql += " where name like '%"+name+"%' "; | |||
} | |||
sql += " order by createTime desc limit ?,? "; | |||
return jdbc.queryForList(sql,new Object[]{start,limit}); | |||
} | |||
public List<Map<String,Object>> getTypeList(){ | |||
String sql = "select id,name from zzy_jcsg "; | |||
return jdbc.queryForList(sql); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询类别数量 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param name | |||
* @return | |||
*/ | |||
public int getTypeCount(String name){ | |||
String sql = "select count(id) from zzy_jcsg "; | |||
if(StringUtil.isNotEmpty(name)){ | |||
sql += " where name like '%"+name+"%' "; | |||
} | |||
return jdbc.queryForObject(sql, Integer.class); | |||
} | |||
/** | |||
* | |||
* 方法描述 新增类别 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param f | |||
* @return | |||
*/ | |||
public int addType(Fruit f){ | |||
String sql = "insert into zzy_jcsg(name,createTime,createUser) values(?,?,?)"; | |||
return jdbc.update(sql,new Object[]{f.getName(),f.getCreateTime(),f.getCreateUser()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 修改类别 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param f | |||
* @return | |||
*/ | |||
public int editType(Fruit f){ | |||
String sql = "update zzy_jcsg set name =?,updateTime=?,updateUser=? where id = ?"; | |||
return jdbc.update(sql,new Object[]{f.getName(),f.getUpdateTime(),f.getUpdateUser(),f.getId()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除类别 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param id | |||
* @return | |||
*/ | |||
public int deleteType(String id){ | |||
String sql = "delete from zzy_jcsg where id = ? "; | |||
return jdbc.update(sql,new Object[]{id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询类别是否已存在 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param name | |||
* @param id | |||
* @return | |||
*/ | |||
public int getCheckType(String name,String id){ | |||
String sql = "select count(id) from zzy_jcsg where name = ? "; | |||
if(StringUtil.isNotEmpty(id)){ | |||
sql += " and id != '"+id+"' "; | |||
} | |||
return jdbc.queryForObject(sql, new Object[]{name},Integer.class); | |||
} | |||
/** | |||
* | |||
* 方法描述 查看水果类别是否已存入数据 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
* @param id | |||
* @return | |||
*/ | |||
public int checkUseType(String id){ | |||
String sql = "select count(id) from zzy_sg where typeId = ? "; | |||
return jdbc.queryForObject(sql,new Object[]{id}, Integer.class); | |||
} | |||
} |
@@ -0,0 +1,53 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:HomeDao.java | |||
* 创建日期:2021年10月28日 下午3:45:49 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
/** | |||
* 类描述 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月28日 | |||
*/ | |||
@Repository | |||
public class HomeDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
/** | |||
* 方法描述 获取各个表的完成数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月29日 | |||
* @param year 年度 | |||
* @param orgid 当前登录人员的部门id | |||
* @param tableName 表名称 | |||
* @return | |||
*/ | |||
public int getWcCount(String year,String orgid,String tableName){ | |||
String sql="select count(z.id) from "+tableName+" z inner join orgdept o on z.orgid=o.id where z.year=? and z.orgid like ?"; | |||
return jdbc.queryForObject(sql,new Object[]{year,orgid+"%"},Integer.class); | |||
} | |||
/** | |||
* 方法描述 获取各个表完成的单位名称 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月29日 | |||
* @param year | |||
* @param orgid | |||
* @param tableName | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getWcInfo(String year,String orgid,String tableName){ | |||
String sql="select distinct(z.orgid) orgid,o.name name from "+tableName+" z inner join orgdept o on z.orgid=o.id where z.year=? and z.orgid like ?"; | |||
return jdbc.queryForList(sql,year,orgid+"%"); | |||
} | |||
} |
@@ -0,0 +1,136 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:InoutDao.java | |||
* 创建日期:2021年10月21日 上午9:12:44 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.Inout; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农村居民收入与支出Dao层 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class InoutDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* | |||
* 方法描述 保存年度居民平均收入与支出信息 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param t | |||
* @return | |||
*/ | |||
public int addInoutInfo(Inout t){ | |||
String sql = "insert into ncjj_inout(orgid,year,sy,zc,createTime,createUser) values(?,?,?,?,?,?)"; | |||
return jdbc.update(sql,new Object[]{t.getOrgid(),t.getYear(),t.getSy(),t.getZc(),t.getCreateTime(),t.getCreateUser()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 修改年度居民平均收入与支出信息 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param t | |||
* @return | |||
*/ | |||
public int editInoutInfo(Inout t){ | |||
String sql = "update ncjj_inout set year = ? ,sy=?,zc=?,updateTime=?,updateUser=? where id = ? "; | |||
return jdbc.update(sql,new Object[]{t.getYear(),t.getSy(),t.getZc(),t.getUpdateTime(),t.getUpdateUser(),t.getId()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param start | |||
* @param limit | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getInoutRecordList(int start,int limit,String year,String orgid){ | |||
String sql = "select n.*,o.name orgname from ncjj_inout n left join orgdept o on o.id = n.orgid where orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and year = '"+year+"' "; | |||
} | |||
sql += " order by year desc limit ?,? "; | |||
return jdbc.queryForList(sql,new Object[]{start,limit}); | |||
} | |||
/** | |||
* | |||
* 方法描述 | |||
* @author mt.W | |||
* @since 2021年10月22日 | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getInoutRecordList(String year,String orgid){ | |||
String sql = "select t.*,o.name orgname from ncjj_inout t " | |||
+ " left join orgdept o on o.id = t.orgid " | |||
+ " where t.orgid like '"+orgid+"%'"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and t.year = '"+year+"' "; | |||
} | |||
return jdbc.queryForList(sql); | |||
} | |||
/** | |||
* | |||
* 方法描述 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public int getInoutRecordCount(String year,String orgid){ | |||
String sql = "select count(id) from ncjj_inout where orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and year = '"+year+"' "; | |||
} | |||
return jdbc.queryForObject(sql, Integer.class); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除居民收入和支出信息 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @return | |||
*/ | |||
public int deleteInoutRecord(String id){ | |||
String sql = "delete from ncjj_inout where id = ? "; | |||
return jdbc.update(sql,new Object[]{id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 检查年份是否已存在 | |||
* @author mt.W | |||
* @since 2021年10月22日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(Inout z){ | |||
String sql="select count(id) from ncjj_inout where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
} |
@@ -0,0 +1,141 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:JinChuKouDao.java | |||
* 创建日期:2021年10月21日 下午3:07:54 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.JinChuKou; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class JinChuKouDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* | |||
* 方法描述 查询进出口信息记录 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param start | |||
* @param limit | |||
* @param orgid | |||
* @param year | |||
* @return | |||
*/ | |||
public List<Map<String, Object>> getJinChuKouRecordList(int start,int limit,String year,String orgid){ | |||
String sql = "select j.*,o.name orgname from ncjj_jck j left join orgdept o on o.id = j.orgid where j.orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and j.year = '"+year+"' "; | |||
} | |||
sql += " order by j.year desc limit ?,? "; | |||
return jdbc.queryForList(sql,new Object[]{start,limit}); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询进出口信息记录 | |||
* @author mt.W | |||
* @since 2021年10月22日 | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getJinChuKouRecordList(String year,String orgid){ | |||
String sql = "select k.*,o.name orgname from ncjj_jck k " | |||
+ " left join orgdept o on o.id = k.orgid where k.orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and year = '"+year+"' "; | |||
} | |||
return jdbc.queryForList(sql); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询进出口记录数 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param orgid | |||
* @param year | |||
* @return | |||
*/ | |||
public int getJinChuKouRecordCount(String year,String orgid){ | |||
String sql = "select count(id) from ncjj_jck where orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and year = '"+year+"' "; | |||
} | |||
return jdbc.queryForObject(sql,Integer.class); | |||
} | |||
/** | |||
* | |||
* 方法描述 新增进出口贸易信息 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param j | |||
* @return | |||
*/ | |||
public int addJinChuKouInfo(JinChuKou j){ | |||
String sql = "insert into ncjj_jck(orgid,year,dwcp_in,dwcp_out,zwcp_in,zwcp_out,yzjl_in,yzjl_out,yczp_int,yczp_out," | |||
+ "qt_in,qt_out,inzj,outzj,inoutzj,createTime,createUser)" | |||
+ " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,new Object[]{j.getOrgid(),j.getYear(),j.getDwcp_in(),j.getDwcp_out(),j.getZwcp_in(),j.getZwcp_out(), | |||
j.getYzjl_in(),j.getYzjl_out(),j.getYczp_int(),j.getYczp_out(),j.getQt_in(),j.getQt_out(), | |||
j.getInzj(),j.getOutzj(),j.getInoutzj(),j.getCreateTime(),j.getCreateUser()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 修改进出口贸易信息 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param j | |||
* @return | |||
*/ | |||
public int editJinChuKouInfo(JinChuKou j){ | |||
String sql = "update ncjj_jck set dwcp_in=?,dwcp_out=?,zwcp_in=?,zwcp_out=?,yzjl_in=?,yzjl_out=?,yczp_int=?,yczp_out=?," | |||
+ "qt_in=?,qt_out=?,inzj=?,inoutzj=?,updateTime=?,updateUser=?,outzj=? where id = ? "; | |||
return jdbc.update(sql,new Object[]{j.getDwcp_in(),j.getDwcp_out(),j.getZwcp_in(),j.getZwcp_out(),j.getYzjl_in(),j.getYzjl_out(),j.getYczp_int(),j.getYczp_out(), | |||
j.getQt_in(),j.getQt_out(),j.getInzj(),j.getInoutzj(),j.getUpdateTime(),j.getUpdateUser(),j.getOutzj(),j.getId()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除进出口贸易信息 | |||
* @author mt.W | |||
* @since 2021年10月21日 | |||
* @param id | |||
* @return | |||
*/ | |||
public int deleteJinChuKouInfo(String id){ | |||
String sql = "delete from ncjj_jck where id = ? "; | |||
return jdbc.update(sql,new Object[]{id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 检查年份是否已存在 | |||
* @author mt.W | |||
* @since 2021年10月22日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(JinChuKou z){ | |||
String sql="select count(id) from ncjj_jck where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
} |
@@ -0,0 +1,137 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧软件有限公司 | |||
* 工程名:SpringMvcLion | |||
* 文件名:LogDao.java | |||
* 创建日期:2019年3月1日 上午8:36:26 | |||
* 作者:dlm | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.BeanPropertyRowMapper; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.LoginUserInfo; | |||
import com.lion.util.TimeUtil; | |||
import com.lion.util.Util; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 | |||
* @author dlm | |||
* @since 2019年3月1日 | |||
*/ | |||
@Repository | |||
public class LogDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* 方法描述 保存日志 | |||
* @author dlm | |||
* @since 2019年3月1日 | |||
* @param content 操作描述 | |||
* @param type 类型 | |||
* @param userid 用户id | |||
*/ | |||
public void saveLog(String content,String type,String userid){ | |||
String sql="insert into sys_log(uuid,content,type,addtime,userid) values (?,?,?,?,?)"; | |||
jdbc.update(sql,new Object[]{Util.getUUID(),content,type,TimeUtil.getNowTime(),userid}); | |||
} | |||
public void saveLogs(String content,String type,String userid,String tablename,String dataid){ | |||
String sql="insert into sys_log(uuid,content,type,addtime,userid,tablename,dataid) values (?,?,?,?,?,?,?)"; | |||
jdbc.update(sql,new Object[]{Util.getUUID(),content,type,TimeUtil.getNowTime(),userid,tablename,dataid}); | |||
} | |||
public void saveLogInfo(String content,String type,String userid,String tablename,String dataid,String stutas){ | |||
String sql="insert into sys_log(uuid,content,type,addtime,userid,tablename,dataid,stutas) values (?,?,?,?,?,?,?,?)"; | |||
jdbc.update(sql,new Object[]{Util.getUUID(),content,type,TimeUtil.getNowTime(),userid,tablename,dataid,stutas}); | |||
} | |||
/** | |||
* 方法描述 查询日志记录 | |||
* @author dlm | |||
* @since 2019年3月2日 | |||
* @param start | |||
* @param limit | |||
* @param startTime 开始时间,预留 | |||
* @param endTime | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getLog(int start,int limit,String startTime,String endTime,String text){ | |||
StringBuffer sql= new StringBuffer("select s.uuid id,type,content,s.addtime,u.name username,stutas from sys_log s left join org_user u on s.userid=u.id where 1=1 "); | |||
if(StringUtil.isNotEmpty(startTime)){ | |||
sql.append(" and left(s.addtime,10)>='"+startTime+"'"); | |||
} | |||
if(StringUtil.isNotEmpty(endTime)){ | |||
sql.append(" and left(s.addtime,10)<='"+endTime+"'"); | |||
} | |||
if(StringUtil.isNotEmpty(text)){ | |||
sql.append(" and s.type like '%"+text+"%'"); | |||
} | |||
sql.append(" order by s.addtime desc limit ?,?"); | |||
return jdbc.queryForList(sql.toString(),new Object[]{start,limit}); | |||
} | |||
public int getLogCount(String startTime,String endTime,String text){ | |||
//String sql="select count(*) from sys_log where 1=1"; | |||
StringBuffer sql = new StringBuffer("select count(*) from sys_log where 1=1"); | |||
if(StringUtil.isNotEmpty(startTime)){ | |||
sql.append(" and left(addtime,10)>='"+startTime+"'"); | |||
} | |||
if(StringUtil.isNotEmpty(endTime)){ | |||
sql.append(" and left(addtime,10)<='"+endTime+"'"); | |||
} | |||
if(StringUtil.isNotEmpty(text)){ | |||
sql.append(" and type like '%"+text+"%'"); | |||
} | |||
return jdbc.queryForObject(sql.toString(), Integer.class); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询系统用户访问量 | |||
* @author mt.W | |||
* @since 2020年1月11日 | |||
* @param flag 查询标记,1:查当天的 2,查询所有的 | |||
* @return | |||
*/ | |||
public int getVisitCount(String flag){ | |||
StringBuffer sql = new StringBuffer("select count(s.userid) from sys_log s inner join org_user u on u.id = s.userid where u.roleid != '0' and s.type = '登录' "); | |||
if(flag.equals("1")){ | |||
sql.append(" and left(s.addtime,10) = '"+TimeUtil.getNowTime().substring(0,10)+"' "); | |||
} | |||
return jdbc.queryForObject(sql.toString(), Integer.class); | |||
} | |||
public List<Map<String,Object>> getTotalVisitorList(int num){ | |||
StringBuffer sql = new StringBuffer( "select u.username,o.name orgname,s.addtime from sys_log s " | |||
+ " inner join org_user u on u.id = s.userid " | |||
+ " left join orgdept o on o.id = u.orgid " | |||
+ " where u.roleid != '0' and s.type = '登录' and left(s.addtime,10)=? " | |||
+ " order by s.addtime desc "); | |||
if(num==0){ | |||
sql.append( " limit 2 "); | |||
} | |||
return jdbc.queryForList(sql.toString(),new Object[]{TimeUtil.getNowTime().substring(0, 10)}); | |||
} | |||
public List<Map<String,Object>> getVisitorInfo(){ | |||
String sql = "select u.username,o.name orgname,count(s.uuid) visitcount from sys_log s " | |||
+ " inner join org_user u on u.id = s.userid " | |||
+ " left join orgdept o on o.id = u.orgid " | |||
+ " where u.roleid != '0' and s.type = '登录' " | |||
+ " group by s.userid "; | |||
return jdbc.queryForList(sql); | |||
} | |||
public int saveLoginInfo(String userId,String cookie){ | |||
return jdbc.update("insert into sys_login (cookie,userid,logintime) values (?,?,?)",new Object[]{cookie,userId,TimeUtil.getNowTimeSSS()}); | |||
} | |||
public LoginUserInfo getUserById(String id){ | |||
String sql="select name,phone,roleid,orgid from org_user where id=?"; | |||
return jdbc.queryForObject(sql, new Object[]{id},new BeanPropertyRowMapper<LoginUserInfo>(LoginUserInfo.class)); | |||
} | |||
} |
@@ -0,0 +1,127 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧软件有限公司 | |||
* 工程名:SpringMvcLion | |||
* 文件名:LoginDao.java | |||
* 创建日期:2019年2月26日 下午2:33:52 | |||
* 作者:dlm | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.util.AuthorizeCheck; | |||
import com.lion.util.TimeUtil; | |||
/** | |||
* 类描述 | |||
* @author dlm | |||
* @since 2019年2月26日 | |||
*/ | |||
@Repository | |||
public class LoginDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* 方法描述 根据角色id获取资源 | |||
* @author dlm | |||
* @since 2019年2月27日 | |||
* @param roleId | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getResourcesByRoleId(String roleId){ | |||
StringBuffer sql = new StringBuffer("select id,name text,level,ifnull(url,'') url,icon,pid,ordnum,ifnull(bz,'') bz,openType from resources r"); | |||
if(!roleId.equals("0")){//超级管理员 | |||
sql.append(" inner join role_resources rr on r.id=rr.resourceid where rr.roleid="+roleId); | |||
} | |||
sql.append(" order by r.level,r.ordnum "); | |||
return jdbc.queryForList(sql.toString()); | |||
} | |||
public List<Map<String,Object>> getResourcesByRoleId(String roleId,int level){ | |||
StringBuffer sql = new StringBuffer("select id,name text,level,ifnull(url,'') url,icon,pid,ordnum,ifnull(bz,'') bz,openType from resources r"); | |||
if(!roleId.equals("0")){//超级管理员 | |||
sql.append(" inner join role_resources rr on r.id=rr.resourceid where rr.roleid="+roleId); | |||
} | |||
sql.append(" order by r.ordnum "); | |||
return jdbc.queryForList(sql.toString()); | |||
} | |||
public List<Map<String,Object>> getResourcesByRoleId(){ | |||
StringBuffer sql = new StringBuffer("select id,name text,level,ifnull(url,'') url,icon,pid,ordnum,ifnull(bz,'') bz,openType from resources r where r.level !='2' "); | |||
sql.append(" order by r.ordnum "); | |||
return jdbc.queryForList(sql.toString()); | |||
} | |||
/** | |||
* | |||
* 方法描述 通过菜单id以及角色id查询菜单 | |||
* @author mt.W | |||
* @since 2020年1月10日 | |||
* @param roleId | |||
* @param id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getResourcesByResorceId(String roleId,String id){ | |||
StringBuffer sql = new StringBuffer("select id,name text,level,ifnull(url,'') url,icon,pid,ordnum,openType from resources r "); | |||
if(roleId.equals("0")){//超级管理员 | |||
sql.append(" where r.id='"+id+"'"); | |||
}else{ | |||
sql.append(" inner join role_resources rr on r.id=rr.resourceid where r.id='"+id+"' and rr.roleid="+roleId); | |||
} | |||
sql.append(" order by r.ordnum "); | |||
return jdbc.queryForList(sql.toString()); | |||
} | |||
/** | |||
* 方法描述 获取子级资源:资源少可以这样查询,数据量大时需要一次查出,然后从缓存中便利查找 | |||
* @author dlm | |||
* @since 2019年2月27日 | |||
* @param resourceId | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getChildResources(String resourceId,String roleId){ | |||
StringBuffer sql = new StringBuffer("select id,name text,level,ifnull(url,'') url,icon,pid,ordnum,ifnull(bz,'') bz,openType from resources r"); | |||
StringBuffer content = new StringBuffer(" where r.pid="+resourceId); | |||
if(!roleId.equals("0")){ | |||
sql.append(" inner join role_resources rr on r.id=rr.resourceid "); | |||
content.append(" and rr.roleid="+roleId); | |||
} | |||
content.append(" order by r.ordnum"); | |||
sql.append(content); | |||
return jdbc.queryForList(sql.toString()); | |||
} | |||
/** | |||
* | |||
* 方法描述 管理员密码修改 | |||
* @author mt.W | |||
* @since 2019年8月7日 | |||
* @param password | |||
* @param id | |||
* @return | |||
*/ | |||
public int updateManagerPassword(String password,String id){ | |||
StringBuffer sql = new StringBuffer("update org_user set pwd =? where id =?"); | |||
return jdbc.update(sql.toString(),new Object[]{AuthorizeCheck.encryptPassword(password),id}); | |||
} | |||
public void updateLoginStatus(String userId){ | |||
String sql="update sys_login set status='0' where userid=?"; | |||
jdbc.update(sql,new Object[]{userId}); | |||
} | |||
public void deleteLoginStatus(String userId){ | |||
String sql="delete from sys_login where userid=? and logintime < ?"; | |||
jdbc.update(sql,new Object[]{userId,TimeUtil.getNowTimeNYR()}); | |||
} | |||
public void deleteLoginStatusByCookie(String cookie){ | |||
String sql="delete from sys_login where cookie=? and logintime < ?"; | |||
jdbc.update(sql,new Object[]{cookie,TimeUtil.getNowTimeNYR()}); | |||
} | |||
public List<Map<String,Object>> checkLoginStatus(String Token){ | |||
String sql="select userid,logintime from sys_login where cookie=? "; | |||
return jdbc.queryForList(sql,new Object[]{Token}); | |||
} | |||
} |
@@ -0,0 +1,51 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:MainShowDao.java | |||
* 创建日期:2021年10月28日 下午4:27:23 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 | |||
* @author mt.W | |||
* @since 2021年10月28日 | |||
*/ | |||
@Repository | |||
public class MainShowDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
public List<Map<String, Object>> getItemOrgdeptRecord(String tableName,String year){ | |||
String sql = "select * from "+tableName + " where year = '"+year+"' "; | |||
return jdbc.queryForList(sql); | |||
} | |||
public List<Map<String,Object>> getItemOrgdeptSumItem(String tableName,String c){ | |||
String sql = "select year,sum("+c+") count from "+tableName +" group by year order by year limit 7 "; | |||
return jdbc.queryForList(sql); | |||
} | |||
public List<Map<String,Object>> getItemOrgdeptSumItem(String tableName,String c,String id){ | |||
String sql = "select year,sum("+c+") count from "+tableName; | |||
if(StringUtil.isNotEmpty(id)){ | |||
sql += " where typeId = '"+id+"' "; | |||
} | |||
sql += " group by year order by year limit 7 "; | |||
return jdbc.queryForList(sql); | |||
} | |||
public List<Map<String,Object>> getFruitRecord(String year){ | |||
String sql = "select * from zzy_sg where year = '"+year+"' "; | |||
return jdbc.queryForList(sql); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NcjjLhs; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 汇总村级经济联合社 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class NcjjLhsDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(NcjjLhs z){ | |||
String sql="insert into ncjj_lhs (orgid,year,lhs,createTime,createUser) values (?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getLhs() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(NcjjLhs z){ | |||
String sql="update ncjj_lhs set year=?,lhs=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getLhs(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from ncjj_lhs where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NcjjLhs z){ | |||
String sql="select count(id) from ncjj_lhs where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from ncjj_lhs z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from ncjj_lhs where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NcjjNhs; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 汇总农户数 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class NcjjNhsDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(NcjjNhs z){ | |||
String sql="insert into ncjj_nhs (orgid,year,nhs,rks,ldl,createTime,createUser) values (?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getNhs(),z.getRks(),z.getLdl() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(NcjjNhs z){ | |||
String sql="update ncjj_nhs set year=?,nhs=?,rks=?,ldl=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getNhs(),z.getRks(),z.getLdl(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from ncjj_nhs where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NcjjNhs z){ | |||
String sql="select count(id) from ncjj_nhs where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from ncjj_nhs z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from ncjj_nhs where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NcjjSy; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 集体经济收益 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class NcjjSyDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(NcjjSy z){ | |||
String sql="insert into ncjj_sy (orgid,year,sr,zc,fz,createTime,createUser) values (?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getSr(),z.getZc(),z.getFz() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(NcjjSy z){ | |||
String sql="update ncjj_sy set year=?,sr=?,zc=?,fz=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getSr(),z.getZc(),z.getFz(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from ncjj_sy where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NcjjSy z){ | |||
String sql="select count(id) from ncjj_sy where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from ncjj_sy z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from ncjj_sy where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NcjjXh; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农业总产值 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class NcjjXhDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(NcjjXh z){ | |||
String sql="insert into ncjj_xh (orgid,year,ny,ly,my,yy,zj,createTime,createUser) values (?,?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getNy(),z.getLy(),z.getMy(),z.getYy() | |||
,z.getZj(),z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(NcjjXh z){ | |||
String sql="update ncjj_xh set year=?,ny=?,ly=?,my=?,yy=?,zj=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getNy(),z.getLy(),z.getMy(),z.getYy(),z.getZj(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from ncjj_xh where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NcjjXh z){ | |||
String sql="select count(id) from ncjj_xh where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from ncjj_xh z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from ncjj_xh where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NcjjZcz; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农业总产值 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class NcjjZczDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(NcjjZcz z){ | |||
String sql="insert into ncjj_zcz (orgid,year,ny,ly,my,yy,zj,createTime,createUser) values (?,?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getNy(),z.getLy(),z.getMy(),z.getYy() | |||
,z.getZj(),z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(NcjjZcz z){ | |||
String sql="update ncjj_zcz set year=?,ny=?,ly=?,my=?,yy=?,zj=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getNy(),z.getLy(),z.getMy(),z.getYy(),z.getZj(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from ncjj_zcz where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NcjjZcz z){ | |||
String sql="select count(id) from ncjj_zcz where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from ncjj_zcz z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from ncjj_zcz where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NcjjZjz; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农业增加值 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class NcjjZjzDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(NcjjZjz z){ | |||
String sql="insert into ncjj_zjz (orgid,year,ny,ly,my,yy,zj,createTime,createUser) values (?,?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getNy(),z.getLy(),z.getMy(),z.getYy() | |||
,z.getZj(),z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(NcjjZjz z){ | |||
String sql="update ncjj_zjz set year=?,ny=?,ly=?,my=?,yy=?,zj=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getNy(),z.getLy(),z.getMy(),z.getYy(),z.getZj(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from ncjj_zjz where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NcjjZjz z){ | |||
String sql="select count(id) from ncjj_zjz where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from ncjj_zjz z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from ncjj_zjz where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NckjSfh; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 科普示范基地 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class NckjSfhDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(NckjSfh z){ | |||
String sql="insert into nckj_sfh (orgid,year,hs,createTime,createUser) values (?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getHs() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(NckjSfh z){ | |||
String sql="update nckj_sfh set year=?,hs=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getHs(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from nckj_sfh where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NckjSfh z){ | |||
String sql="select count(id) from nckj_sfh where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from nckj_sfh z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from nckj_sfh where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%",},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NckjSfjd; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 科普示范基地 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class NckjSfjdDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(NckjSfjd z){ | |||
String sql="insert into nckj_sfjd (orgid,year,jds,createTime,createUser) values (?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getJds() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(NckjSfjd z){ | |||
String sql="update nckj_sfjd set year=?,jds=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getJds(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from nckj_sfjd where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NckjSfjd z){ | |||
String sql="select count(id) from nckj_sfjd where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from nckj_sfjd z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from nckj_sfjd where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NckjSfq; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 科普示范基地 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class NckjSfqDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(NckjSfq z){ | |||
String sql="insert into nckj_sfq (orgid,year,qs,createTime,createUser) values (?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getQs() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(NckjSfq z){ | |||
String sql="update nckj_sfq set year=?,qs=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getQs(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from nckj_sfq where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NckjSfq z){ | |||
String sql="select count(id) from nckj_sfq where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from nckj_sfq z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from nckj_sfq where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NcjjZyjs; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 专业技术协会 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class NckjZyjsDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(NcjjZyjs z){ | |||
String sql="insert into nckj_zyjs (orgid,year,xhs,hys,zls,createTime,createUser) values (?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getXhs(),z.getHys(),z.getZls() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(NcjjZyjs z){ | |||
String sql="update nckj_zyjs set year=?,xhs=?,hys=?,zls=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getXhs(),z.getHys(),z.getZls(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from nckj_zyjs where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NcjjZyjs z){ | |||
String sql="select count(id) from nckj_zyjs where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from nckj_zyjs z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from nckj_zyjs where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NyzbUser; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农机社会化组织及人员 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class NyzbUserDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(NyzbUser z){ | |||
String sql="insert into nyzb_user (orgid,year,jgs,rs,hjgs,hrs,nmrs,createTime,createUser) values (?,?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getJgs(),z.getRs(),z.getHjgs(),z.getHrs(),z.getNmrs() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(NyzbUser z){ | |||
String sql="update nyzb_user set year=?,jgs=?,rs=?,hjgs=?,hrs=?,nmrs=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getJgs(),z.getRs(),z.getHjgs(),z.getHrs(),z.getNmrs(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from nyzb_user where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NyzbUser z){ | |||
String sql="select count(id) from nyzb_user where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from nyzb_user z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from nyzb_user where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,133 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:NyzbYdhxhDao.java | |||
* 创建日期:2021年10月25日 下午3:40:53 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NyzbYdhxh; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农业技术装备统计指标-用电与农业化学化Dao | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
*/ | |||
@Repository | |||
public class NyzbYdhxhDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* | |||
* 方法描述 查询记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param start | |||
* @param limit | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getRecordList(int start,int limit,String year,String orgid){ | |||
String sql = "select n.*,o.name orgname from nyzb_ydhxh n left join orgdept o on o.id = n.orgid where orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and n.year = '"+year+"' "; | |||
} | |||
sql += " order by year desc limit ?,? "; | |||
return jdbc.queryForList(sql,new Object[]{start,limit}); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getRecordList(String year,String orgid){ | |||
String sql = "select n.*,o.name orgname from nyzb_ydhxh n left join orgdept o on o.id = n.orgid where orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and n.year = '"+year+"' "; | |||
} | |||
return jdbc.queryForList(sql); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询记录数 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public int getRecordCount(String year,String orgid){ | |||
String sql = "select count(id) from nyzb_ydhxh where orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and year = '"+year+"' "; | |||
} | |||
return jdbc.queryForObject(sql, Integer.class); | |||
} | |||
/** | |||
* | |||
* 方法描述 新增记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param n | |||
* @return | |||
*/ | |||
public int addRecord(NyzbYdhxh n){ | |||
String sql = "insert into nyzb_ydhxh(year,orgid,ncydl,nyhfsyl,nyslbm,df,lf,jf,fhf,createTime,createUser) values(?,?,?,?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,new Object[]{n.getYear(),n.getOrgid(),n.getNcydl(),n.getNyhfsyl(),n.getNyslbm(),n.getDf(),n.getLf(),n.getJf(),n.getFhf(),n.getCreateTime(),n.getCreateUser()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 修改记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param n | |||
* @return | |||
*/ | |||
public int editRecord(NyzbYdhxh n){ | |||
String sql = "update nyzb_ydhxh set year=?,ncydl=?,nyhfsyl=?,nyslbm=?,df=?,lf=?,fhf=?,updateTime=?,updateUser=? where id = ?"; | |||
return jdbc.update(sql,new Object[]{n.getYear(),n.getNcydl(),n.getNyhfsyl(),n.getNyslbm(),n.getDf(),n.getLf(),n.getFhf(),n.getUpdateTime(),n.getUpdateUser(),n.getId()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param id | |||
* @return | |||
*/ | |||
public int deleteRecord(String id){ | |||
String sql = "delete from nyzb_ydhxh where id = ? "; | |||
return jdbc.update(sql,new Object[]{id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 检查年份是否已存在 | |||
* @author mt.W | |||
* @since 2021年10月22日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NyzbYdhxh z){ | |||
String sql="select count(id) from nyzb_ydhxh where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.NyzbZyqk; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农业机械作业情况 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class NyzbZyqkDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(NyzbZyqk z){ | |||
String sql="insert into nyzb_zyqk (orgid,year,jgmj,jbmj,ggmj,zbmj,jsmj,createTime,createUser) values (?,?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getJgmj(),z.getJbmj(),z.getGgmj(),z.getZbmj(),z.getJsmj() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(NyzbZyqk z){ | |||
String sql="update nyzb_zyqk set year=?,jgmj=?,jbmj=?,ggmj=?,zbmj=?,jsmj=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getJgmj(),z.getJbmj(),z.getGgmj(),z.getZbmj(),z.getJsmj(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from nyzb_zyqk where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(NyzbZyqk z){ | |||
String sql="select count(id) from nyzb_zyqk where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from nyzb_zyqk z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from nyzb_zyqk where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,136 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:NyzbnjzlDao.java | |||
* 创建日期:2021年10月25日 上午8:50:36 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.Nyzbnjzl; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 农业技术装备-农业机械年末拥有量Dao | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
*/ | |||
@Repository | |||
public class NyzbnjzlDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* | |||
* 方法描述 查询农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param start | |||
* @param limit | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getRecordList(int start,int limit,String year,String orgid){ | |||
String sql = "select n.*,o.name orgname from nyzb_njzl n left join orgdept o on o.id = n.orgid where orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and n.year = '"+year+"' "; | |||
} | |||
sql += " order by year desc limit ?,? "; | |||
return jdbc.queryForList(sql,new Object[]{start,limit}); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param start | |||
* @param limit | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getRecordList(String year,String orgid){ | |||
String sql = "select n.*,o.name orgname from nyzb_njzl n left join orgdept o on o.id = n.orgid where orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and n.year = '"+year+"' "; | |||
} | |||
return jdbc.queryForList(sql); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询农业机械拥有量记录数 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public int getRecordCount(String year,String orgid){ | |||
String sql = "select count(id) from nyzb_njzl where orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and year = '"+year+"' "; | |||
} | |||
return jdbc.queryForObject(sql, Integer.class); | |||
} | |||
/** | |||
* | |||
* 方法描述 新增农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param n | |||
* @return | |||
*/ | |||
public int addRecord(Nyzbnjzl n){ | |||
String sql = "insert into nyzb_njzl(year,orgid,gzj,wgj,sb,jsggjx,jgfshtj,zbwrj,gwlhsgj,jdtlj,zyj,trj,createTime,createUser) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?) "; | |||
return jdbc.update(sql,new Object[]{n.getYear(),n.getOrgid(),n.getGzj(),n.getWgj(),n.getSb(),n.getJsggjx(),n.getJgfshtj(),n.getZbwrj(),n.getGwlhsgj(),n.getJdtlj(),n.getZyj(),n.getTrj(),n.getCreateTime(),n.getCreateUser()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 修改农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param n | |||
* @return | |||
*/ | |||
public int editRecord(Nyzbnjzl n){ | |||
String sql = "update nyzb_njzl set year = ?,gzj=?,wgj=?,sb=?,jsggjx=?,jgfshtj=?,zbwrj=?,gwlhsgj=?,jdtlj=?,zyj=?,trj=?,updateTime=?,updateUser=? where id = ? "; | |||
return jdbc.update(sql,new Object[]{n.getYear(),n.getGzj(),n.getWgj(),n.getSb(),n.getJsggjx(),n.getJgfshtj(),n.getZbwrj(),n.getGwlhsgj(),n.getJdtlj(),n.getZyj(),n.getTrj(),n.getUpdateTime(),n.getUpdateUser(),n.getId()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除农业机械拥有量记录 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param id | |||
* @return | |||
*/ | |||
public int deleteRecord(String id){ | |||
String sql = "delete from nyzb_njzl where id = ? "; | |||
return jdbc.update(sql,new Object[]{id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 校验部门年度农业机械拥有量记录是否有存在 | |||
* @author mt.W | |||
* @since 2021年10月25日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(Nyzbnjzl z){ | |||
String sql="select count(id) from nyzb_njzl where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
} |
@@ -0,0 +1,184 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧有限公司 | |||
* 工程名:SpringMvcLion | |||
* 文件名:OrganizationTreeDao.java | |||
* 创建日期:2019年3月1日 下午3:46:55 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 组织树dao | |||
* @author mt.W | |||
* @since 2019年3月1日 | |||
*/ | |||
@Repository | |||
public class OrganizationTreeDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* | |||
* 方法描述 通过级别查询节点信息 | |||
* @author mt.W | |||
* @since 2020年2月25日 | |||
* @param level 节点等级 | |||
* @return | |||
*/ | |||
public List<Map<String, Object>> getParentNode(int level){ | |||
String sql="select id,name text ,level,pid,otherId from orgdept o where o.level=? order by o.id"; | |||
return jdbc.queryForList(sql,new Object[]{level}); | |||
} | |||
/** | |||
* | |||
* 方法描述 通过父节点查询节点信息 | |||
* @author mt.W | |||
* @since 2019年3月4日 | |||
* @param id 父节点 | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getChildNode(String id){ | |||
String sql="select id,name text,level,pid,otherId from orgdept o where o.pid = ?" ; | |||
return jdbc.queryForList(sql,new Object[]{id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 修改节点信息 | |||
* @author mt.W | |||
* @since 2020年2月25日 | |||
* @param name 节点名称 | |||
* @param id 节点新id | |||
* @param oid 节点原id | |||
* @return | |||
*/ | |||
public int editNode(String name ,String id,String oid,String otherId ){ | |||
String sql ="update orgdept set name = ?,id=?,otherId=? where id = ? "; | |||
return jdbc.update(sql,new Object[]{name,id,otherId,oid}); | |||
} | |||
/** | |||
* | |||
* 方法描述 新增节点 | |||
* @author mt.W | |||
* @since 2020年2月25日 | |||
* @param pid 父节点id | |||
* @param name 节点名称 | |||
* @param level 节点等级 | |||
* @param id 节点id | |||
* @return | |||
*/ | |||
public int addNode(String pid,String name,String level,String id,String otherId){ | |||
String sql ="insert into orgdept(pid,name,level,id,otherId) values(?,?,?,?,?) "; | |||
return jdbc.update(sql,new Object[]{pid,name,level,id,otherId}); | |||
} | |||
/** | |||
* | |||
* 方法描述 校验节点名称 | |||
* @author mt.W | |||
* @since 2020年2月25日 | |||
* @param name | |||
* @param pid | |||
* @param id | |||
* @return | |||
*/ | |||
public List<Map<String, Object>> getNodeName(String name,String pid,String id){ | |||
//String sql = "select * from orgdept where name = ? and pid = ?"; | |||
StringBuffer sql = new StringBuffer("select * from orgdept where name = ? and pid = ?"); | |||
if(StringUtil.isNotEmpty(id)){ | |||
//sql += " and id != ?"; | |||
sql.append(" and id != ?"); | |||
} | |||
return jdbc.queryForList(sql.toString(),new Object[]{name,pid,id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除节点 | |||
* @author mt.W | |||
* @since 2019年3月4日 | |||
* @param id | |||
* @return | |||
*/ | |||
public int deleteNode(String id){ | |||
String sql ="delete from orgdept where id =? " ; | |||
return jdbc.update(sql,new Object[]{id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询组织下是否有用户 | |||
* @author mt.W | |||
* @since 2019年3月7日 | |||
* @param id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getOrgUser(String id){ | |||
String sql = "select u.name from orgdept o inner join org_user u on o.id = u.orgid where u.deleteflag='1' and o.id = ?"; | |||
return jdbc.queryForList(sql,new Object[]{id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 通过父id集查询子节点集 | |||
* @author mt.W | |||
* @since 2020年2月25日 | |||
* @param id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getOrgIds(String id){ | |||
String sql = "select id from orgdept where pid in (?)"; | |||
return jdbc.queryForList(sql,new Object[]{id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询id是否存在 | |||
* @author xmf | |||
* @since 2019年11月28日 | |||
* @param id orgdept表中的id | |||
* @return | |||
*/ | |||
public List<Map<String, Object>> getID(String id){ | |||
String sql = "select * from orgdept where id = ?"; | |||
return jdbc.queryForList(sql,new Object[]{id}); | |||
} | |||
public List<Map<String, Object>> getNodeChild(String id){ | |||
String sql = "select id,name text,level,pid,otherId from orgdept where id = ? "; | |||
return jdbc.queryForList(sql,new Object[]{id}); | |||
} | |||
public List<Map<String,Object>> getAllOrgdeptNode(){ | |||
String sql = "select id,name text,level,pid,otherId from orgdept order by level,id"; | |||
return jdbc.queryForList(sql); | |||
} | |||
public List<Map<String,Object>> getOrgdeptNodeByOrgid(String id){ | |||
String sql = "select id,name text,level,pid,otherId from orgdept where id like '"+id+"%' order by level,id"; | |||
return jdbc.queryForList(sql); | |||
} | |||
/** | |||
* | |||
* 方法描述 根据部门名称查询部门id | |||
* @author mt.W | |||
* @since 2021年11月5日 | |||
* @param orgname | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getOrgdeptByName(String orgname){ | |||
String sql = "select id from orgdept where name = ? "; | |||
return jdbc.queryForList(sql,new Object[]{orgname.replaceAll(" ", "")}); | |||
} | |||
public List<Map<String,Object>> getOrgdeptInfoByOtherid(String otherid){ | |||
String sql = "select * from orgdept where otherId = ? "; | |||
return jdbc.queryForList(sql,new Object[]{otherid}); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧有限公司 | |||
* 工程名:SpringMvcLion | |||
* 文件名:ResourceDao.java | |||
* 创建日期:2019年3月18日 上午9:06:20 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.dao; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.Resources; | |||
/** | |||
* 类描述 | |||
* @author mt.W | |||
* @since 2019年3月18日 | |||
*/ | |||
@Repository | |||
public class ResourceDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* | |||
* 方法描述 添加资源菜单 | |||
* @author mt.W | |||
* @since 2019年3月18日 | |||
* @param r | |||
* @param userid | |||
* @return | |||
*/ | |||
public int addResource(Resources r,String userid){ | |||
String sql = "insert into resources(pid,name,level,url,icon,userid,ordnum,bz,openType) values(?,?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,new Object[]{r.getPid(),r.getName(),r.getLevel(),r.getUrl(),r.getIcon(),userid,r.getOrdnum(),r.getBz(),r.getOpenType()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 修改资源菜单 | |||
* @author mt.W | |||
* @since 2019年3月18日 | |||
* @param r | |||
* @param userid | |||
* @return | |||
*/ | |||
public int editRsource(Resources r,String userid ){ | |||
String sql = "update resources set name=?,url=?,icon=?,ordnum=?,bz=?,openType=? where id=?"; | |||
return jdbc.update(sql,new Object[]{r.getName(),r.getUrl(),r.getIcon(),r.getOrdnum(),r.getBz(),r.getOpenType(),r.getId()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除资源菜单 | |||
* @author mt.W | |||
* @since 2019年3月18日 | |||
* @param id | |||
* @return | |||
*/ | |||
public int deleteResource(String id){ | |||
String sql = "delete r,rr from resources r left join role_resources rr on rr.resourceid= r.id where r.id="+id; | |||
return jdbc.update(sql); | |||
} | |||
/** | |||
* | |||
* 方法描述 校验 | |||
* @author mt.W | |||
* @since 2019年3月18日 | |||
* @param name | |||
* @return | |||
*/ | |||
public int checkRole(String id){ | |||
String sql = "select count(*) from resources r inner join role_resources rr on r.id = rr.resourceid where r.id="+id; | |||
return jdbc.queryForObject(sql, Integer.class); | |||
} | |||
/** | |||
* | |||
* 方法描述 更改节点的父节点id | |||
* @author mt.W | |||
* @since 2019年10月30日 | |||
* @param id 节点id | |||
* @param pid 父节点id | |||
* @return | |||
*/ | |||
public int updateNodePid(String id,String pid){ | |||
String sql = "update resources set pid = ? where id = ? "; | |||
return jdbc.update(sql,new Object[]{pid,id}); | |||
} | |||
} |
@@ -0,0 +1,92 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧软件有限公司 | |||
* 工程名:SpringMVCLion | |||
* 文件名:RoleDao.java | |||
* 创建日期:2019年2月28日 上午9:06:20 | |||
* 作者:chengpengfei | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 角色 | |||
* @author chengpengfei | |||
* @since 2019年2月28日 | |||
*/ | |||
@Repository | |||
public class RoleDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* 方法描述 查询角色 | |||
* @author chengpengfei | |||
* @since 2019年2月28日 | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getRole(){ | |||
String sql= "select id,name,ifnull(content,'') content,adduserid as userid from role where id!=? "; | |||
return jdbc.queryForList(sql,new Object[]{0}); | |||
} | |||
public List<Map<String,Object>> checkRoleid(String roleid){ | |||
String sql = "select id from org_user where roleid = ? "; | |||
return jdbc.queryForList(sql,new Object[]{roleid}); | |||
} | |||
/** | |||
* 方法描述 删除角色 | |||
* @author chengpengfei | |||
* @since 2019年2月28日 | |||
* @param id | |||
* @return | |||
*/ | |||
public int deleteRole(String roleId){ | |||
String sql="delete from role where id=?"; | |||
return jdbc.update(sql,new Object[]{roleId}); | |||
} | |||
/** | |||
* 方法描述 添加用户 | |||
* @author chengpengfei | |||
* @since 2019年2月28日 | |||
* @return | |||
*/ | |||
public int addRole(String name,String content,String adduserid){ | |||
String sql="insert into role(name,content,adduserid,level) values(?,?,?,?) "; | |||
return jdbc.update(sql,new Object[]{name,content,adduserid,""}); | |||
} | |||
/** | |||
* 方法描述 修改角色信息 | |||
* @author ASUS | |||
* @since 2019年2月28日 | |||
* @param name | |||
* @param id | |||
* @return | |||
*/ | |||
public int updateRole(String name,String content,String id){ | |||
String sql="update role set name=?,content=? where id=?"; | |||
return jdbc.update(sql,new Object[]{name,content,id}); | |||
} | |||
/** | |||
* | |||
* 方法描述 校验角色名称是否重复 | |||
* @author mt.W | |||
* @since 2019年7月2日 | |||
* @param name | |||
* @param id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> checkRoleName(String name,String id){ | |||
String sql = "select name from role where name = ? "; | |||
if(StringUtil.isNotEmpty(id)){ | |||
sql += " and id !="+id; | |||
} | |||
return jdbc.queryForList(sql,new Object[]{name}); | |||
} | |||
} |
@@ -0,0 +1,222 @@ | |||
/** | |||
* 版权所有 ©2019 莱欧有限公司 | |||
* 工程名:SpringMvcLion | |||
* 文件名:UserDao.java | |||
* 创建日期:2019年3月5日 下午3:05:14 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.User; | |||
import com.lion.util.AuthorizeCheck; | |||
import com.lion.util.TimeUtil; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 用户 | |||
* @author mt.W | |||
* @since 2019年3月5日 | |||
*/ | |||
@Repository | |||
public class UserDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* | |||
* 方法描述 后台管理系统登录校验,只有拥有登录权限且删除标记不为删除的人员可登录 | |||
* @author mt.W | |||
* @since 2019年11月14日 | |||
* @param username 手机号 | |||
* @param password 密码 | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> checkUserLogin(String username){ | |||
StringBuffer sb = new StringBuffer(); | |||
sb.append("select u.*,r.name rname from org_user u inner join role r on u.roleid = r.id where u.userAccount = ? and deleteflag = ? "); | |||
return jdbc.queryForList(sb.toString(),new Object[]{username,"1"}); | |||
} | |||
public List<Map<String,Object>> getUserInfoById(String userid){ | |||
StringBuffer sb = new StringBuffer(); | |||
sb.append("select r.name rolename,u.userAccount from org_user u left join role r on r.id = u.roleid where u.id = ?"); | |||
return jdbc.queryForList(sb.toString(),new Object[]{userid}); | |||
} | |||
/** | |||
* 方法描述 通过orgid查询用户 条件查询用户 | |||
* @author cpf | |||
* @since 2019年7月19日 | |||
* @param start | |||
* @param row | |||
* @param phname | |||
* @param orgid | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getUser(int start,int row,String phname,String orgid){ | |||
StringBuffer sb = new StringBuffer(); | |||
sb.append("SELECT u.*,o.level,r.name rolename,o.name as oname,concat(ifnull(p.name,''),o.name) areaname "); | |||
sb.append(" from org_user u LEFT JOIN orgdept o on u.orgid=o.id"); | |||
sb.append(" left join orgdept p on p.id = o.pid"); | |||
sb.append(" left join role r on r.id = u.roleid "); | |||
sb.append(" where u.deleteflag=? and roleid !=? "); | |||
if(StringUtil.isNotEmpty(orgid)){ | |||
sb.append(" and o.id like '"+orgid+"%' "); | |||
} | |||
if(StringUtil.isNotEmpty(phname)){ | |||
sb.append("and (u.name like '%"+phname+"%' or u.phone like '%"+phname+"%')"); | |||
} | |||
sb.append("order by u.orgid limit ?,?"); | |||
return jdbc.queryForList(sb.toString(),new Object[]{1,0,start,row}); | |||
} | |||
/** | |||
* 方法描述 通过orgid查询用户总数 | |||
* @author cpf | |||
* @since 2019年7月19日 | |||
* @param phname | |||
* @param orgid | |||
* @return | |||
*/ | |||
public int getUserCount(String phname,String orgid){ | |||
StringBuffer sb = new StringBuffer(); | |||
sb.append(" SELECT count(u.id) from org_user u left join orgdept o on o.id = u.orgid where u.deleteflag=? and roleid != ?"); | |||
if(StringUtil.isNotEmpty(orgid)){ | |||
sb.append(" and o.id like '"+orgid+"%' "); | |||
} | |||
if(StringUtil.isNotEmpty(phname)){ | |||
sb.append(" and (u.name like '%"+phname+"%' or u.phone like '%"+phname+"%')"); | |||
} | |||
return jdbc.queryForObject(sb.toString(), new Object[]{1,0},Integer.class); | |||
} | |||
/** | |||
* | |||
* 方法描述 添加人员 | |||
* @author mt.W | |||
* @since 2019年9月28日 | |||
* @param u | |||
* @param userid | |||
* @return | |||
*/ | |||
public int addUser(User u ,String userid){ | |||
String sql=" insert into org_user(name,userAccount,sex,roleid,orgid,adduserid,addtime,phone,pwd,dlqx) values(?,?,?,?,?,?,?,?,?,?) "; | |||
return jdbc.update(sql,new Object[]{u.getName(),u.getUserAccount(),u.getSex(),u.getRoleid(),u.getOrgid(),userid,TimeUtil.getNowTime(),u.getPhone(),AuthorizeCheck.encryptPassword(u.getPwd()),"1"}); | |||
} | |||
/** | |||
* | |||
* 方法描述 修改人员 | |||
* @author mt.W | |||
* @since 2019年9月28日 | |||
* @param u | |||
* @return | |||
*/ | |||
public int editUserById(User u){ | |||
String sql = " update org_user set name=?,sex=?,roleid=?,phone=?,userAccount=? where id = ?"; | |||
return jdbc.update(sql,new Object[]{u.getName(),u.getSex(),u.getRoleid(),u.getPhone(),u.getUserAccount(),u.getId()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 更改人员部门id(人员 迁移操作) | |||
* @author mt.W | |||
* @since 2019年10月30日 | |||
* @param id 人员ID | |||
* @param orgid 部门人员id | |||
* @return | |||
*/ | |||
public int updateUserOrgid(String id,String orgid){ | |||
String sql = "update org_user set orgid = ? where id = ? "; | |||
return jdbc.update(sql,new Object[]{orgid,id}); | |||
} | |||
/** | |||
* 方法描述 删除人员 | |||
* @author wcj | |||
* @since 2019年11月7日 | |||
* @param id | |||
* @return | |||
*/ | |||
public int deleteUser(String id){ | |||
String sql = "update org_user set deleteflag=? where id=?"; | |||
return jdbc.update(sql,new Object[]{0,id}); | |||
} | |||
/** | |||
* 方法描述 查询所有角色 | |||
* @author wcj | |||
* @since 2019年11月7日 | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getrole(){ | |||
String sql = "select id,name from role where id != ? "; | |||
return jdbc.queryForList(sql,new Object[]{0}); | |||
} | |||
/** | |||
* | |||
* 方法描述 修改用户密码 | |||
* @author mt.W | |||
* @since 2020年2月20日 | |||
* @param id | |||
* @param pwd | |||
* @return | |||
*/ | |||
public int updateUserPwd(String id,String pwd){ | |||
String sql = "update org_user set pwd = ? where id = ? "; | |||
return jdbc.update(sql,new Object[]{AuthorizeCheck.encryptPassword(pwd),id}); | |||
} | |||
/**根据userid查询登录的用户信息 | |||
* @param userID | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getLoginUserToken(String userID){ | |||
return jdbc.queryForList("select cookie from sys_login where userid=?",new Object[]{userID}); | |||
} | |||
/** | |||
* 方法描述 校验登录账号和手机号是否有重复 | |||
* @author wcj | |||
* @since 2020年12月23日 | |||
* @param u | |||
* @return | |||
*/ | |||
public int getIfAccount(User u){ | |||
String sql = "select count(id) from org_user where userAccount=? and deleteflag='1'"; | |||
if(StringUtil.isNotEmpty(u.getId())){ | |||
sql += "and id !='"+u.getId()+"' "; | |||
} | |||
return jdbc.queryForObject(sql, new Object[]{u.getUserAccount()},Integer.class); | |||
} | |||
public int getIfPhone(User u){ | |||
String sql = "select count(id) from org_user where phone=? and deleteflag='1'"; | |||
if(StringUtil.isNotEmpty(u.getId())){ | |||
sql += "and id !='"+u.getId()+"' "; | |||
} | |||
return jdbc.queryForObject(sql, new Object[]{u.getPhone()},Integer.class); | |||
} | |||
/** | |||
* | |||
* 方法描述 根据手机号查询人员 | |||
* @author mt.W | |||
* @since 2021年11月11日 | |||
* @param phone | |||
* @return | |||
*/ | |||
public int getUserByPhone(String phone){ | |||
String sql = "select count(id) from org_user where phone = ? and deleteflag='1' "; | |||
return jdbc.queryForObject(sql,new Object[]{phone}, Integer.class); | |||
} | |||
/** | |||
* | |||
* 方法描述 根据手机号查询人员信息 | |||
* @author mt.W | |||
* @since 2021年11月12日 | |||
* @param phone | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getUserInfoByPhone(String phone){ | |||
String sql = "select u.*,r.name rname from org_user u inner join role r on u.roleid = r.id where u.phone = ? and deleteflag = 1 "; | |||
return jdbc.queryForList(sql,new Object[]{phone}); | |||
} | |||
} |
@@ -0,0 +1,91 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.XmyCpcl; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 产品产量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class XmyCpclDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(XmyCpcl z){ | |||
String sql="insert into xmy_cpcl (orgid,year,zr,nr,yr,jqr,nl,ql,hj,createTime,createUser) values (?,?,?,?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getZr(),z.getNr(),z.getYr(),z.getJqr() | |||
,z.getNl(),z.getQl(),z.getHj(),z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(XmyCpcl z){ | |||
String sql="update xmy_cpcl set year=?,zr=?,nr=?,yr=?,jqr=?,nl=?,ql=?,hj=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getZr(),z.getNr(),z.getYr(),z.getJqr() | |||
,z.getNl(),z.getQl(),z.getHj(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from xmy_cpcl where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(XmyCpcl z){ | |||
String sql="select count(id) from xmy_cpcl where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from xmy_cpcl z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from xmy_cpcl where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.XmyDncl; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 当年出栏 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class XmyDnclDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(XmyDncl z){ | |||
String sql="insert into xmy_dncl (orgid,year,zs,ns,jqs,hj,createTime,createUser) values (?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getZs(),z.getNs(),z.getJqs(),z.getHj() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(XmyDncl z){ | |||
String sql="update xmy_dncl set year=?,zs=?,ns=?,jqs=?,hj=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getZs(),z.getNs(),z.getJqs(),z.getHj(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from xmy_dncl where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(XmyDncl z){ | |||
String sql="select count(id) from xmy_dncl where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from xmy_dncl z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from xmy_dncl where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.XmyNmcl; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 年末存栏 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class XmyNmclDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(XmyNmcl z){ | |||
String sql="insert into xmy_nmcl (orgid,year,zs,ns,jqs,hj,createTime,createUser) values (?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getZs(),z.getNs(),z.getJqs(),z.getHj() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(XmyNmcl z){ | |||
String sql="update xmy_nmcl set year=?,zs=?,ns=?,jqs=?,hj=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getZs(),z.getNs(),z.getJqs(),z.getHj(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from xmy_nmcl where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(XmyNmcl z){ | |||
String sql="select count(id) from xmy_nmcl where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from xmy_nmcl z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from xmy_nmcl where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.XmySl; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 饲料 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class XmySlDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(XmySl z){ | |||
String sql="insert into xmy_sl (orgid,year,zsl,nsl,jqsl,hj,createTime,createUser) values (?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getZsl(),z.getNsl(),z.getJqsl() | |||
,z.getHj(),z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(XmySl z){ | |||
String sql="update xmy_sl set year=?,zsl=?,nsl=?,jqsl=?,hj=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getZsl(),z.getNsl(),z.getJqsl(),z.getHj(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from xmy_sl where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(XmySl z){ | |||
String sql="select count(id) from xmy_sl where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from xmy_sl z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from xmy_sl where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.YyScjg; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 水产加工 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class YyScjgDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(YyScjg z){ | |||
String sql="insert into yy_scjg (orgid,year,qys,zl,createTime,createUser) values (?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getQys(),z.getZl() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(YyScjg z){ | |||
String sql="update yy_scjg set year=?,qys=?,zl=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getQys(),z.getZl(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from yy_scjg where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(YyScjg z){ | |||
String sql="select count(id) from yy_scjg where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from yy_scjg z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from yy_scjg where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,90 @@ | |||
/** | |||
* 版权所有 ©2021 | |||
* 工程名:yearBooks | |||
* 文件名:NcjjZczDao.java | |||
* 创建日期:2021年10月21日 上午9:19:04 | |||
* 作者:duanxiaomingzi | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import javax.annotation.Resource; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.YyUser; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 渔业从业人员 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
*/ | |||
@Repository | |||
public class YyUserDao { | |||
@Resource | |||
private JdbcTemplate jdbc; | |||
public int add(YyUser z){ | |||
String sql="insert into yy_user (orgid,year,yyx,yyc,yyh,yyr,createTime,createUser) values (?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,z.getOrgid(),z.getYear(),z.getYyx(),z.getYyc(),z.getYyh(),z.getYyr() | |||
,z.getCreateTime(),z.getCreateUser()); | |||
} | |||
public int update(YyUser z){ | |||
String sql="update yy_user set year=?,yyx=?,yyc=?,yyh=?,yyr=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,z.getYear(),z.getYyx(),z.getYyc(),z.getYyh(),z.getYyr(),z.getUpdateTime(),z.getUpdateUser() | |||
,z.getId()); | |||
} | |||
public int delete(int id){ | |||
String sql="delete from yy_user where id=?"; | |||
return jdbc.update(sql,id); | |||
} | |||
/** | |||
* 方法描述 校验当前年度该单位是否已经录入过数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int checkIfExistByYearAndOrg(YyUser z){ | |||
String sql="select count(id) from yy_user where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
/** | |||
* 方法描述 根据部门id查询数据 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public List<Map<String,Object>> getList(String year,String orgid,int start,int limit){ | |||
String sql="select z.*,o.name orgname from yy_user z left join orgdept o on z.orgid=o.id where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
sql+=" order by year desc limit ?,?"; | |||
return jdbc.queryForList(sql,orgid+"%",start,limit); | |||
} | |||
/** | |||
* 方法描述 获取数量 | |||
* @author duanxiaomingzi | |||
* @since 2021年10月21日 | |||
* @param year 年度 | |||
* @param orgid 部门id | |||
* @return | |||
*/ | |||
public int getListCount(String year,String orgid){ | |||
String sql="select count(id) from yy_user where orgid like ?"; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql+=" and year="+year; | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{orgid+"%"},Integer.class); | |||
} | |||
} |
@@ -0,0 +1,129 @@ | |||
/** | |||
* 版权所有 ©2021 莱欧有限公司 | |||
* 工程名:yearBooks | |||
* 文件名:YyzbHsyzblDao.java | |||
* 创建日期:2021年10月26日 下午3:50:46 | |||
* 作者:mt.W | |||
*/ | |||
package com.lion.dao; | |||
import java.util.List; | |||
import java.util.Map; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.jdbc.core.JdbcTemplate; | |||
import org.springframework.stereotype.Repository; | |||
import com.lion.entity.YyzbYzbl; | |||
import jodd.util.StringUtil; | |||
/** | |||
* 类描述 渔业统计指标-淡水养殖与捕捞 dao | |||
* @author mt.W | |||
* @since 2021年10月26日 | |||
*/ | |||
@Repository | |||
public class YyzbDsyzblDao { | |||
@Autowired | |||
private JdbcTemplate jdbc; | |||
/** | |||
* | |||
* 方法描述 查询记录 | |||
* @author mt.W | |||
* @since 2021年10月26日 | |||
* @param start | |||
* @param limit | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public List<Map<String, Object>> getRecordList(int start,int limit,String year,String orgid){ | |||
String sql = "select z.*,o.name orgname from yyzb_dsyzbl z left join orgdept o on o.id = z.orgid where z.orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and z.year = '"+year+"' "; | |||
} | |||
sql += " order by z.year desc limit ?,? "; | |||
return jdbc.queryForList(sql,new Object[]{start,limit}); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询记录 | |||
* @author mt.W | |||
* @since 2021年10月26日 | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public List<Map<String, Object>> getRecordList(String year,String orgid){ | |||
String sql = "select z.*,o.name orgname from yyzb_dsyzbl z left join orgdept o on o.id = z.orgid where z.orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and z.year = '"+year+"' "; | |||
} | |||
return jdbc.queryForList(sql); | |||
} | |||
/** | |||
* | |||
* 方法描述 查询记录数量 | |||
* @author mt.W | |||
* @since 2021年10月26日 | |||
* @param year | |||
* @param orgid | |||
* @return | |||
*/ | |||
public int getRecordCount(String year,String orgid){ | |||
String sql = "select count(id) from yyzb_dsyzbl where orgid like '"+orgid+"%' "; | |||
if(StringUtil.isNotEmpty(year)){ | |||
sql += " and year = '"+year+"' "; | |||
} | |||
return jdbc.queryForObject(sql, Integer.class); | |||
} | |||
/** | |||
* | |||
* 方法描述 新增记录 | |||
* @author mt.W | |||
* @since 2021年10月26日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int addRecord(YyzbYzbl z){ | |||
String sql = "insert into yyzb_dsyzbl(year,orgid,ylyz,ylbl,ylyzmj,jkyz,jkbl,jkyzmj,blyz,blbl,blyzmj,zyz,zbl,zyzmj,createTime,createUser)" | |||
+ " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; | |||
return jdbc.update(sql,new Object[]{z.getYear(),z.getOrgid(),z.getYlyz(),z.getYlbl(),z.getYlyzmj(),z.getJkyz(),z.getJkbl(),z.getJkyzmj(), | |||
z.getBlyz(),z.getBlbl(),z.getBlyzmj(),z.getZyz(),z.getZbl(),z.getZyzmj(),z.getCreateTime(),z.getCreateUser()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 修改记录 | |||
* @author mt.W | |||
* @since 2021年10月26日 | |||
* @param z | |||
* @return | |||
*/ | |||
public int editRecord(YyzbYzbl z){ | |||
String sql = "update yyzb_dsyzbl set year=?,ylyz=?,ylbl=?,ylyzmj=?,jkyz=?,jkbl=?,jkyzmj=?,blyz=?,blbl=?,blyzmj=?,zyz=?,zbl=?,zyzmj=?,updateTime=?,updateUser=? where id=?"; | |||
return jdbc.update(sql,new Object[]{z.getYear(),z.getYlyz(),z.getYlbl(),z.getYlyzmj(),z.getJkyz(),z.getJkbl(),z.getJkyzmj(), | |||
z.getBlyz(),z.getBlbl(),z.getBlyzmj(),z.getZyz(),z.getZbl(),z.getZyzmj(),z.getUpdateTime(),z.getUpdateUser(),z.getId()}); | |||
} | |||
/** | |||
* | |||
* 方法描述 删除记录 | |||
* @author mt.W | |||
* @since 2021年10月26日 | |||
* @param id | |||
* @return | |||
*/ | |||
public int deleteRecord(String id){ | |||
String sql = "delete from yyzb_dsyzbl where id = ? "; | |||
return jdbc.update(sql,new Object[]{id}); | |||
} | |||
public int checkIfExistByYearAndOrg(YyzbYzbl z){ | |||
String sql="select count(id) from yyzb_dsyzbl where year=? and orgid=?"; | |||
if(StringUtil.isNotEmpty(z.getId())){ | |||
sql+=" and id<>"+z.getId(); | |||
} | |||
return jdbc.queryForObject(sql,new Object[]{z.getYear(),z.getOrgid()}, Integer.class); | |||
} | |||
} |