Commit 32b3e1fc authored by 邢足健's avatar 邢足健

coding

parents
This diff is collapsed.
## 此项目为奶业APP后台服务项目
### 1.特殊需求说明
### 2.开发说明
#### 2.1 开发使用的数据库配置路径
> web/src/main/filters/dev.properties
修改此文件下的配置,即可更换数据库连接
#### 2.2 开发者需要自行导入excel的jar包
>jar包中实现了一句代码导入导出excel
```
mvn install:install-file -Dfile=docs/jar/excel-1.1.1-SNAPSHOT.jar -DgroupId=excel -DartifactId=excel -Dversion=1.1.1-SNAPSHOT -Dpackaging=jar
```
>jar项目维护在gitlab.haomo-studio.com上的excel-jar的项目
>使用请看的demo请看:web/src/main/test/com/haomostudio/milk/test/Test.java
*.iml
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.haomostudio.milk</groupId>
<artifactId>milk</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>dao</artifactId>
<packaging>jar</packaging>
<name>dao</name>
<description>dao</description>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.haomostudio.milk</groupId>
<artifactId>domain</artifactId>
<version>${milk.domain.version}</version>
</dependency>
</dependencies>
<build>
<finalName>dao</finalName>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
package com.haomostudio.JuniorSpringMVCTemplate.dao;
import com.haomostudio.JuniorSpringMVCTemplate.po.AboutUs;
import com.haomostudio.JuniorSpringMVCTemplate.po.AboutUsExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import java.util.List;
public interface AboutUsMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table about_us
*
* @mbg.generated Sun Jul 15 16:09:42 CST 2018
*/
long countByExample(AboutUsExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table about_us
*
* @mbg.generated Sun Jul 15 16:09:42 CST 2018
*/
int deleteByExample(AboutUsExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table about_us
*
* @mbg.generated Sun Jul 15 16:09:42 CST 2018
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table about_us
*
* @mbg.generated Sun Jul 15 16:09:42 CST 2018
*/
int insert(AboutUs record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table about_us
*
* @mbg.generated Sun Jul 15 16:09:42 CST 2018
*/
int insertSelective(AboutUs record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table about_us
*
* @mbg.generated Sun Jul 15 16:09:42 CST 2018
*/
List<AboutUs> selectByExampleWithRowbounds(AboutUsExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table about_us
*
* @mbg.generated Sun Jul 15 16:09:42 CST 2018
*/
List<AboutUs> selectByExample(AboutUsExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table about_us
*
* @mbg.generated Sun Jul 15 16:09:42 CST 2018
*/
AboutUs selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table about_us
*
* @mbg.generated Sun Jul 15 16:09:42 CST 2018
*/
int updateByExampleSelective(@Param("record") AboutUs record, @Param("example") AboutUsExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table about_us
*
* @mbg.generated Sun Jul 15 16:09:42 CST 2018
*/
int updateByExample(@Param("record") AboutUs record, @Param("example") AboutUsExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table about_us
*
* @mbg.generated Sun Jul 15 16:09:42 CST 2018
*/
int updateByPrimaryKeySelective(AboutUs record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table about_us
*
* @mbg.generated Sun Jul 15 16:09:42 CST 2018
*/
int updateByPrimaryKey(AboutUs record);
}
\ No newline at end of file
package com.haomostudio.JuniorSpringMVCTemplate.dao.common;
/**
* Created by shidaizhoukan on 2017/3/16.
*/
public class Constants {
public static final char UNDERLINE = '_';
public final static String SCRIPT_PATH = "/scripts";
public final static String FORMFILE_PATH = "/form";
public final static String AVATAR_PATH = "/upload/user/avatar";
public final static String SEAFILE_COMMON_LIB = "common";
public final static String AFTER_SALES_SEAFILE_LIB = "/afterSales";
public final static String SEAFILE_LOGISTICS_DIR = "/logistics";
public final static String FILING_TENDER_SEAFILE_LIB = "/filingTender";
public static final String COLUMN_ID = "ID";
public static final String COLUMN_SCENE_INSTANCE_ID = "SCENE_INSTANCE_ID";
public static final String COLUMN_FORM_INSTANCE_ID = "FORM_INSTANCE_ID";
public static final String COLUMN_CREATE_TIME = "CREATE_TIME";
public static final String COLUMN_UPDATE_TIME = "UPDATE_TIME";
/**
* 表单引擎自定义表名前缀
*/
public static final String TABLE_NAME_PREFIX_FORM_ENGINE = "T_";
/**
* 用户自定义表名前缀
*/
public static final String TABLE_NAME_PREFIX_USER = "U_";
/**
* 部门自定义表名前缀
*/
public static final String TABLE_NAME_PREFIX_DEPARTMENT = "D_";
/**
* 客户自定义表名前缀
*/
public static final String TABLE_NAME_PREFIX_CUSTOMER = "C_";
/**
* 物料自定义表名前缀
*/
public static final String TABLE_NAME_PREFIX_MATERIAL = "M_";
/**
* 业务场景自定义表名前缀
*/
public static final String TABLE_NAME_PREFIX_SCENE = "S_";
/**
* 报修单的编号标识,和编号长度
*/
public static final String REPAIR_ORDER_NO_TYPE = "Repair_OrderNo_Type";
public static final int REPAIR_ORDER_NO_LENGTH = 4;
// 报备编号
public static final String FILING_NO_TYPE = "FILING_NO_TYPE";
public static class UserQueryConditionType {
public static final String afterSalesCallCenterQuery = "afterSalesCallCenterQuery";
}
public static class FilingHandleStatus {
// 打开
public static final String Active = "A";
// 确定(可以被合同使用)
public static final String Confirm = "C";
// 关闭/办结(手动作废)
public static final String End = "E";
// 超时
public static final String Overtime = "O";
// 待办
public static final String Wait = "W";
// 已办
public static final String Pass = "P";
// 跳过
public static final String Skip = "S";
// 中标
public static final String ZhongBiao = "O";
// 未中标
public static final String WeizhongBiao = "X";
}
}
package com.haomostudio.JuniorSpringMVCTemplate.dao.common.util;
import com.haomostudio.JuniorSpringMVCTemplate.dao.impl.DataBaseDao;
import org.springframework.util.StringUtils;
import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Created by shidaizhoukan on 2017/3/16.
*/
public class DataBaseOperationUtils {
public static final String DB_TYPE_ORACLE = "oracle";
public static final String DB_TYPE_MYSQL = "mysql";
public static final String DATA_TYPE_VARCHAR2 = "varchar2";
public static final String DATA_TYPE_TIMESTAMP = "timestamp";
public static final String DATA_TYPE_INT = "number(11, 0)";
public static final String DATA_TYPE_FLOAT = "FLOAT";
public static final String DATA_TYPE_DOUBLE = "FLOAT";
public static final String DATA_TYPE_NUMBER = "NUMBER";
public static final SimpleDateFormat ORACLE_SDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public static List<String> getPropertyName(Object obj) {
ArrayList list = new ArrayList();
Field[] fs = obj.getClass().getDeclaredFields();
Field[] var7 = fs;
int var6 = fs.length;
for(int var5 = 0; var5 < var6; ++var5) {
Field f = var7[var5];
list.add(f.getName());
}
return list;
}
public static Object[] GetObjectArgs(Map<String, Object> map, String dbType) {
Map<String, Object> params = new LinkedHashMap<>();
for (Map.Entry<String, Object> entry : map.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
if (DB_TYPE_ORACLE.equals(dbType) && (value instanceof Date)) {
value = ORACLE_SDF.format((Date)value);
}
params.put(key, value);
}
return params.values().toArray();
}
public static List<Object[]> GetObjectArgs(List<Map<String, Object>> maps, String dbType) {
List<Object[]> rets = new ArrayList<>();
Map<String, Object> params = new LinkedHashMap<>();
for (Map<String, Object> map : maps) {
for (Map.Entry<String, Object> entry : map.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
if (DB_TYPE_ORACLE.equals(dbType) && (value instanceof Date)) {
value = ORACLE_SDF.format((Date) value);
}
params.put(key, value);
}
rets.add(params.values().toArray());
}
return rets;
}
public static String GetNames(Map<String, Object> map, String operation, String dbType) {
String columns = "";
try {
if(DataBaseDao.INSERT.equals(operation)) {
String params = "(";
columns = "(";
for(Map.Entry<String, Object> entry : map.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
columns = columns + (DB_TYPE_ORACLE.equals(dbType)? key.toUpperCase() + ",":"`" + key + "`,");
if (DB_TYPE_ORACLE.equals(dbType) && (value instanceof Date)) {
params = params + "to_date(?,'YYYY-MM-DD HH24:MI:SS'),";
} else {
params = params + "?,";
}
}
if(!"(".equals(columns)) {
columns = columns.substring(0, columns.length() - 1);
}
if(!"(".equals(params)) {
params = params.substring(0, params.length() - 1);
}
columns = columns + ")";
params = params + ")";
return columns + " VALUES" + params;
}
if(DataBaseDao.UPDATE.equals(operation)) {
for(Map.Entry<String, Object> entry : map.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
if ("ID".equals(key)) {
continue;
}
columns = columns + (DB_TYPE_ORACLE.equals(dbType)? key.toUpperCase() + "":"`" + key + "`");
if (DB_TYPE_ORACLE.equals(dbType) && (value instanceof Date)) {
columns = columns + "=to_date(?,'YYYY-MM-DD HH24:MI:SS'),";
} else {
columns = columns + "=?,";
}
}
if(columns.substring(columns.length() - 1, columns.length()).equals(",")) {
columns = columns.substring(0, columns.length() - 1);
}
columns = columns + " WHERE ID=?";
}
if (DataBaseDao.DELETE.equals(operation)) {
for(String key : map.keySet()) {
columns = columns + (DB_TYPE_ORACLE.equals(dbType)? key.toUpperCase() + "=? AND ":"`" + key + "`=? AND ");
}
if(columns.endsWith(" AND ")) {
columns = columns.substring(0, columns.length() - 5);
}
}
} catch (Exception var9) {
var9.printStackTrace();
}
return columns;
}
public static String getInSQL(String params, String flag) {
String tempStr = params.replace(flag, ",");
String[] tempStrArr = tempStr.split(",");
String InSQL = "";
for(int i = 0; i < tempStrArr.length; ++i) {
InSQL = InSQL + "?,";
}
if(!"".equals(InSQL)) {
InSQL = InSQL.substring(0, InSQL.length() - 1);
}
return InSQL;
}
public static List<Object> getInArgs(String params, String flag, String dataType) {
String tempStr = params.replace(flag, ",");
String[] tempStrArr = tempStr.split(",");
ArrayList obj = new ArrayList();
int i;
if("varchar".equalsIgnoreCase(dataType) || "varchar2".equalsIgnoreCase(dataType) || "blob".equalsIgnoreCase(dataType)) {
for(i = 0; i < tempStrArr.length; ++i) {
obj.add(tempStrArr[i]);
}
} else if("integer".equals(dataType)) {
for(i = 0; i < tempStrArr.length; ++i) {
obj.add(Integer.valueOf(Integer.parseInt(tempStrArr[i])));
}
}
return obj;
}
private static String getDataType(int type) {
switch (type) {
case 1:
return DATA_TYPE_VARCHAR2;
case 2:
return DATA_TYPE_VARCHAR2;
case 3:
return DATA_TYPE_TIMESTAMP;
case 4:
return DATA_TYPE_TIMESTAMP;
case 5:
return DATA_TYPE_VARCHAR2;
case 6:
return DATA_TYPE_VARCHAR2;
case 7:
return DATA_TYPE_VARCHAR2;
case 8:
return DATA_TYPE_VARCHAR2;
case 9:
return DATA_TYPE_INT;
case 10:
// return DATA_TYPE_DOUBLE;
return DATA_TYPE_NUMBER;
case 11:
return DATA_TYPE_VARCHAR2;
case 12:
return DATA_TYPE_VARCHAR2;
default:
return DATA_TYPE_VARCHAR2;
}
}
public static String getMySQLTableName(String prefix, String tableName) {
return "`" + getFinalTableName(prefix, tableName) + "`";
}
public static String getOracleTableName(String prefix, String tableName) {
return getFinalTableName(prefix, tableName).toUpperCase();
}
private static String getFinalTableName(String prefix, String tableName) {
String finalName = "";
if (!StringUtils.isEmpty(prefix)) {
finalName += prefix.trim();
finalName += tableName.trim().toUpperCase();
} else {
finalName += tableName.trim().toLowerCase();
}
return finalName;
}
}
package com.haomostudio.JuniorSpringMVCTemplate.dao.impl;
import java.util.List;
import java.util.Map;
/**
* Created by shidaizhoukan on 2017/3/16.
*/
public interface DataBaseDao {
String START = "start";
String LIMIT = "limit";
String UPDATE = "UPDATE";
String INSERT = "INSERT";
String DELETE = "DELETE";
int queryForInt(String sql, List<Object> params);
boolean executeSQL(String sql);
int update(String tableNamePrefix, String tableName, Map<String, Object> map);
int insert(String tableNamePrefix, String tableName, Map<String, Object> map);
int inserts(String tableNamePrefix, String tableName, List<Map<String, Object>> maps);
int delete(String tableNamePrefix, String tableName, Map<String, Object> map);
boolean executeSQL(String sql, List<Object> params);
Map<String, Object> executeQuerySQL(String sql);
List<Map<String, Object>> executeListSQL(String sql);
void executeSingleSQL(String sql);
List<Map<String, Object>> getTableData(String tableNamePrefix, String tableName, Map<String, Object> params);
int getTableDataCount(String tableNamePrefix, String tableName, Map<String, Object> params);
int getColumnNotNullCount(String tableNamePrefix, String tableName, String columnName);
int getColumnNotZeroCount(String tableNamePrefix, String tableName, String columnName);
}
package com.haomostudio.JuniorSpringMVCTemplate.dao.impl;
import com.haomostudio.JuniorSpringMVCTemplate.dao.common.Constants;
import com.haomostudio.JuniorSpringMVCTemplate.dao.common.util.DataBaseOperationUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* Created by shidaizhoukan on 2017/3/16.
*/
@Repository(value = "databaseDao")
public class OracleDataBaseDaoImpl implements DataBaseDao {
public static final String PAGINATION_PREFIX = "select * from (select row_.*, rownum rownum_ from(";
public static final String PAGINATION_SUFFIX = ")row_ where rownum <= ?) where rownum_ > ?";
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private DataSource dataSource;
public List<Map<String, Object>> queryForList(String sql, List<Object> params) {
try {
List e = params.size() > 0 ? this.getJdbcTemplate().queryForList(sql, params.toArray()) :
this.getJdbcTemplate().queryForList(sql);
return e;
} catch (Exception var4) {
var4.printStackTrace();
return new ArrayList<>();
}
}
@Override
public int queryForInt(String sql, List<Object> params) {
try {
if (null == params) {
params = new ArrayList<>();
}
logger.debug("executeSQL:{}\r\nparams:{}", sql, params);
return params.size() > 0 ? this.getJdbcTemplate().queryForObject(sql, params.toArray(),Integer.class) :
this.getJdbcTemplate().queryForObject(sql,Integer.class);
} catch (Exception var4) {
var4.printStackTrace();
return 0;
}
}
@Override
public boolean executeSQL(String sql) {
logger.debug("executeSQL:{}", sql);
String[] sqlList = sql.split(";");
JdbcTemplate jdbcTemplate = this.getJdbcTemplate();
for (String s : sqlList) {
jdbcTemplate.execute(s);
}
return true;
}
@Override
public int update(String tableNamePrefix, String tableName, Map<String, Object> map) {
try {
//保证ID是最后一个字段
String id = (String) map.get(Constants.COLUMN_ID);
map.remove(Constants.COLUMN_ID);
map.put(Constants.COLUMN_ID, id);
String sql = "UPDATE " + DataBaseOperationUtils.getOracleTableName(tableNamePrefix, tableName) + " SET "
+ DataBaseOperationUtils.GetNames(map, UPDATE, DataBaseOperationUtils.DB_TYPE_ORACLE);
logger.debug("update sql:{}\r\nparams:{}", sql, map);
int row = this.getJdbcTemplate().update(sql, DataBaseOperationUtils.GetObjectArgs(map, DataBaseOperationUtils.DB_TYPE_ORACLE));
return row;
} catch (Exception var4) {
var4.printStackTrace();
throw var4;
}
}
public int insert(String tableNamePrefix, String tableName, Map<String, Object> map) {
try {
String sql = "INSERT INTO " + DataBaseOperationUtils.getOracleTableName(tableNamePrefix, tableName) + " "
+ DataBaseOperationUtils.GetNames(map, INSERT, DataBaseOperationUtils.DB_TYPE_ORACLE);
logger.debug("insert sql:{}\r\nparams:{}", sql, map);
int ID = this.getJdbcTemplate().update(sql, DataBaseOperationUtils.GetObjectArgs(map, DataBaseOperationUtils.DB_TYPE_ORACLE));
return ID;
} catch (Exception var4) {
var4.printStackTrace();
throw var4;
}
}
public int inserts(String tableNamePrefix, String tableName, List<Map<String, Object>> maps) {
try {
String sql = "INSERT INTO " + DataBaseOperationUtils.getOracleTableName(tableNamePrefix, tableName) + " "
+ DataBaseOperationUtils.GetNames(maps.get(0), INSERT, DataBaseOperationUtils.DB_TYPE_ORACLE);
logger.debug("inserts sql:{}\r\nparams:{}", sql, maps);
int[] ints = this.getJdbcTemplate().batchUpdate(sql, DataBaseOperationUtils.GetObjectArgs(maps, DataBaseOperationUtils.DB_TYPE_ORACLE));
return 0;
} catch (Exception var4) {
var4.printStackTrace();
throw var4;
}
}
@Override
public int delete(String tableNamePrefix, String tableName, Map<String, Object> map) {
try {
String sql = "DELETE FROM " + DataBaseOperationUtils.getOracleTableName(tableNamePrefix, tableName) + " WHERE "
+ DataBaseOperationUtils.GetNames(map, DELETE, DataBaseOperationUtils.DB_TYPE_ORACLE);
logger.debug("delete sql:{}\r\nparams:{}", sql, map);
int rows = this.getJdbcTemplate().update(sql, DataBaseOperationUtils.GetObjectArgs(map, DataBaseOperationUtils.DB_TYPE_ORACLE));
return rows;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
@Override
public boolean executeSQL(String sql, List<Object> params) {
logger.debug("executeSQL:{}\r\nparams:{}", sql, params);
int status = this.getJdbcTemplate().update(sql, params.toArray());
return status > 0;
}
@Override
public Map<String, Object> executeQuerySQL(String sql) {
logger.debug("executeQuerySQL:{}", sql);
return this.getJdbcTemplate().queryForMap(sql);
}
public List<Map<String, Object>> executeListSQL(String sql) {
logger.debug("executeListSQL:{}", sql);
return this.getJdbcTemplate().queryForList(sql);
}
@Override
public void executeSingleSQL(String sql) {
logger.debug("executeSingleSQL:{}", sql);
this.getJdbcTemplate().execute(sql);
}
@Override
public List<Map<String, Object>> getTableData(String tableNamePrefix, String tableName, Map<String, Object> params) {
return null;
}
@Override
public int getTableDataCount(String tableNamePrefix, String tableName, Map<String, Object> params) {
return 0;
}
@Override
public int getColumnNotNullCount(String tableNamePrefix, String tableName, String columnName) {
return 0;
}
@Override
public int getColumnNotZeroCount(String tableNamePrefix, String tableName, String columnName) {
return 0;
}
private JdbcTemplate getJdbcTemplate() {
return new JdbcTemplate(dataSource);
}
}
#!/bin/bash
#rsync -avz web/target/milk.war member@tentop.com.cn:/opt/tomcat8/webapps/milk.war
#rsync -avz web/target/milk.war member@haomo-tech.com:/data/tomcat/webapps/milk.war
rsync -avz -e "ssh -p12322" web/target/milk.war haomo@haomo-studio.com:/opt/hm_tomcat/webapps
\ No newline at end of file
This diff is collapsed.
# 本模板的实验性特性
本文档将对潜在的第三方组件进行研究,以决定是否将其引入本模板库
## modelmapper
地址:
http://modelmapper.org/
特性:
## Query DSL
特性:
支持标准的Query DSL语言,从而使得本模板更具有通用性
参考:
http://www.jianshu.com/p/6d210f0e7577
## Apache Shiro
特性:
企业级的安全框架, 非常适合各类大中小型的应用
参考:
http://blog.csdn.net/jadyer/article/details/12208847
http://www.chengxuyuans.com/javabase/96878.html
https://shiro.apache.org/webapp-tutorial.html
http://qtdebug.com/spring-web/16.%20Shiro%20%E9%85%8D%E7%BD%AE%E7%BC%93%E5%AD%98.html
## Spring Security
特性:
比Shiro复杂不少, 建议在非常复杂的情况下使用
*.iml
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.haomostudio.milk</groupId>
<artifactId>milk</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>domain</artifactId>
<packaging>jar</packaging>
<name>domain</name>
<description>domain</description>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<finalName>domain</finalName>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
package com.haomostudio.JuniorSpringMVCTemplate.common.domain;
/**
*
*/
public class Column {
private String name;
private String dataType;
private int length;
private boolean isNull;
private boolean isKey;
private boolean autoIncrement;
private Integer decimalPlace;
public Integer getDecimalPlace() { return decimalPlace; }
public void setDecimalPlace(Integer decimalPlace) { this.decimalPlace = decimalPlace; }
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public int getLength() {
return length;
}
public void setLength(int length) {
this.length = length;
}
public boolean isNull() {
return isNull;
}
public void setIsNull(boolean isNull) {
this.isNull = isNull;
}
public boolean isKey() {
return isKey;
}
public void setIsKey(boolean isKey) {
this.isKey = isKey;
}
public boolean isAutoIncrement() {
return autoIncrement;
}
public void setAutoIncrement(boolean autoIncrement) {
this.autoIncrement = autoIncrement;
}
}
package com.haomostudio.JuniorSpringMVCTemplate.common.domain;
/**
* Created by macam on 16/4/15.
*/
public enum ColumnOperator {
equal("eq", "="),
neq("neq", "<>"),
lt("lt", "<"),
lte("lte", "<="),
gt("gt", ">"),
gte("gte", ">="),
like("like", "like"),
isNull("is null", "is null"),
isNotNull("is not null", "is not null");
private String operatorName;
private String dbOperator;
ColumnOperator(String operatorName, String dbOperator) {
this.operatorName = operatorName;
this.dbOperator = dbOperator;
}
public String getOperatorName() {
return operatorName;
}
public void setOperatorName(String operatorName) {
this.operatorName = operatorName;
}
public String getDbOperator() {
return dbOperator;
}
public void setDbOperator(String dbOperator) {
this.dbOperator = dbOperator;
}
}
\ No newline at end of file
package com.haomostudio.JuniorSpringMVCTemplate.common.util;
import org.apache.commons.beanutils.BeanUtils;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class BeanHelper<T> {
private final Class<T> clazz;
public BeanHelper(Class<T> clazz) {
this.clazz = clazz;
}
public List<T> convert(List<Map<String, Object>> mapList) {
try {
ArrayList e = new ArrayList();
Iterator var4 = mapList.iterator();
while(var4.hasNext()) {
Map map = (Map)var4.next();
Object tempClass = this.clazz.newInstance();
this.setValue(tempClass, map);
e.add(tempClass);
}
return e;
} catch (Exception var6) {
return null;
}
}
public int setValue(Object bean, Map<?, ?> map) throws Exception {
int cnt = 0;
if(bean != null && map != null) {
Iterator names = map.keySet().iterator();
while(names.hasNext()) {
String name = (String)names.next();
if(name != null) {
Object value = map.get(name);
this.setProperty(bean, name, value);
++cnt;
}
}
return cnt;
} else {
return cnt;
}
}
public void setProperty(Object bean, String name, Object value) throws Exception {
try {
BeanUtils.copyProperty(bean, name, value);
} catch (Exception var5) {
throw new Exception("Set Value Error, Value: " + value.toString() + " Fields: " + name + ", Reason:/r/n" + var5, var5);
}
}
}
package com.haomostudio.JuniorSpringMVCTemplate.common.util;
/**
* Created by Administrator on 2016/2/27.
*/
public class Constants {
public static final char UNDERLINE = '_';
public final static String SCRIPT_PATH = "/scripts";
public final static String FORMFILE_PATH = "/form";
public final static String AVATAR_PATH = "/upload/user/avatar";
public final static String SEAFILE_COMMON_LIB = "common";
public final static String AFTER_SALES_SEAFILE_LIB = "/afterSales";
public final static String SEAFILE_LOGISTICS_DIR = "/logistics";
public final static String FILING_TENDER_SEAFILE_LIB = "/filingTender";
public static final String COLUMN_ID = "ID";
public static final String COLUMN_SCENE_INSTANCE_ID = "SCENE_INSTANCE_ID";
public static final String COLUMN_FORM_INSTANCE_ID = "FORM_INSTANCE_ID";
public static final String COLUMN_CREATE_TIME = "CREATE_TIME";
public static final String COLUMN_UPDATE_TIME = "UPDATE_TIME";
/**
* 表单引擎自定义表名前缀
*/
public static final String TABLE_NAME_PREFIX_FORM_ENGINE = "T_";
/**
* 用户自定义表名前缀
*/
public static final String TABLE_NAME_PREFIX_USER = "U_";
/**
* 部门自定义表名前缀
*/
public static final String TABLE_NAME_PREFIX_DEPARTMENT = "D_";
/**
* 客户自定义表名前缀
*/
public static final String TABLE_NAME_PREFIX_CUSTOMER = "C_";
/**
* 物料自定义表名前缀
*/
public static final String TABLE_NAME_PREFIX_MATERIAL = "M_";
/**
* 业务场景自定义表名前缀
*/
public static final String TABLE_NAME_PREFIX_SCENE = "S_";
/**
* 报修单的编号标识,和编号长度
*/
public static final String REPAIR_ORDER_NO_TYPE = "Repair_OrderNo_Type";
public static final int REPAIR_ORDER_NO_LENGTH = 4;
// 报备编号
public static final String FILING_NO_TYPE = "FILING_NO_TYPE";
public static class UserQueryConditionType {
public static final String afterSalesCallCenterQuery = "afterSalesCallCenterQuery";
}
public static class FilingHandleStatus {
// 打开
public static final String Active = "A";
// 确定(可以被合同使用)
public static final String Confirm = "C";
// 关闭/办结(手动作废)
public static final String End = "E";
// 超时
public static final String Overtime = "O";
// 待办
public static final String Wait = "W";
// 已办
public static final String Pass = "P";
// 跳过
public static final String Skip = "S";
// 中标
public static final String ZhongBiao = "O";
// 未中标
public static final String WeizhongBiao = "X";
}
}
package com.haomostudio.JuniorSpringMVCTemplate.common.util;
import com.alibaba.fastjson.JSONObject;
import com.haomostudio.JuniorSpringMVCTemplate.common.domain.Column;
import org.springframework.util.StringUtils;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class DataBaseOperationUtils {
public static final String DB_TYPE_ORACLE = "oracle";
public static final String DB_TYPE_MYSQL = "mysql";
public static final String DATA_TYPE_VARCHAR = "varchar";
public static final String DATA_TYPE_TIMESTAMP = "timestamp";
public static final String DATA_TYPE_TEXT = "text";
public static final String DATA_TYPE_INT = "int";
public static final String DATA_TYPE_FLOAT = "float";
public static final String DATA_TYPE_DOUBLE = "double";
public static List<String> getPropertyName(Object obj) {
ArrayList list = new ArrayList();
Field[] fs = obj.getClass().getDeclaredFields();
Field[] var7 = fs;
int var6 = fs.length;
for(int var5 = 0; var5 < var6; ++var5) {
Field f = var7[var5];
list.add(f.getName());
}
return list;
}
public static Object[] GetObjectArgs(Map<String, Object> map) {
return map.values().toArray();
}
public static String GetNames(Map<String, Object> map, String operation, String dbType) {
String columns = "";
try {
if("INSERT".equals(operation)) {
String params = "(";
columns = "(";
for(String key : map.keySet()) {
columns = columns + (DB_TYPE_ORACLE.equals(dbType)?"\"" + key + "\",":"`" + key + "`,");
params = params + "?,";
}
if(!"(".equals(columns)) {
columns = columns.substring(0, columns.length() - 1);
}
if(!"(".equals(params)) {
params = params.substring(0, params.length() - 1);
}
columns = columns + ")";
params = params + ")";
return columns + " VALUES" + params;
}
if("UPDATE".equals(operation)) {
for(String key : map.keySet()) {
if ("ID".equals(key)) {
continue;
}
columns = columns + (DB_TYPE_ORACLE.equals(dbType)?"\"" + key + "\"=?,":"`" + key + "`=?,");
}
if(columns.substring(columns.length() - 1, columns.length()).equals(",")) {
columns = columns.substring(0, columns.length() - 1);
}
columns = columns + " WHERE ID=?";
}
if ("DELETE".equals(operation)) {
for(String key : map.keySet()) {
columns = columns + (DB_TYPE_ORACLE.equals(dbType)?"\"" + key + "\"=? AND ":"`" + key + "`=? AND ");
}
if(columns.endsWith(" AND ")) {
columns = columns.substring(0, columns.length() - 5);
}
}
} catch (Exception var9) {
var9.printStackTrace();
}
return columns;
}
public static String getDataType(Column tc) {
if (tc.getLength() != 0) {
return tc.getDataType() + "(" + tc.getLength() + ")";
} else {
return tc.getDataType();
}
}
public static String getIsNull(Column tc) {
if (tc.isKey() && tc.isAutoIncrement()) {
return "NOT NULL AUTO_INCREMENT";
}
if ("timestamp".equals(tc.getDataType())) {
if(tc.getName().equals(Constants.COLUMN_CREATE_TIME)){
return "DEFAULT CURRENT_TIMESTAMP";
}else{
return "NULL DEFAULT NULL";
}
}
if (tc.isNull()) {
return "DEFAULT NULL";
} else {
return "NOT NULL";
}
}
public static String getPrimaryKey(List<Column> ltc) {
String pk = "PRIMARY KEY (";
for (Column tc : ltc) {
if (tc.isKey()) {
pk += "`" + tc.getName() + "`,";
}
}
if ("PRIMARY KEY (".equals(pk)) {
return "";
} else {
return pk.substring(0, pk.length() - 1) + ")";
}
}
public static String getInSQL(String params, String flag) {
String tempStr = params.replace(flag, ",");
String[] tempStrArr = tempStr.split(",");
String InSQL = "";
for(int i = 0; i < tempStrArr.length; ++i) {
InSQL = InSQL + "?,";
}
if(!"".equals(InSQL)) {
InSQL = InSQL.substring(0, InSQL.length() - 1);
}
return InSQL;
}
public static List<Object> getInArgs(String params, String flag, String dataType) {
String tempStr = params.replace(flag, ",");
String[] tempStrArr = tempStr.split(",");
ArrayList obj = new ArrayList();
int i;
if("varchar".equalsIgnoreCase(dataType) || "varchar2".equalsIgnoreCase(dataType) || "blob".equalsIgnoreCase(dataType)) {
for(i = 0; i < tempStrArr.length; ++i) {
obj.add(tempStrArr[i]);
}
} else if("integer".equals(dataType)) {
for(i = 0; i < tempStrArr.length; ++i) {
obj.add(Integer.valueOf(Integer.parseInt(tempStrArr[i])));
}
}
return obj;
}
/**
*
* Get Column
*
* additionals JSON格式
* {
'type': 1, // 字段类型
'options': [], // 可选项
'constraint': { // 字段约束
'text_length': 32, // 对于文本类型有效
'decimal': {
'is_currency': false, // 是否是货币
'decimal_place': 2 // 小数点位数
}
}
}
*
* @param columnName
* @param additionals
* @return
*/
public static Column getColumn(String columnName, String additionals) {
Column column = new Column();
column.setName(columnName);
if (null == additionals) {
column.setDataType(DATA_TYPE_VARCHAR);
column.setLength(128);
} else {
JSONObject jsonObject = JSONObject.parseObject(additionals);
String type = getDataType(jsonObject.getInteger("type"));
column.setDataType(type);
JSONObject constraint = jsonObject.getJSONObject("constraint");
if (DATA_TYPE_VARCHAR.equals(type) || DATA_TYPE_TEXT.equals(type)) {
Integer textLength = constraint.getInteger("text_length");
column.setLength(textLength);
} else if (DATA_TYPE_FLOAT.equals(type) || DATA_TYPE_DOUBLE.equals(type)) {
JSONObject decimal = constraint.getJSONObject("decimal");
Boolean isCurrency = decimal.getBoolean("is_currency");
Integer decimalPlace = decimal.getInteger("decimal_place");
}
}
if (Constants.COLUMN_ID.equals(columnName)) {
column.setIsKey(true);
}
if (Constants.COLUMN_ID.equals(columnName) || Constants.COLUMN_CREATE_TIME.equals(columnName) || Constants.COLUMN_FORM_INSTANCE_ID.equals(columnName)) {
column.setIsNull(false);
} else {
column.setIsNull(true);
}
return column;
}
private static String getDataType(int type) {
switch (type) {
case 1:
return DATA_TYPE_TEXT;
case 2:
return DATA_TYPE_VARCHAR;
case 3:
return DATA_TYPE_TIMESTAMP;
case 4:
return DATA_TYPE_TIMESTAMP;
case 5:
return DATA_TYPE_VARCHAR;
case 6:
return DATA_TYPE_VARCHAR;
case 7:
return DATA_TYPE_VARCHAR;
case 8:
return DATA_TYPE_VARCHAR;
case 9:
return DATA_TYPE_INT;
case 10:
return DATA_TYPE_DOUBLE;
case 11:
return DATA_TYPE_VARCHAR;
case 12:
return DATA_TYPE_VARCHAR;
default:
return DATA_TYPE_VARCHAR;
}
}
public static String getMySQLTableName(String prefix, String tableName) {
return "`" + getFinalTableName(prefix, tableName) + "`";
}
public static String getOracleTableName(String prefix, String tableName) {
return "\"" + getFinalTableName(prefix, tableName) + "\"";
}
private static String getFinalTableName(String prefix, String tableName) {
String finalName = "";
if (!StringUtils.isEmpty(prefix)) {
finalName += prefix.trim();
finalName += tableName.trim().toUpperCase();
} else {
finalName += tableName.trim().toLowerCase();
}
return finalName;
}
}
package com.haomostudio.JuniorSpringMVCTemplate.common.util;
import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.*;
public class SuperBeanHelper<T> {
private final Class<T> clazz;
public SuperBeanHelper(Class<T> clazz) {
this.clazz = clazz;
}
public List<String> getPropertyName(Object obj) {
ArrayList list = new ArrayList();
Field[] fs = obj.getClass().getDeclaredFields();
Field[] var7 = fs;
int var6 = fs.length;
for(int var5 = 0; var5 < var6; ++var5) {
Field f = var7[var5];
list.add(f.getName());
}
return list;
}
public List<T> convert(List<Map<String, Object>> res) {
ArrayList list = new ArrayList();
try {
Iterator var4 = res.iterator();
while(var4.hasNext()) {
Map e = (Map)var4.next();
Object tempClass = this.clazz.newInstance();
List propertyName = this.getPropertyName(tempClass);
for(int i = 0; i < propertyName.size(); ++i) {
Field f = tempClass.getClass().getDeclaredField(((String)propertyName.get(i)).toString());
f.setAccessible(true);
try {
if(f.getType().getName().equals("int")) {
f.set(tempClass, Integer.valueOf(Integer.parseInt(e.get(((String)propertyName.get(i)).toString().trim()).toString())));
} else if(f.getType().getName().equals("java.util.Date")) {
SimpleDateFormat e1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date d = e1.parse(e.get(((String)propertyName.get(i)).toString().trim()).toString());
f.set(tempClass, d);
} else {
f.set(tempClass, e.get(((String)propertyName.get(i)).toString().trim()));
}
} catch (Exception var11) {
System.out.println(var11.getMessage());
}
}
list.add(tempClass);
}
} catch (Exception var12) {
System.out.println(var12.getMessage());
}
return list;
}
}
package com.haomostudio.JuniorSpringMVCTemplate.po;
import java.util.Date;
public class AboutUs {
private String id;
private String content;
private Date createTime;
private Date lastUpdateTime;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getLastUpdateTime() {
return lastUpdateTime;
}
public void setLastUpdateTime(Date lastUpdateTime) {
this.lastUpdateTime = lastUpdateTime;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", content=").append(content);
sb.append(", createTime=").append(createTime);
sb.append(", lastUpdateTime=").append(lastUpdateTime);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.haomostudio.JuniorSpringMVCTemplate.po.update;
import java.io.Serializable;
/**
* Created by wuchunyang on 2017/7/28.
*/
public class UploadFile implements Serializable {
private String saveName ;
private String fileName ;
private String visitName ;
public String getSaveName() {
return saveName;
}
public void setSaveName(String saveName) {
this.saveName = saveName;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getVisitName() {
return visitName;
}
public void setVisitName(String visitName) {
this.visitName = visitName;
}
@Override
public String toString() {
return "UploadFile{" +
"saveName='" + saveName + '\'' +
", fileName='" + fileName + '\'' +
", visitName='" + visitName + '\'' +
'}';
}
}
package com.haomostudio.JuniorSpringMVCTemplate.vo;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.haomostudio.JuniorSpringMVCTemplate.po.AboutUs;
public class AboutUsVO{
@JsonProperty("includes")
private Map<String, Object> includes;
@JsonProperty("refers")
private Map<String, List<Object>> refers;
@JsonProperty("relates")
private Map<String, List<Object>> relates;
private AboutUs superior;
public AboutUs getSuperior() {
return superior;
}
public AboutUsVO(AboutUs superior){
this.superior = superior;
this.includes = new HashMap<>();
this.refers = new HashMap<>();
this.relates = new HashMap<>();
}
public void setSuperior(AboutUs superior) {
this.superior = superior;
}
public void setIncludes(Map<String, Object>includes){
this.includes = includes;
}
public Map<String, Object> getIncludes(){
return this.includes;
}
public void setRefers(Map<String, List<Object>> refers){
this.refers = refers;
}
public Map<String, List<Object>> getRefers(){
return this.refers;
}
public void setRelates(Map<String, List<Object>> relates){
this.relates = relates;
}
public Map<String, List<Object>> getRelates(){
return this.relates;
}
}
package com.haomostudio.Util;
/**
* Created by guanpb on 2018/3/16.
*/
import java.util.List;
/**
* Created by guanpb on 2017/9/18.
*/
public class Util {
public static String dealFieldsValuesDataBaseOR(List<String> fields, List<String> values, String column){
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("( ");
if (fields == null || values == null
|| (fields != null && fields.size() == 0)
|| (values != null && fields.size() == 0) ){
return "1=1";
}
if (fields.size() > 1 && values.size() > 1){
int i =0;
for (String value:values){
if (column.contains("like")){
stringBuffer.append(fields.get(i)+" like '%"+value+"%' or ");
}else {
stringBuffer.append(fields.get(i)+" = '"+value+"' or ");
}
i++;
}
}else {
boolean fieldsOrValue = fields.size() == 1;
List<String> lists = fieldsOrValue?values:fields;
lists.stream().forEach(list->{
if (column.contains("like")){
stringBuffer.append((fieldsOrValue?fields.get(0):list)+" like '%"+(fieldsOrValue?list:values.get(0))+"%' or ");
}else {
stringBuffer.append((fieldsOrValue?fields.get(0):list)+" = '"+(fieldsOrValue?list:values.get(0))+"' or ");
}
});
}
stringBuffer.delete(stringBuffer.length()-4,stringBuffer.length()-1);
stringBuffer.append(") ");
if (fields.size() == 1 && values.size() == 1){
return stringBuffer.toString().replace(" or","");
}
return stringBuffer.toString();
}
}
\ No newline at end of file
## po、vo、pojo的区别,以及创建放置
### 1. PO(persistant object) 持久对象
在o/r 映射的时候出现的概念,如果没有o/r映射,就没有这个概念存在了.通常对应数据模型(数据库),本身还有部分业务逻辑的处理.可以看成是与数据库中的表相映射的java对象.最简单的PO就是对应数据库中某个表中的一条记录,多个记录可以用PO的集合.PO中应该不包含任何对数据库的操作.
> 放置跟数据库对应的实体类
### 2. VO(value object) 值对象
通常用于业务层之间的数据传递,和PO一样也是仅仅包含数据而已.但应是抽象出的业务对象,可以和表对应,也可以不,这根据业务的需要.个人觉得同DTO(数据传输对象),在web上传递.
> 跟po对应的包装类
### 3. POJO(plain ordinary java object) 简单无规则java对象
纯的传统意义的java对象.就是说在一些Object/Relation Mapping工具中,能够做到维护数据库表记录的persisent object完全是一个符合Java Bean规范的纯Java对象,没有增加别的属性和方法.我的理解就是最基本的Java Bean,只有属性字段及setter和getter方法!.
> 存放我们自己创建简单无须的类,例如导出excel配置的实体类。
\ No newline at end of file
#!/bin/bash
read -p "请输入git的commit内容:" -t 60 commit #等待60秒
echo $commit
git add .
git commit -m "$commit"
git pull
git push
This diff is collapsed.
##部门
1. id ==> code code 从16位变为128位 【done】
2. 增加启用\禁
3. department_type_id 0:部门 1:分部
4. 三级结构缺失
##operator
###创建者
1. 创建人 【done】
2. 创建人经理 【done】
3. 创建人本分部 [done]
4. 创建人本部门 【done】
5. 创建人上级部门【done】
6. 分部 [done]
7. 部门 [done]
8. 角色 [done]
9. 人力资源 [done]
10. 所有人 [done]
###人力资源字段
1. 人力资源字段本人
2. 人力资源字段经理
3. 人力资源字段本分部
4. 人力资源字段本部门
5. 人力资源字段上级部门
6. 分部
7. 部门
8. 角色
9. 角色人员
###节点操作者
1. 节点操作者本人
2. 节点操作者经理
##操作条件
###创建人
1. 创建人 【done】
2. 创建人经理 【done】
3. 创建部门 【done】
4. 创建人本分部 【done】
###表单条件
1. 数字 [lt\lte\gt\gte] [done]
2. 日期 [lt\lte\gt\gte] [done]
3. 时间 [lt\lte\gt\gte] [done]
3. 字符串 [done] eq\neq\contain\no-contain
4. 外链 [in\not-in] [done]
##会签操作
1. 表明一个节点
\ No newline at end of file
This diff is collapsed.
*.iml
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.haomostudio.milk</groupId>
<artifactId>milk</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>service</artifactId>
<packaging>jar</packaging>
<name>service</name>
<description>service</description>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.haomostudio.milk</groupId>
<artifactId>dao</artifactId>
<version>${milk.dao.version}</version>
</dependency>
<dependency>
<groupId>com.haomostudio.milk</groupId>
<artifactId>domain</artifactId>
<version>${milk.dao.version}</version>
</dependency>
<dependency>
<groupId>com.sap</groupId>
<artifactId>sapjco3</artifactId>
<version>0.9.32</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/sapjco3.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
</dependencies>
<build>
<finalName>service</finalName>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
package com.haomostudio.JuniorSpringMVCTemplate.service;
import com.haomostudio.JuniorSpringMVCTemplate.po.AboutUs;
import java.util.List;
/**
* Created by hxgqh on 2016/1/7.
*/
public interface AboutUsService {
int create(AboutUs item);
int delete(String id);
int update(AboutUs item);
AboutUs get(String id);
/**
* 获取列表
* @param pageNo 整数,如1
* @param pageSize 整数,如10
* @param sortItem 格式为"id, name"
* @param sortOrder 格式为"asc, desc"
* @param filters JSON字符串,格式为
* {
* table:
* {
* column1: {
* like: '%abc%',
* notLike: ''
* between: [1, 10],
* notBetween: [1, 10]
* isNull: true, // 只能为true
* isNotNull: true, // 只能为true
* equalTo: "abc",
* notEqualTo: "abc",
* greaterThan: 10,
* greaterThanOrEqualTo: 10,
* lessThan: 10,
* lessThanOrEqualTo: 10,
* in: [],
* notIn: []
* }
* }
* }
* @return 列表
*/
List<AboutUs> getListWithPagingAndFilter(Integer pageNo, Integer pageSize,
String sortItem, String sortOrder,
String filters);
/**
* 获取列表
* @param pageNo 整数,如1
* @param pageSize 整数,如10
* @param sortItem 格式为"id, name"
* @param sortOrder 格式为"asc, desc"
* @param filters JSON字符串, 用来过滤列表的数据, 格式为
* {
* table:
* {
* column1: {
* like: '%abc%',
* notLike: ''
* between: [1, 10],
* notBetween: [1, 10]
* isNull: true, // 只能为true
* isNotNull: true, // 只能为true
* equalTo: "abc",
* notEqualTo: "abc",
* greaterThan: 10,
* greaterThanOrEqualTo: 10,
* lessThan: 10,
* lessThanOrEqualTo: 10,
* in: [],
* notIn: []
* }
* }
* }
* @param includes JSON字符串, 用来将本表的外链字段(table_id类似的字段)指向的外链表的完整行数据返回, 格式为
* {
* 'include_table1': {
* includes: ['include_table11', 'include_table12']
* },
* 'include_table2': {
* includes: ['include_table21', 'include_table22']
* }
* }
* @param refers JSON字符串, 用来将其他表的外链字段为本表的表数据返回, 格式为
* {
* 'refer_table1': {
* includes: ['include_table11', 'include_table12']
* },
* 'refer_table2': {
* includes: ['include_table21', 'include_table22']
* }
* }
* @param relates JSON字符串, 用来将其他有间接关系的表(所谓间接关系, 一定是跟本表的某个字段名一致, 且指向同一张表)
* {
* 'relate_table1': ['column1', 'column2'],
* 'relate_table1': ['column3', 'column4']
* }
* @return 列表
*/
Object getListWithPagingAndFilter(Integer pageNo, Integer pageSize,
String sortItem, String sortOrder,
String filters,
String includes,
String refers,
String relates);
/**
* 获取列表数量
* @param filters JSON字符串, 用来过滤列表的数据, 格式为
* {
* table:
* {
* column1: {
* like: '%abc%',
* notLike: ''
* between: [1, 10],
* notBetween: [1, 10]
* isNull: true, // 只能为true
* isNotNull: true, // 只能为true
* equalTo: "abc",
* notEqualTo: "abc",
* greaterThan: 10,
* greaterThanOrEqualTo: 10,
* lessThan: 10,
* lessThanOrEqualTo: 10,
* in: [],
* notIn: []
* }
* }
* }
* @return 列表计数
*/
Long countListWithPagingAndFilter(String filters);
}
package com.haomostudio.JuniorSpringMVCTemplate.service.common;
/**
*
* 保存各系统之间的TOKEN的JAVA BEAN
*
* Created by steven on 2016/1/6.
*/
public class Token {
private String userId;
private String token;
private String seaFileToken;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getSeaFileToken() {
return seaFileToken;
}
public void setSeaFileToken(String seaFileToken) {
this.seaFileToken = seaFileToken;
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment