初版数据库确定

This commit is contained in:
Yutousama 2021-10-29 09:17:33 +08:00
parent b526b80158
commit 67869ee32e
29 changed files with 4124 additions and 301 deletions

16
pom.xml
View File

@ -41,12 +41,16 @@
<dependency> <dependency>
<groupId>org.mybatis.spring.boot</groupId> <groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId> <artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version> <version>2.2.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.67</version> <version>1.2.78</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
@ -64,6 +68,14 @@
</excludes> </excludes>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>16</source>
<target>16</target>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>

View File

@ -0,0 +1,8 @@
package com.yutou.mobilecloud.Controllers;
import org.springframework.stereotype.Controller;
@Controller
public class BackupController {
}

View File

@ -0,0 +1,76 @@
package com.yutou.mobilecloud.Controllers;
import com.alibaba.fastjson.JSONObject;
import com.yutou.mobilecloud.Enums.UserEnum;
import com.yutou.mobilecloud.Services.IUser;
import com.yutou.mobilecloud.mybatis.model.TUser;
import com.yutou.mobilecloud.utils.UserTools;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
@Controller
public class UserController {
@Resource
IUser iUser;
@RequestMapping("/user/sign.do")
@ResponseBody
public JSONObject userSign(String username, String password) {
JSONObject json = new JSONObject();
TUser user = new TUser();
user.setUsername(username);
user.setPassword(password);
UserEnum signEnum = iUser.userSign(user);
user = iUser.getUser(user);
json.put("code", signEnum.getCode());
json.put("msg", signEnum.getMsg());
if (signEnum == UserEnum.SIGN_SUCCESS) {
JSONObject data = new JSONObject();
data.put("token", UserTools.getToken(user));
json.put("data", data);
}
return json;
}
@RequestMapping("/user/login.do")
@ResponseBody
public JSONObject login(String username, String password,String token) {
JSONObject json = new JSONObject();
TUser user = new TUser();
UserEnum userEnum;
if(StringUtils.hasLength(token)) {
user.setUsername(username);
user.setPassword(password);
userEnum = iUser.login(user);
}else {
int check=UserTools.checkTokenGetUid(token);
switch (check) {
case -1 -> userEnum = UserEnum.LOGIN_FAIL_TOKEN;
case -2 -> userEnum = UserEnum.LOGIN_FAIL_TIMEOUT;
default -> {
userEnum = UserEnum.LOGIN_SUCCESS;
user.setId(check);
}
}
}
json.put("code", userEnum.getCode());
json.put("msg", userEnum.getMsg());
if (userEnum == UserEnum.LOGIN_SUCCESS) {
user= iUser.getUser(user);
json.put("data", loginJson(user));
}
return json;
}
public JSONObject loginJson(TUser user) {
JSONObject json=new JSONObject();
json.put("token",UserTools.getToken(user));
return json;
}
}

View File

@ -0,0 +1,32 @@
package com.yutou.mobilecloud.Enums;
public enum UserEnum {
LOGIN_SUCCESS(0,"成功"),LOGIN_FAIL_PASSWORD(-1,"密码错误"),LOGIN_FAIL_NOT_USER(-2,"账号错误"),
LOGIN_FAIL_TIMEOUT(-3,"登陆超时"),LOGIN_FAIL_TOKEN(-4,"token错误"),
SIGN_SUCCESS(0,"成功"),SIGN_FAIL_USER_EXIST(-1,"用户已存在"), SIGN_FAIL_PARAMETER(-2,"参数错误");
private int code;
private String msg;
UserEnum(int code,String msg){
this.code=code;
this.msg=msg;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}

View File

@ -0,0 +1,19 @@
package com.yutou.mobilecloud.Services;
import com.yutou.mobilecloud.mybatis.model.*;
import java.util.List;
public interface IBackup {
boolean addImage(TUser user, TBackupFile backupFile, TBackupImage image);
boolean addApp(TUser user, TBackupFile backupFile, TBackupApp app);
boolean addNumber(TUser user, TBackupFile backupFile, TBackupInfo info, TUserConfig config);
boolean addMessage(TUser user, TBackupFile backupFile, TBackupInfo info, TUserConfig config);
boolean removeImage(int bid);
boolean removeApp(int bid);
boolean removeInfo(int bid);
List<TBackupImage> getImageList(int uid);
List<TBackupApp> getAppList(int uid);
List<TBackupInfo> getInfoList(int uid);
}

View File

@ -0,0 +1,14 @@
package com.yutou.mobilecloud.Services;
import com.yutou.mobilecloud.Enums.UserEnum;
import com.yutou.mobilecloud.mybatis.model.TUser;
public interface IUser {
UserEnum userSign(TUser user);
UserEnum login(TUser user);
boolean isNewUser(TUser user);
TUser getUser(String token);
TUser getUser(TUser user);
TUser getUser(int uid);
}

View File

@ -0,0 +1,116 @@
package com.yutou.mobilecloud.Services.impls;
import com.yutou.mobilecloud.Services.IBackup;
import com.yutou.mobilecloud.mybatis.dao.*;
import com.yutou.mobilecloud.mybatis.model.*;
import com.yutou.mobilecloud.utils.Tools;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Service("Backup")
public class IBackupImpl implements IBackup {
@Resource
TUserDao userDao;
@Resource
TBackupFileDao fileDao;
@Resource
TBackupImageDao imageDao;
@Resource
TBackupAppDao appDao;
@Resource
TBackupInfoDao infoDao;
@Resource
TUserConfigDao configDao;
@Override
public boolean addImage(TUser user, TBackupFile backupFile, TBackupImage image) {
int fid = getFileId(backupFile, user, "images" + File.separator + image.getPath().replace("/", File.separator));
image.setFid(fid);
image.setUid(user.getId());
image.setCreatetime(new Date());
return imageDao.insert(image) > 0;
}
@Override
public boolean addApp(TUser user, TBackupFile backupFile, TBackupApp app) {
int fid = getFileId(backupFile, user, "apps");
app.setFid(fid);
app.setUid(user.getId());
app.setCreatetime(new Date());
return appDao.insert(app) > 0;
}
@Override
public boolean addNumber(TUser user, TBackupFile backupFile, TBackupInfo info, TUserConfig config) {
int fid = getFileId(backupFile, user, "phone"+File.separator+"number");
info.setFid(fid);
info.setUid(info.getUid());
info.setCreatetime(new Date());
return infoDao.insert(info) > 0;
}
@Override
public boolean addMessage(TUser user, TBackupFile backupFile, TBackupInfo info, TUserConfig config) {
int fid = getFileId(backupFile, user, "phone"+File.separator+"message");
info.setFid(fid);
info.setUid(info.getUid());
info.setCreatetime(new Date());
return infoDao.insert(info) > 0;
}
@Override
public boolean removeImage(int bid) {
return false;
}
@Override
public boolean removeApp(int bid) {
return false;
}
@Override
public boolean removeInfo(int bid) {
return false;
}
@Override
public List<TBackupImage> getImageList(int uid) {
return null;
}
@Override
public List<TBackupApp> getAppList(int uid) {
return null;
}
@Override
public List<TBackupInfo> getInfoList(int uid) {
return null;
}
private int getFileId(TBackupFile file, TUser user, String dir) {
File path = new File("backups" + File.separator + user.getId() + File.separator + dir);
if (!path.exists()) {
path.mkdirs();
}
File _file = new File(file.getFilepath());
File newFile = new File(path.getAbsolutePath() + File.separator + Tools.getToDayNowTimeToFileName() + "_" + file.getFilename());
_file.renameTo(newFile);
file.setFilepath(newFile.getAbsolutePath());
return fileDao.insert(file);
}
private File getBackupPath(TUser user, String dir) {
File file = new File("backups" + File.separator + user.getId() + File.separator + dir);
if (!file.exists()) {
file.mkdirs();
}
return file;
}
}

View File

@ -0,0 +1,93 @@
package com.yutou.mobilecloud.Services.impls;
import com.yutou.mobilecloud.Enums.UserEnum;
import com.yutou.mobilecloud.Services.IUser;
import com.yutou.mobilecloud.mybatis.dao.TUserDao;
import com.yutou.mobilecloud.mybatis.model.TUser;
import com.yutou.mobilecloud.mybatis.model.TUserExample;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import static com.yutou.mobilecloud.utils.UserTools.checkTokenGetUid;
@Service("User")
public class IUserImpl implements IUser {
public static final String LOGIN_KEY = "G9PRGhDXDVAbK1He";
@Resource
TUserDao userDao;
@Override
public UserEnum userSign(TUser user) {
if (isNewUser(user)) {
if (StringUtils.hasLength(user.getUsername()) &&
StringUtils.hasLength(user.getPassword())
) {
user.setCreatetime(new Date());
userDao.insert(user);
return UserEnum.SIGN_SUCCESS;
}
return UserEnum.SIGN_FAIL_PARAMETER;
}
return UserEnum.SIGN_FAIL_USER_EXIST;
}
@Override
public UserEnum login(TUser user) {
TUserExample example = new TUserExample();
example.createCriteria().andUsernameEqualTo(user.getUsername())
.andPasswordEqualTo(user.getPassword());
if (userDao.selectByExample(example).isEmpty()) {
example.clear();
example.createCriteria().andUsernameEqualTo(user.getUsername());
if (userDao.selectByExample(example).isEmpty()) {
return UserEnum.LOGIN_FAIL_NOT_USER;
}
return UserEnum.LOGIN_FAIL_NOT_USER;
}
return UserEnum.LOGIN_SUCCESS;
}
@Override
public boolean isNewUser(TUser user) {
TUserExample example = new TUserExample();
example.createCriteria().andUsernameEqualTo(user.getUsername());
return !userDao.selectByExample(example).isEmpty();
}
@Override
public TUser getUser(String token) {
int uid=checkTokenGetUid(token);
if(uid>0){
return userDao.selectByPrimaryKey(uid);
}
return null;
}
@Override
public TUser getUser(TUser user) {
TUserExample example=new TUserExample();
example.createCriteria().andUsernameEqualTo(user.getUsername()).andPasswordEqualTo(user.getPassword());
List<TUser> list=userDao.selectByExample(example);
if(list.isEmpty()){
return null;
}
return list.get(0);
}
@Override
public TUser getUser(int uid) {
return userDao.selectByPrimaryKey(uid);
}
public static void main(String[] args) {
TUser user=new TUser();
user.setUsername("123");
System.out.println(user);
}
}

View File

@ -0,0 +1,30 @@
package com.yutou.mobilecloud.mybatis.dao;
import com.yutou.mobilecloud.mybatis.model.TBackupApp;
import com.yutou.mobilecloud.mybatis.model.TBackupAppExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TBackupAppDao {
long countByExample(TBackupAppExample example);
int deleteByExample(TBackupAppExample example);
int deleteByPrimaryKey(Integer id);
int insert(TBackupApp record);
int insertSelective(TBackupApp record);
List<TBackupApp> selectByExample(TBackupAppExample example);
TBackupApp selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") TBackupApp record, @Param("example") TBackupAppExample example);
int updateByExample(@Param("record") TBackupApp record, @Param("example") TBackupAppExample example);
int updateByPrimaryKeySelective(TBackupApp record);
int updateByPrimaryKey(TBackupApp record);
}

View File

@ -0,0 +1,30 @@
package com.yutou.mobilecloud.mybatis.dao;
import com.yutou.mobilecloud.mybatis.model.TBackupImage;
import com.yutou.mobilecloud.mybatis.model.TBackupImageExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TBackupImageDao {
long countByExample(TBackupImageExample example);
int deleteByExample(TBackupImageExample example);
int deleteByPrimaryKey(Integer id);
int insert(TBackupImage record);
int insertSelective(TBackupImage record);
List<TBackupImage> selectByExample(TBackupImageExample example);
TBackupImage selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") TBackupImage record, @Param("example") TBackupImageExample example);
int updateByExample(@Param("record") TBackupImage record, @Param("example") TBackupImageExample example);
int updateByPrimaryKeySelective(TBackupImage record);
int updateByPrimaryKey(TBackupImage record);
}

View File

@ -0,0 +1,30 @@
package com.yutou.mobilecloud.mybatis.dao;
import com.yutou.mobilecloud.mybatis.model.TBackupInfo;
import com.yutou.mobilecloud.mybatis.model.TBackupInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface TBackupInfoDao {
long countByExample(TBackupInfoExample example);
int deleteByExample(TBackupInfoExample example);
int deleteByPrimaryKey(Integer id);
int insert(TBackupInfo record);
int insertSelective(TBackupInfo record);
List<TBackupInfo> selectByExample(TBackupInfoExample example);
TBackupInfo selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") TBackupInfo record, @Param("example") TBackupInfoExample example);
int updateByExample(@Param("record") TBackupInfo record, @Param("example") TBackupInfoExample example);
int updateByPrimaryKeySelective(TBackupInfo record);
int updateByPrimaryKey(TBackupInfo record);
}

View File

@ -0,0 +1,28 @@
package com.yutou.mobilecloud.mybatis.model;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* t_backup_app
* @author
*/
@Data
public class TBackupApp implements Serializable {
private Integer id;
private Integer uid;
private Integer fid;
private String appname;
private String apppackagename;
private String appversion;
private Date createtime;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,652 @@
package com.yutou.mobilecloud.mybatis.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TBackupAppExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TBackupAppExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUidIsNull() {
addCriterion("`uid` is null");
return (Criteria) this;
}
public Criteria andUidIsNotNull() {
addCriterion("`uid` is not null");
return (Criteria) this;
}
public Criteria andUidEqualTo(Integer value) {
addCriterion("`uid` =", value, "uid");
return (Criteria) this;
}
public Criteria andUidNotEqualTo(Integer value) {
addCriterion("`uid` <>", value, "uid");
return (Criteria) this;
}
public Criteria andUidGreaterThan(Integer value) {
addCriterion("`uid` >", value, "uid");
return (Criteria) this;
}
public Criteria andUidGreaterThanOrEqualTo(Integer value) {
addCriterion("`uid` >=", value, "uid");
return (Criteria) this;
}
public Criteria andUidLessThan(Integer value) {
addCriterion("`uid` <", value, "uid");
return (Criteria) this;
}
public Criteria andUidLessThanOrEqualTo(Integer value) {
addCriterion("`uid` <=", value, "uid");
return (Criteria) this;
}
public Criteria andUidIn(List<Integer> values) {
addCriterion("`uid` in", values, "uid");
return (Criteria) this;
}
public Criteria andUidNotIn(List<Integer> values) {
addCriterion("`uid` not in", values, "uid");
return (Criteria) this;
}
public Criteria andUidBetween(Integer value1, Integer value2) {
addCriterion("`uid` between", value1, value2, "uid");
return (Criteria) this;
}
public Criteria andUidNotBetween(Integer value1, Integer value2) {
addCriterion("`uid` not between", value1, value2, "uid");
return (Criteria) this;
}
public Criteria andFidIsNull() {
addCriterion("fid is null");
return (Criteria) this;
}
public Criteria andFidIsNotNull() {
addCriterion("fid is not null");
return (Criteria) this;
}
public Criteria andFidEqualTo(Integer value) {
addCriterion("fid =", value, "fid");
return (Criteria) this;
}
public Criteria andFidNotEqualTo(Integer value) {
addCriterion("fid <>", value, "fid");
return (Criteria) this;
}
public Criteria andFidGreaterThan(Integer value) {
addCriterion("fid >", value, "fid");
return (Criteria) this;
}
public Criteria andFidGreaterThanOrEqualTo(Integer value) {
addCriterion("fid >=", value, "fid");
return (Criteria) this;
}
public Criteria andFidLessThan(Integer value) {
addCriterion("fid <", value, "fid");
return (Criteria) this;
}
public Criteria andFidLessThanOrEqualTo(Integer value) {
addCriterion("fid <=", value, "fid");
return (Criteria) this;
}
public Criteria andFidIn(List<Integer> values) {
addCriterion("fid in", values, "fid");
return (Criteria) this;
}
public Criteria andFidNotIn(List<Integer> values) {
addCriterion("fid not in", values, "fid");
return (Criteria) this;
}
public Criteria andFidBetween(Integer value1, Integer value2) {
addCriterion("fid between", value1, value2, "fid");
return (Criteria) this;
}
public Criteria andFidNotBetween(Integer value1, Integer value2) {
addCriterion("fid not between", value1, value2, "fid");
return (Criteria) this;
}
public Criteria andAppnameIsNull() {
addCriterion("appName is null");
return (Criteria) this;
}
public Criteria andAppnameIsNotNull() {
addCriterion("appName is not null");
return (Criteria) this;
}
public Criteria andAppnameEqualTo(String value) {
addCriterion("appName =", value, "appname");
return (Criteria) this;
}
public Criteria andAppnameNotEqualTo(String value) {
addCriterion("appName <>", value, "appname");
return (Criteria) this;
}
public Criteria andAppnameGreaterThan(String value) {
addCriterion("appName >", value, "appname");
return (Criteria) this;
}
public Criteria andAppnameGreaterThanOrEqualTo(String value) {
addCriterion("appName >=", value, "appname");
return (Criteria) this;
}
public Criteria andAppnameLessThan(String value) {
addCriterion("appName <", value, "appname");
return (Criteria) this;
}
public Criteria andAppnameLessThanOrEqualTo(String value) {
addCriterion("appName <=", value, "appname");
return (Criteria) this;
}
public Criteria andAppnameLike(String value) {
addCriterion("appName like", value, "appname");
return (Criteria) this;
}
public Criteria andAppnameNotLike(String value) {
addCriterion("appName not like", value, "appname");
return (Criteria) this;
}
public Criteria andAppnameIn(List<String> values) {
addCriterion("appName in", values, "appname");
return (Criteria) this;
}
public Criteria andAppnameNotIn(List<String> values) {
addCriterion("appName not in", values, "appname");
return (Criteria) this;
}
public Criteria andAppnameBetween(String value1, String value2) {
addCriterion("appName between", value1, value2, "appname");
return (Criteria) this;
}
public Criteria andAppnameNotBetween(String value1, String value2) {
addCriterion("appName not between", value1, value2, "appname");
return (Criteria) this;
}
public Criteria andApppackagenameIsNull() {
addCriterion("appPackageName is null");
return (Criteria) this;
}
public Criteria andApppackagenameIsNotNull() {
addCriterion("appPackageName is not null");
return (Criteria) this;
}
public Criteria andApppackagenameEqualTo(String value) {
addCriterion("appPackageName =", value, "apppackagename");
return (Criteria) this;
}
public Criteria andApppackagenameNotEqualTo(String value) {
addCriterion("appPackageName <>", value, "apppackagename");
return (Criteria) this;
}
public Criteria andApppackagenameGreaterThan(String value) {
addCriterion("appPackageName >", value, "apppackagename");
return (Criteria) this;
}
public Criteria andApppackagenameGreaterThanOrEqualTo(String value) {
addCriterion("appPackageName >=", value, "apppackagename");
return (Criteria) this;
}
public Criteria andApppackagenameLessThan(String value) {
addCriterion("appPackageName <", value, "apppackagename");
return (Criteria) this;
}
public Criteria andApppackagenameLessThanOrEqualTo(String value) {
addCriterion("appPackageName <=", value, "apppackagename");
return (Criteria) this;
}
public Criteria andApppackagenameLike(String value) {
addCriterion("appPackageName like", value, "apppackagename");
return (Criteria) this;
}
public Criteria andApppackagenameNotLike(String value) {
addCriterion("appPackageName not like", value, "apppackagename");
return (Criteria) this;
}
public Criteria andApppackagenameIn(List<String> values) {
addCriterion("appPackageName in", values, "apppackagename");
return (Criteria) this;
}
public Criteria andApppackagenameNotIn(List<String> values) {
addCriterion("appPackageName not in", values, "apppackagename");
return (Criteria) this;
}
public Criteria andApppackagenameBetween(String value1, String value2) {
addCriterion("appPackageName between", value1, value2, "apppackagename");
return (Criteria) this;
}
public Criteria andApppackagenameNotBetween(String value1, String value2) {
addCriterion("appPackageName not between", value1, value2, "apppackagename");
return (Criteria) this;
}
public Criteria andAppversionIsNull() {
addCriterion("appVersion is null");
return (Criteria) this;
}
public Criteria andAppversionIsNotNull() {
addCriterion("appVersion is not null");
return (Criteria) this;
}
public Criteria andAppversionEqualTo(String value) {
addCriterion("appVersion =", value, "appversion");
return (Criteria) this;
}
public Criteria andAppversionNotEqualTo(String value) {
addCriterion("appVersion <>", value, "appversion");
return (Criteria) this;
}
public Criteria andAppversionGreaterThan(String value) {
addCriterion("appVersion >", value, "appversion");
return (Criteria) this;
}
public Criteria andAppversionGreaterThanOrEqualTo(String value) {
addCriterion("appVersion >=", value, "appversion");
return (Criteria) this;
}
public Criteria andAppversionLessThan(String value) {
addCriterion("appVersion <", value, "appversion");
return (Criteria) this;
}
public Criteria andAppversionLessThanOrEqualTo(String value) {
addCriterion("appVersion <=", value, "appversion");
return (Criteria) this;
}
public Criteria andAppversionLike(String value) {
addCriterion("appVersion like", value, "appversion");
return (Criteria) this;
}
public Criteria andAppversionNotLike(String value) {
addCriterion("appVersion not like", value, "appversion");
return (Criteria) this;
}
public Criteria andAppversionIn(List<String> values) {
addCriterion("appVersion in", values, "appversion");
return (Criteria) this;
}
public Criteria andAppversionNotIn(List<String> values) {
addCriterion("appVersion not in", values, "appversion");
return (Criteria) this;
}
public Criteria andAppversionBetween(String value1, String value2) {
addCriterion("appVersion between", value1, value2, "appversion");
return (Criteria) this;
}
public Criteria andAppversionNotBetween(String value1, String value2) {
addCriterion("appVersion not between", value1, value2, "appversion");
return (Criteria) this;
}
public Criteria andCreatetimeIsNull() {
addCriterion("createTime is null");
return (Criteria) this;
}
public Criteria andCreatetimeIsNotNull() {
addCriterion("createTime is not null");
return (Criteria) this;
}
public Criteria andCreatetimeEqualTo(Date value) {
addCriterion("createTime =", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotEqualTo(Date value) {
addCriterion("createTime <>", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThan(Date value) {
addCriterion("createTime >", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThanOrEqualTo(Date value) {
addCriterion("createTime >=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThan(Date value) {
addCriterion("createTime <", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThanOrEqualTo(Date value) {
addCriterion("createTime <=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeIn(List<Date> values) {
addCriterion("createTime in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotIn(List<Date> values) {
addCriterion("createTime not in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeBetween(Date value1, Date value2) {
addCriterion("createTime between", value1, value2, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotBetween(Date value1, Date value2) {
addCriterion("createTime not between", value1, value2, "createtime");
return (Criteria) this;
}
}
/**
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -1,7 +1,6 @@
package com.yutou.mobilecloud.mybatis.model; package com.yutou.mobilecloud.mybatis.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import lombok.Data; import lombok.Data;
/** /**
@ -12,9 +11,7 @@ import lombok.Data;
public class TBackupFile implements Serializable { public class TBackupFile implements Serializable {
private Integer id; private Integer id;
private Integer uid; private String filename;
private Integer bid;
private String filepath; private String filepath;
@ -22,7 +19,5 @@ public class TBackupFile implements Serializable {
private String md5; private String md5;
private Date createtime;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -1,7 +1,6 @@
package com.yutou.mobilecloud.mybatis.model; package com.yutou.mobilecloud.mybatis.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
public class TBackupFileExample { public class TBackupFileExample {
@ -165,253 +164,203 @@ public class TBackupFileExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidIsNull() { public Criteria andFilenameIsNull() {
addCriterion("`uid` is null"); addCriterion("fileName is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidIsNotNull() { public Criteria andFilenameIsNotNull() {
addCriterion("`uid` is not null"); addCriterion("fileName is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidEqualTo(Integer value) { public Criteria andFilenameEqualTo(String value) {
addCriterion("`uid` =", value, "uid"); addCriterion("fileName =", value, "filename");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidNotEqualTo(Integer value) { public Criteria andFilenameNotEqualTo(String value) {
addCriterion("`uid` <>", value, "uid"); addCriterion("fileName <>", value, "filename");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidGreaterThan(Integer value) { public Criteria andFilenameGreaterThan(String value) {
addCriterion("`uid` >", value, "uid"); addCriterion("fileName >", value, "filename");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidGreaterThanOrEqualTo(Integer value) { public Criteria andFilenameGreaterThanOrEqualTo(String value) {
addCriterion("`uid` >=", value, "uid"); addCriterion("fileName >=", value, "filename");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidLessThan(Integer value) { public Criteria andFilenameLessThan(String value) {
addCriterion("`uid` <", value, "uid"); addCriterion("fileName <", value, "filename");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidLessThanOrEqualTo(Integer value) { public Criteria andFilenameLessThanOrEqualTo(String value) {
addCriterion("`uid` <=", value, "uid"); addCriterion("fileName <=", value, "filename");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidIn(List<Integer> values) { public Criteria andFilenameLike(String value) {
addCriterion("`uid` in", values, "uid"); addCriterion("fileName like", value, "filename");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidNotIn(List<Integer> values) { public Criteria andFilenameNotLike(String value) {
addCriterion("`uid` not in", values, "uid"); addCriterion("fileName not like", value, "filename");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidBetween(Integer value1, Integer value2) { public Criteria andFilenameIn(List<String> values) {
addCriterion("`uid` between", value1, value2, "uid"); addCriterion("fileName in", values, "filename");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidNotBetween(Integer value1, Integer value2) { public Criteria andFilenameNotIn(List<String> values) {
addCriterion("`uid` not between", value1, value2, "uid"); addCriterion("fileName not in", values, "filename");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andBidIsNull() { public Criteria andFilenameBetween(String value1, String value2) {
addCriterion("bid is null"); addCriterion("fileName between", value1, value2, "filename");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andBidIsNotNull() { public Criteria andFilenameNotBetween(String value1, String value2) {
addCriterion("bid is not null"); addCriterion("fileName not between", value1, value2, "filename");
return (Criteria) this;
}
public Criteria andBidEqualTo(Integer value) {
addCriterion("bid =", value, "bid");
return (Criteria) this;
}
public Criteria andBidNotEqualTo(Integer value) {
addCriterion("bid <>", value, "bid");
return (Criteria) this;
}
public Criteria andBidGreaterThan(Integer value) {
addCriterion("bid >", value, "bid");
return (Criteria) this;
}
public Criteria andBidGreaterThanOrEqualTo(Integer value) {
addCriterion("bid >=", value, "bid");
return (Criteria) this;
}
public Criteria andBidLessThan(Integer value) {
addCriterion("bid <", value, "bid");
return (Criteria) this;
}
public Criteria andBidLessThanOrEqualTo(Integer value) {
addCriterion("bid <=", value, "bid");
return (Criteria) this;
}
public Criteria andBidIn(List<Integer> values) {
addCriterion("bid in", values, "bid");
return (Criteria) this;
}
public Criteria andBidNotIn(List<Integer> values) {
addCriterion("bid not in", values, "bid");
return (Criteria) this;
}
public Criteria andBidBetween(Integer value1, Integer value2) {
addCriterion("bid between", value1, value2, "bid");
return (Criteria) this;
}
public Criteria andBidNotBetween(Integer value1, Integer value2) {
addCriterion("bid not between", value1, value2, "bid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathIsNull() { public Criteria andFilepathIsNull() {
addCriterion("filepath is null"); addCriterion("filePath is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathIsNotNull() { public Criteria andFilepathIsNotNull() {
addCriterion("filepath is not null"); addCriterion("filePath is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathEqualTo(String value) { public Criteria andFilepathEqualTo(String value) {
addCriterion("filepath =", value, "filepath"); addCriterion("filePath =", value, "filepath");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathNotEqualTo(String value) { public Criteria andFilepathNotEqualTo(String value) {
addCriterion("filepath <>", value, "filepath"); addCriterion("filePath <>", value, "filepath");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathGreaterThan(String value) { public Criteria andFilepathGreaterThan(String value) {
addCriterion("filepath >", value, "filepath"); addCriterion("filePath >", value, "filepath");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathGreaterThanOrEqualTo(String value) { public Criteria andFilepathGreaterThanOrEqualTo(String value) {
addCriterion("filepath >=", value, "filepath"); addCriterion("filePath >=", value, "filepath");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathLessThan(String value) { public Criteria andFilepathLessThan(String value) {
addCriterion("filepath <", value, "filepath"); addCriterion("filePath <", value, "filepath");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathLessThanOrEqualTo(String value) { public Criteria andFilepathLessThanOrEqualTo(String value) {
addCriterion("filepath <=", value, "filepath"); addCriterion("filePath <=", value, "filepath");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathLike(String value) { public Criteria andFilepathLike(String value) {
addCriterion("filepath like", value, "filepath"); addCriterion("filePath like", value, "filepath");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathNotLike(String value) { public Criteria andFilepathNotLike(String value) {
addCriterion("filepath not like", value, "filepath"); addCriterion("filePath not like", value, "filepath");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathIn(List<String> values) { public Criteria andFilepathIn(List<String> values) {
addCriterion("filepath in", values, "filepath"); addCriterion("filePath in", values, "filepath");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathNotIn(List<String> values) { public Criteria andFilepathNotIn(List<String> values) {
addCriterion("filepath not in", values, "filepath"); addCriterion("filePath not in", values, "filepath");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathBetween(String value1, String value2) { public Criteria andFilepathBetween(String value1, String value2) {
addCriterion("filepath between", value1, value2, "filepath"); addCriterion("filePath between", value1, value2, "filepath");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilepathNotBetween(String value1, String value2) { public Criteria andFilepathNotBetween(String value1, String value2) {
addCriterion("filepath not between", value1, value2, "filepath"); addCriterion("filePath not between", value1, value2, "filepath");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilesizeIsNull() { public Criteria andFilesizeIsNull() {
addCriterion("filesize is null"); addCriterion("fileSize is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilesizeIsNotNull() { public Criteria andFilesizeIsNotNull() {
addCriterion("filesize is not null"); addCriterion("fileSize is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilesizeEqualTo(Integer value) { public Criteria andFilesizeEqualTo(Integer value) {
addCriterion("filesize =", value, "filesize"); addCriterion("fileSize =", value, "filesize");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilesizeNotEqualTo(Integer value) { public Criteria andFilesizeNotEqualTo(Integer value) {
addCriterion("filesize <>", value, "filesize"); addCriterion("fileSize <>", value, "filesize");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilesizeGreaterThan(Integer value) { public Criteria andFilesizeGreaterThan(Integer value) {
addCriterion("filesize >", value, "filesize"); addCriterion("fileSize >", value, "filesize");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilesizeGreaterThanOrEqualTo(Integer value) { public Criteria andFilesizeGreaterThanOrEqualTo(Integer value) {
addCriterion("filesize >=", value, "filesize"); addCriterion("fileSize >=", value, "filesize");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilesizeLessThan(Integer value) { public Criteria andFilesizeLessThan(Integer value) {
addCriterion("filesize <", value, "filesize"); addCriterion("fileSize <", value, "filesize");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilesizeLessThanOrEqualTo(Integer value) { public Criteria andFilesizeLessThanOrEqualTo(Integer value) {
addCriterion("filesize <=", value, "filesize"); addCriterion("fileSize <=", value, "filesize");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilesizeIn(List<Integer> values) { public Criteria andFilesizeIn(List<Integer> values) {
addCriterion("filesize in", values, "filesize"); addCriterion("fileSize in", values, "filesize");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilesizeNotIn(List<Integer> values) { public Criteria andFilesizeNotIn(List<Integer> values) {
addCriterion("filesize not in", values, "filesize"); addCriterion("fileSize not in", values, "filesize");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilesizeBetween(Integer value1, Integer value2) { public Criteria andFilesizeBetween(Integer value1, Integer value2) {
addCriterion("filesize between", value1, value2, "filesize"); addCriterion("fileSize between", value1, value2, "filesize");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFilesizeNotBetween(Integer value1, Integer value2) { public Criteria andFilesizeNotBetween(Integer value1, Integer value2) {
addCriterion("filesize not between", value1, value2, "filesize"); addCriterion("fileSize not between", value1, value2, "filesize");
return (Criteria) this; return (Criteria) this;
} }
@ -484,66 +433,6 @@ public class TBackupFileExample {
addCriterion("md5 not between", value1, value2, "md5"); addCriterion("md5 not between", value1, value2, "md5");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatetimeIsNull() {
addCriterion("createTime is null");
return (Criteria) this;
}
public Criteria andCreatetimeIsNotNull() {
addCriterion("createTime is not null");
return (Criteria) this;
}
public Criteria andCreatetimeEqualTo(Date value) {
addCriterion("createTime =", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotEqualTo(Date value) {
addCriterion("createTime <>", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThan(Date value) {
addCriterion("createTime >", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThanOrEqualTo(Date value) {
addCriterion("createTime >=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThan(Date value) {
addCriterion("createTime <", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThanOrEqualTo(Date value) {
addCriterion("createTime <=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeIn(List<Date> values) {
addCriterion("createTime in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotIn(List<Date> values) {
addCriterion("createTime not in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeBetween(Date value1, Date value2) {
addCriterion("createTime between", value1, value2, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotBetween(Date value1, Date value2) {
addCriterion("createTime not between", value1, value2, "createtime");
return (Criteria) this;
}
} }
/** /**

View File

@ -0,0 +1,45 @@
package com.yutou.mobilecloud.mybatis.model;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* t_backup_image
* @author
*/
@Data
public class TBackupImage implements Serializable {
private Integer id;
private Integer uid;
private Integer fid;
/**
* 在手机上的路径
*/
private String path;
private String device;
private String gps;
private Integer iso;
private String shutter;
private Double aperture;
private Integer high;
private Integer width;
private Integer filelength;
private String remark;
private Date createtime;
private static final long serialVersionUID = 1L;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
package com.yutou.mobilecloud.mybatis.model;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* t_backup_info
* @author
*/
@Data
public class TBackupInfo implements Serializable {
private Integer id;
private String uid;
private Integer fid;
/**
* 1=手机号2=短信
*/
private Integer type;
private Date createtime;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,512 @@
package com.yutou.mobilecloud.mybatis.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TBackupInfoExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public TBackupInfoExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUidIsNull() {
addCriterion("`uid` is null");
return (Criteria) this;
}
public Criteria andUidIsNotNull() {
addCriterion("`uid` is not null");
return (Criteria) this;
}
public Criteria andUidEqualTo(String value) {
addCriterion("`uid` =", value, "uid");
return (Criteria) this;
}
public Criteria andUidNotEqualTo(String value) {
addCriterion("`uid` <>", value, "uid");
return (Criteria) this;
}
public Criteria andUidGreaterThan(String value) {
addCriterion("`uid` >", value, "uid");
return (Criteria) this;
}
public Criteria andUidGreaterThanOrEqualTo(String value) {
addCriterion("`uid` >=", value, "uid");
return (Criteria) this;
}
public Criteria andUidLessThan(String value) {
addCriterion("`uid` <", value, "uid");
return (Criteria) this;
}
public Criteria andUidLessThanOrEqualTo(String value) {
addCriterion("`uid` <=", value, "uid");
return (Criteria) this;
}
public Criteria andUidLike(String value) {
addCriterion("`uid` like", value, "uid");
return (Criteria) this;
}
public Criteria andUidNotLike(String value) {
addCriterion("`uid` not like", value, "uid");
return (Criteria) this;
}
public Criteria andUidIn(List<String> values) {
addCriterion("`uid` in", values, "uid");
return (Criteria) this;
}
public Criteria andUidNotIn(List<String> values) {
addCriterion("`uid` not in", values, "uid");
return (Criteria) this;
}
public Criteria andUidBetween(String value1, String value2) {
addCriterion("`uid` between", value1, value2, "uid");
return (Criteria) this;
}
public Criteria andUidNotBetween(String value1, String value2) {
addCriterion("`uid` not between", value1, value2, "uid");
return (Criteria) this;
}
public Criteria andFidIsNull() {
addCriterion("fid is null");
return (Criteria) this;
}
public Criteria andFidIsNotNull() {
addCriterion("fid is not null");
return (Criteria) this;
}
public Criteria andFidEqualTo(Integer value) {
addCriterion("fid =", value, "fid");
return (Criteria) this;
}
public Criteria andFidNotEqualTo(Integer value) {
addCriterion("fid <>", value, "fid");
return (Criteria) this;
}
public Criteria andFidGreaterThan(Integer value) {
addCriterion("fid >", value, "fid");
return (Criteria) this;
}
public Criteria andFidGreaterThanOrEqualTo(Integer value) {
addCriterion("fid >=", value, "fid");
return (Criteria) this;
}
public Criteria andFidLessThan(Integer value) {
addCriterion("fid <", value, "fid");
return (Criteria) this;
}
public Criteria andFidLessThanOrEqualTo(Integer value) {
addCriterion("fid <=", value, "fid");
return (Criteria) this;
}
public Criteria andFidIn(List<Integer> values) {
addCriterion("fid in", values, "fid");
return (Criteria) this;
}
public Criteria andFidNotIn(List<Integer> values) {
addCriterion("fid not in", values, "fid");
return (Criteria) this;
}
public Criteria andFidBetween(Integer value1, Integer value2) {
addCriterion("fid between", value1, value2, "fid");
return (Criteria) this;
}
public Criteria andFidNotBetween(Integer value1, Integer value2) {
addCriterion("fid not between", value1, value2, "fid");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("`type` is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("`type` =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("`type` <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("`type` >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("`type` >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("`type` <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("`type` <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("`type` not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("`type` between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("`type` not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andCreatetimeIsNull() {
addCriterion("createTime is null");
return (Criteria) this;
}
public Criteria andCreatetimeIsNotNull() {
addCriterion("createTime is not null");
return (Criteria) this;
}
public Criteria andCreatetimeEqualTo(Date value) {
addCriterion("createTime =", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotEqualTo(Date value) {
addCriterion("createTime <>", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThan(Date value) {
addCriterion("createTime >", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThanOrEqualTo(Date value) {
addCriterion("createTime >=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThan(Date value) {
addCriterion("createTime <", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThanOrEqualTo(Date value) {
addCriterion("createTime <=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeIn(List<Date> values) {
addCriterion("createTime in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotIn(List<Date> values) {
addCriterion("createTime not in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeBetween(Date value1, Date value2) {
addCriterion("createTime between", value1, value2, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotBetween(Date value1, Date value2) {
addCriterion("createTime not between", value1, value2, "createtime");
return (Criteria) this;
}
}
/**
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@ -11,9 +11,9 @@ import lombok.Data;
public class TUserConfig implements Serializable { public class TUserConfig implements Serializable {
private Integer id; private Integer id;
private String uid; private Integer uid;
private Integer cloudmodel; private Integer infoversionbackup;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -174,123 +174,113 @@ public class TUserConfigExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidEqualTo(String value) { public Criteria andUidEqualTo(Integer value) {
addCriterion("`uid` =", value, "uid"); addCriterion("`uid` =", value, "uid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidNotEqualTo(String value) { public Criteria andUidNotEqualTo(Integer value) {
addCriterion("`uid` <>", value, "uid"); addCriterion("`uid` <>", value, "uid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidGreaterThan(String value) { public Criteria andUidGreaterThan(Integer value) {
addCriterion("`uid` >", value, "uid"); addCriterion("`uid` >", value, "uid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidGreaterThanOrEqualTo(String value) { public Criteria andUidGreaterThanOrEqualTo(Integer value) {
addCriterion("`uid` >=", value, "uid"); addCriterion("`uid` >=", value, "uid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidLessThan(String value) { public Criteria andUidLessThan(Integer value) {
addCriterion("`uid` <", value, "uid"); addCriterion("`uid` <", value, "uid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidLessThanOrEqualTo(String value) { public Criteria andUidLessThanOrEqualTo(Integer value) {
addCriterion("`uid` <=", value, "uid"); addCriterion("`uid` <=", value, "uid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidLike(String value) { public Criteria andUidIn(List<Integer> values) {
addCriterion("`uid` like", value, "uid");
return (Criteria) this;
}
public Criteria andUidNotLike(String value) {
addCriterion("`uid` not like", value, "uid");
return (Criteria) this;
}
public Criteria andUidIn(List<String> values) {
addCriterion("`uid` in", values, "uid"); addCriterion("`uid` in", values, "uid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidNotIn(List<String> values) { public Criteria andUidNotIn(List<Integer> values) {
addCriterion("`uid` not in", values, "uid"); addCriterion("`uid` not in", values, "uid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidBetween(String value1, String value2) { public Criteria andUidBetween(Integer value1, Integer value2) {
addCriterion("`uid` between", value1, value2, "uid"); addCriterion("`uid` between", value1, value2, "uid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUidNotBetween(String value1, String value2) { public Criteria andUidNotBetween(Integer value1, Integer value2) {
addCriterion("`uid` not between", value1, value2, "uid"); addCriterion("`uid` not between", value1, value2, "uid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCloudmodelIsNull() { public Criteria andInfoversionbackupIsNull() {
addCriterion("cloudmodel is null"); addCriterion("infoVersionBackup is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCloudmodelIsNotNull() { public Criteria andInfoversionbackupIsNotNull() {
addCriterion("cloudmodel is not null"); addCriterion("infoVersionBackup is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCloudmodelEqualTo(Integer value) { public Criteria andInfoversionbackupEqualTo(Integer value) {
addCriterion("cloudmodel =", value, "cloudmodel"); addCriterion("infoVersionBackup =", value, "infoversionbackup");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCloudmodelNotEqualTo(Integer value) { public Criteria andInfoversionbackupNotEqualTo(Integer value) {
addCriterion("cloudmodel <>", value, "cloudmodel"); addCriterion("infoVersionBackup <>", value, "infoversionbackup");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCloudmodelGreaterThan(Integer value) { public Criteria andInfoversionbackupGreaterThan(Integer value) {
addCriterion("cloudmodel >", value, "cloudmodel"); addCriterion("infoVersionBackup >", value, "infoversionbackup");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCloudmodelGreaterThanOrEqualTo(Integer value) { public Criteria andInfoversionbackupGreaterThanOrEqualTo(Integer value) {
addCriterion("cloudmodel >=", value, "cloudmodel"); addCriterion("infoVersionBackup >=", value, "infoversionbackup");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCloudmodelLessThan(Integer value) { public Criteria andInfoversionbackupLessThan(Integer value) {
addCriterion("cloudmodel <", value, "cloudmodel"); addCriterion("infoVersionBackup <", value, "infoversionbackup");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCloudmodelLessThanOrEqualTo(Integer value) { public Criteria andInfoversionbackupLessThanOrEqualTo(Integer value) {
addCriterion("cloudmodel <=", value, "cloudmodel"); addCriterion("infoVersionBackup <=", value, "infoversionbackup");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCloudmodelIn(List<Integer> values) { public Criteria andInfoversionbackupIn(List<Integer> values) {
addCriterion("cloudmodel in", values, "cloudmodel"); addCriterion("infoVersionBackup in", values, "infoversionbackup");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCloudmodelNotIn(List<Integer> values) { public Criteria andInfoversionbackupNotIn(List<Integer> values) {
addCriterion("cloudmodel not in", values, "cloudmodel"); addCriterion("infoVersionBackup not in", values, "infoversionbackup");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCloudmodelBetween(Integer value1, Integer value2) { public Criteria andInfoversionbackupBetween(Integer value1, Integer value2) {
addCriterion("cloudmodel between", value1, value2, "cloudmodel"); addCriterion("infoVersionBackup between", value1, value2, "infoversionbackup");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCloudmodelNotBetween(Integer value1, Integer value2) { public Criteria andInfoversionbackupNotBetween(Integer value1, Integer value2) {
addCriterion("cloudmodel not between", value1, value2, "cloudmodel"); addCriterion("infoVersionBackup not between", value1, value2, "infoversionbackup");
return (Criteria) this; return (Criteria) this;
} }
} }

View File

@ -0,0 +1,52 @@
package com.yutou.mobilecloud.utils;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
public class AESTools {
private static final String key="qD5POhp7UMn0iKFH";
private static final String model="AES/ECB/PKCS5Padding";
/**
* 加密
* @param value 原文
* @return 密文
*/
public static String encrypt(String value,String key){
try {
KeyGenerator generator=KeyGenerator.getInstance("AES");
generator.init(128);
Cipher cipher=Cipher.getInstance(model);
cipher.init(Cipher.ENCRYPT_MODE,new SecretKeySpec(key.getBytes(),"AES"));
byte[] bytes=cipher.doFinal(value.getBytes(StandardCharsets.UTF_8));
return new String(Base64.getEncoder().encode(bytes));
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 解密
* @param value 密文
* @return 原文
*/
public static String decrypt(String value,String key){
try {
KeyGenerator generator=KeyGenerator.getInstance("AES");
generator.init(128);
Cipher cipher=Cipher.getInstance(model);
cipher.init(Cipher.DECRYPT_MODE,new SecretKeySpec(key.getBytes(),"AES"));
byte[] encodeBytes=Base64.getDecoder().decode(value);
byte[] bytes=cipher.doFinal(encodeBytes);
return new String(bytes);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}

View File

@ -0,0 +1,289 @@
package com.yutou.mobilecloud.utils;
import com.alibaba.fastjson.JSONArray;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.text.SimpleDateFormat;
import java.util.Base64;
import java.util.Date;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Tools {
private static float UPSPower=-1.0f;
/**
* 设置Cookie
*
* @param response
* @param key
* @param value
* @param time
*/
public static void setCookie(HttpServletResponse response, String key, String value, int time) {
Cookie cookie = new Cookie(key, value);
if (time != -1) {
cookie.setMaxAge(time);
}
cookie.setPath("/");
response.addCookie(cookie);
}
/**
* 获取Cookie
*
* @param request
* @param key
* @return
*/
public static Cookie getCookie(HttpServletRequest request, String key) {
Cookie[] cookies = request.getCookies();
try {
for (Cookie cookie : cookies) {
if (key != null && cookie.getName().equals(key)) {
return cookie;
}
}
} catch (Exception ignored) {
}
return null;
}
/**
* 删除Cookie
*
* @param request
* @param response
* @param key
* @return
*/
public static String deleteCookie(HttpServletRequest request, HttpServletResponse response, String key) {
for (Cookie cookie : request.getCookies()) {
if (cookie.getName().equals(key)) {
cookie.setMaxAge(0);
cookie.setPath("/");
cookie.setValue(null);
response.addCookie(cookie);
}
}
return "ok";
}
/**
* 获取项目路径
*
* @param request
* @return
*/
public static String getPath(HttpServletRequest request) {
return request.getServletContext().getRealPath("/") + "/";
}
/**
* 获取客户端IP
*
* @param request
* @return
*/
public static String getRemoteAddress(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || ip.equalsIgnoreCase("unknown")) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || ip.equalsIgnoreCase("unknown")) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || ip.equalsIgnoreCase("unknown")) {
ip = request.getRemoteAddr();
}
return ip;
}
/**
* N以内的不重复随机数
*
* @param min 最小值
* @param max 最大值
* @param n
* @return
*/
public static int[] randomCommon(int min, int max, int n) {
int len = max - min + 1;
if (max < min || n > len) {
return new int[0];
}
// 初始化给定范围的待选数组
int[] source = new int[len];
for (int i = min; i < min + len; i++) {
source[i - min] = i;
}
int[] result = new int[n];
Random rd = new Random();
int index = 0;
for (int i = 0; i < result.length; i++) {
// 待选数组0到(len-2)随机一个下标
index = Math.abs(rd.nextInt() % len--);
// 将随机到的数放入结果集
result[i] = source[index];
// 将待选数组中被随机到的数用待选数组(len-1)下标对应的数替换
source[index] = source[len];
}
return result;
}
/**
* 保存上传的文件
*
* @param path 路径
* @param file 文件
* @return
* @throws Exception
*/
public static String createFile(String path, MultipartFile file, String newFileName) throws Exception {
String savePath = new File("").getAbsolutePath() + File.separator + "html" + File.separator + path;
File servicePath = new File(savePath);
if (!servicePath.exists()) {
servicePath.mkdirs();
}
String fileName = file.getOriginalFilename();
if (newFileName != null) {
fileName = newFileName;
}
File saveFile = new File(savePath + "/" + fileName);
if (saveFile.exists()) {
if (!saveFile.delete()) {
saveFile = new File(savePath + "/" + fileName.replace(".", "_" + new Date().getTime() + "."));
}
}
file.transferTo(saveFile);
fileName = URLEncoder.encode(fileName, "UTF-8");
return path + fileName;
}
/**
* 构造给前端的文件
*
* @param file 文件路径
* @return 前端获取的文件
*/
public static ResponseEntity<FileSystemResource> getFile(File file) {
HttpHeaders headers = new HttpHeaders();
headers.add("Cache-Control", "no-cache, no-store, must-revalidate");
try {
headers.add("Content-Disposition", "attachment; filename=" + URLEncoder.encode(file.getName(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
headers.add("Content-Disposition", "attachment; filename=" + file.getName());
}
headers.add("Pragma", "no-cache");
headers.add("Expires", "0");
headers.add("Last-Modified", new Date().toString());
headers.add("ETag", String.valueOf(System.currentTimeMillis()));
return ResponseEntity.ok().headers(headers).contentLength(file.length()).contentType(MediaType.parseMediaType("application/octet-stream")).body(new FileSystemResource(file));
}
public static String getMd5(String str){
return bytesToHexString(str.getBytes(StandardCharsets.UTF_8));
}
public static String getFileMD5(File file){
return bytesToHexString(getFileMD5Byte(file));
}
public static byte[] getFileMD5Byte(File file) {
if (!file.isFile()) {
return null;
}
MessageDigest digest = null;
FileInputStream in = null;
byte[] buffer = new byte[1024];
int len;
try {
digest = MessageDigest.getInstance("MD5");
in = new FileInputStream(file);
while ((len = in.read(buffer, 0, 1024)) != -1) {
digest.update(buffer, 0, len);
}
in.close();
} catch (Exception e) {
e.printStackTrace();
return null;
}
return digest.digest();
}
private static String bytesToHexString(byte[] src) {
StringBuilder stringBuilder = new StringBuilder("");
if (src == null || src.length <= 0) {
return null;
}
for (byte aSrc : src) {
int v = aSrc & 0xFF;
String hv = Integer.toHexString(v);
if (hv.length() < 2) {
stringBuilder.append(0);
}
stringBuilder.append(hv);
}
return stringBuilder.toString();
}
public static String base64ToString(String base) {
base = base.replace(" ", "+");
try {
base = new String(Base64.getDecoder().decode(base.replace("\r\n", "").getBytes()));
} catch (Exception e) {
try {
base = URLDecoder.decode(base, StandardCharsets.UTF_8);
base = base.replace(" ", "+");
base = new String(Base64.getDecoder().decode(base.replace("\r\n", "").getBytes()));
} catch (Exception e1) {
e1.printStackTrace();
}
}
return base;
}
public static String stringToBase64(String string){
return Base64.getEncoder().encodeToString(string.getBytes(StandardCharsets.UTF_8)).replace("+"," ");
}
/**
* 异常输出
*
* @param e 异常
* @return
*/
public static String getExceptionString(Exception e) {
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter(writer);
e.printStackTrace(printWriter);
printWriter.close();
return writer.toString();
}
public static String getToDayTime() {
return new SimpleDateFormat("yyyy-MM-dd").format(new Date());
}
public static String getToDayNowTimeToFileName() {
return new SimpleDateFormat("yyyy-MM-dd__HH_mm_ss").format(new Date());
}
}

View File

@ -0,0 +1,35 @@
package com.yutou.mobilecloud.utils;
import com.yutou.mobilecloud.mybatis.model.TUser;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import static com.yutou.mobilecloud.Services.impls.IUserImpl.LOGIN_KEY;
public class UserTools {
public static String getToken(TUser user) {
String str = String.format("%d|%s|%s",
user.getId(),
user.getUsername(),
LocalDateTime.now().plusMonths(1).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
);
return AESTools.encrypt(Tools.stringToBase64(str), LOGIN_KEY);
}
public static int checkTokenGetUid(String token) {
String str = Tools.base64ToString(AESTools.decrypt(token, LOGIN_KEY));
if (str != null) {
String[] sp = str.split("\\|");
int uid = Integer.parseInt(sp[0]);
String outTime = sp[2];
boolean isOut = LocalDateTime.now().isAfter(LocalDateTime.parse(outTime));
if (isOut) {
return -2;
}
return uid;
}
return -1;
}
}

View File

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yutou.mobilecloud.mybatis.dao.TBackupAppDao">
<resultMap id="BaseResultMap" type="com.yutou.mobilecloud.mybatis.model.TBackupApp">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="uid" jdbcType="INTEGER" property="uid" />
<result column="fid" jdbcType="INTEGER" property="fid" />
<result column="appName" jdbcType="VARCHAR" property="appname" />
<result column="appPackageName" jdbcType="VARCHAR" property="apppackagename" />
<result column="appVersion" jdbcType="VARCHAR" property="appversion" />
<result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, `uid`, fid, appName, appPackageName, appVersion, createTime
</sql>
<select id="selectByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupAppExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_backup_app
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_backup_app
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_backup_app
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupAppExample">
delete from t_backup_app
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupApp" useGeneratedKeys="true">
insert into t_backup_app (`uid`, fid, appName,
appPackageName, appVersion, createTime
)
values (#{uid,jdbcType=INTEGER}, #{fid,jdbcType=INTEGER}, #{appname,jdbcType=VARCHAR},
#{apppackagename,jdbcType=VARCHAR}, #{appversion,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupApp" useGeneratedKeys="true">
insert into t_backup_app
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uid != null">
`uid`,
</if>
<if test="fid != null">
fid,
</if>
<if test="appname != null">
appName,
</if>
<if test="apppackagename != null">
appPackageName,
</if>
<if test="appversion != null">
appVersion,
</if>
<if test="createtime != null">
createTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null">
#{uid,jdbcType=INTEGER},
</if>
<if test="fid != null">
#{fid,jdbcType=INTEGER},
</if>
<if test="appname != null">
#{appname,jdbcType=VARCHAR},
</if>
<if test="apppackagename != null">
#{apppackagename,jdbcType=VARCHAR},
</if>
<if test="appversion != null">
#{appversion,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
#{createtime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupAppExample" resultType="java.lang.Long">
select count(*) from t_backup_app
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_backup_app
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.uid != null">
`uid` = #{record.uid,jdbcType=INTEGER},
</if>
<if test="record.fid != null">
fid = #{record.fid,jdbcType=INTEGER},
</if>
<if test="record.appname != null">
appName = #{record.appname,jdbcType=VARCHAR},
</if>
<if test="record.apppackagename != null">
appPackageName = #{record.apppackagename,jdbcType=VARCHAR},
</if>
<if test="record.appversion != null">
appVersion = #{record.appversion,jdbcType=VARCHAR},
</if>
<if test="record.createtime != null">
createTime = #{record.createtime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_backup_app
set id = #{record.id,jdbcType=INTEGER},
`uid` = #{record.uid,jdbcType=INTEGER},
fid = #{record.fid,jdbcType=INTEGER},
appName = #{record.appname,jdbcType=VARCHAR},
appPackageName = #{record.apppackagename,jdbcType=VARCHAR},
appVersion = #{record.appversion,jdbcType=VARCHAR},
createTime = #{record.createtime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupApp">
update t_backup_app
<set>
<if test="uid != null">
`uid` = #{uid,jdbcType=INTEGER},
</if>
<if test="fid != null">
fid = #{fid,jdbcType=INTEGER},
</if>
<if test="appname != null">
appName = #{appname,jdbcType=VARCHAR},
</if>
<if test="apppackagename != null">
appPackageName = #{apppackagename,jdbcType=VARCHAR},
</if>
<if test="appversion != null">
appVersion = #{appversion,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
createTime = #{createtime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupApp">
update t_backup_app
set `uid` = #{uid,jdbcType=INTEGER},
fid = #{fid,jdbcType=INTEGER},
appName = #{appname,jdbcType=VARCHAR},
appPackageName = #{apppackagename,jdbcType=VARCHAR},
appVersion = #{appversion,jdbcType=VARCHAR},
createTime = #{createtime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@ -3,12 +3,10 @@
<mapper namespace="com.yutou.mobilecloud.mybatis.dao.TBackupFileDao"> <mapper namespace="com.yutou.mobilecloud.mybatis.dao.TBackupFileDao">
<resultMap id="BaseResultMap" type="com.yutou.mobilecloud.mybatis.model.TBackupFile"> <resultMap id="BaseResultMap" type="com.yutou.mobilecloud.mybatis.model.TBackupFile">
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<result column="uid" jdbcType="INTEGER" property="uid" /> <result column="fileName" jdbcType="VARCHAR" property="filename" />
<result column="bid" jdbcType="INTEGER" property="bid" /> <result column="filePath" jdbcType="VARCHAR" property="filepath" />
<result column="filepath" jdbcType="VARCHAR" property="filepath" /> <result column="fileSize" jdbcType="INTEGER" property="filesize" />
<result column="filesize" jdbcType="INTEGER" property="filesize" />
<result column="md5" jdbcType="VARCHAR" property="md5" /> <result column="md5" jdbcType="VARCHAR" property="md5" />
<result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -69,7 +67,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `uid`, bid, filepath, filesize, md5, createTime id, fileName, filePath, fileSize, md5
</sql> </sql>
<select id="selectByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupFileExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupFileExample" resultMap="BaseResultMap">
select select
@ -102,41 +100,30 @@
</if> </if>
</delete> </delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupFile" useGeneratedKeys="true"> <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupFile" useGeneratedKeys="true">
insert into t_backup_file (`uid`, bid, filepath, insert into t_backup_file (fileName, filePath, fileSize,
filesize, md5, createTime md5)
) values (#{filename,jdbcType=VARCHAR}, #{filepath,jdbcType=VARCHAR}, #{filesize,jdbcType=INTEGER},
values (#{uid,jdbcType=INTEGER}, #{bid,jdbcType=INTEGER}, #{filepath,jdbcType=VARCHAR}, #{md5,jdbcType=VARCHAR})
#{filesize,jdbcType=INTEGER}, #{md5,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}
)
</insert> </insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupFile" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupFile" useGeneratedKeys="true">
insert into t_backup_file insert into t_backup_file
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uid != null"> <if test="filename != null">
`uid`, fileName,
</if>
<if test="bid != null">
bid,
</if> </if>
<if test="filepath != null"> <if test="filepath != null">
filepath, filePath,
</if> </if>
<if test="filesize != null"> <if test="filesize != null">
filesize, fileSize,
</if> </if>
<if test="md5 != null"> <if test="md5 != null">
md5, md5,
</if> </if>
<if test="createtime != null">
createTime,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null"> <if test="filename != null">
#{uid,jdbcType=INTEGER}, #{filename,jdbcType=VARCHAR},
</if>
<if test="bid != null">
#{bid,jdbcType=INTEGER},
</if> </if>
<if test="filepath != null"> <if test="filepath != null">
#{filepath,jdbcType=VARCHAR}, #{filepath,jdbcType=VARCHAR},
@ -147,9 +134,6 @@
<if test="md5 != null"> <if test="md5 != null">
#{md5,jdbcType=VARCHAR}, #{md5,jdbcType=VARCHAR},
</if> </if>
<if test="createtime != null">
#{createtime,jdbcType=TIMESTAMP},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupFileExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupFileExample" resultType="java.lang.Long">
@ -164,24 +148,18 @@
<if test="record.id != null"> <if test="record.id != null">
id = #{record.id,jdbcType=INTEGER}, id = #{record.id,jdbcType=INTEGER},
</if> </if>
<if test="record.uid != null"> <if test="record.filename != null">
`uid` = #{record.uid,jdbcType=INTEGER}, fileName = #{record.filename,jdbcType=VARCHAR},
</if>
<if test="record.bid != null">
bid = #{record.bid,jdbcType=INTEGER},
</if> </if>
<if test="record.filepath != null"> <if test="record.filepath != null">
filepath = #{record.filepath,jdbcType=VARCHAR}, filePath = #{record.filepath,jdbcType=VARCHAR},
</if> </if>
<if test="record.filesize != null"> <if test="record.filesize != null">
filesize = #{record.filesize,jdbcType=INTEGER}, fileSize = #{record.filesize,jdbcType=INTEGER},
</if> </if>
<if test="record.md5 != null"> <if test="record.md5 != null">
md5 = #{record.md5,jdbcType=VARCHAR}, md5 = #{record.md5,jdbcType=VARCHAR},
</if> </if>
<if test="record.createtime != null">
createTime = #{record.createtime,jdbcType=TIMESTAMP},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -190,12 +168,10 @@
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
update t_backup_file update t_backup_file
set id = #{record.id,jdbcType=INTEGER}, set id = #{record.id,jdbcType=INTEGER},
`uid` = #{record.uid,jdbcType=INTEGER}, fileName = #{record.filename,jdbcType=VARCHAR},
bid = #{record.bid,jdbcType=INTEGER}, filePath = #{record.filepath,jdbcType=VARCHAR},
filepath = #{record.filepath,jdbcType=VARCHAR}, fileSize = #{record.filesize,jdbcType=INTEGER},
filesize = #{record.filesize,jdbcType=INTEGER}, md5 = #{record.md5,jdbcType=VARCHAR}
md5 = #{record.md5,jdbcType=VARCHAR},
createTime = #{record.createtime,jdbcType=TIMESTAMP}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -203,35 +179,27 @@
<update id="updateByPrimaryKeySelective" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupFile"> <update id="updateByPrimaryKeySelective" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupFile">
update t_backup_file update t_backup_file
<set> <set>
<if test="uid != null"> <if test="filename != null">
`uid` = #{uid,jdbcType=INTEGER}, fileName = #{filename,jdbcType=VARCHAR},
</if>
<if test="bid != null">
bid = #{bid,jdbcType=INTEGER},
</if> </if>
<if test="filepath != null"> <if test="filepath != null">
filepath = #{filepath,jdbcType=VARCHAR}, filePath = #{filepath,jdbcType=VARCHAR},
</if> </if>
<if test="filesize != null"> <if test="filesize != null">
filesize = #{filesize,jdbcType=INTEGER}, fileSize = #{filesize,jdbcType=INTEGER},
</if> </if>
<if test="md5 != null"> <if test="md5 != null">
md5 = #{md5,jdbcType=VARCHAR}, md5 = #{md5,jdbcType=VARCHAR},
</if> </if>
<if test="createtime != null">
createTime = #{createtime,jdbcType=TIMESTAMP},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupFile"> <update id="updateByPrimaryKey" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupFile">
update t_backup_file update t_backup_file
set `uid` = #{uid,jdbcType=INTEGER}, set fileName = #{filename,jdbcType=VARCHAR},
bid = #{bid,jdbcType=INTEGER}, filePath = #{filepath,jdbcType=VARCHAR},
filepath = #{filepath,jdbcType=VARCHAR}, fileSize = #{filesize,jdbcType=INTEGER},
filesize = #{filesize,jdbcType=INTEGER}, md5 = #{md5,jdbcType=VARCHAR}
md5 = #{md5,jdbcType=VARCHAR},
createTime = #{createtime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
</mapper> </mapper>

View File

@ -0,0 +1,347 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yutou.mobilecloud.mybatis.dao.TBackupImageDao">
<resultMap id="BaseResultMap" type="com.yutou.mobilecloud.mybatis.model.TBackupImage">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="uid" jdbcType="INTEGER" property="uid" />
<result column="fid" jdbcType="INTEGER" property="fid" />
<result column="path" jdbcType="VARCHAR" property="path" />
<result column="device" jdbcType="VARCHAR" property="device" />
<result column="gps" jdbcType="VARCHAR" property="gps" />
<result column="iso" jdbcType="INTEGER" property="iso" />
<result column="shutter" jdbcType="VARCHAR" property="shutter" />
<result column="aperture" jdbcType="FLOAT" property="aperture" />
<result column="high" jdbcType="INTEGER" property="high" />
<result column="width" jdbcType="INTEGER" property="width" />
<result column="fileLength" jdbcType="INTEGER" property="filelength" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, `uid`, fid, `path`, device, gps, iso, shutter, aperture, high, width, fileLength,
remark, createTime
</sql>
<select id="selectByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupImageExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_backup_image
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_backup_image
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_backup_image
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupImageExample">
delete from t_backup_image
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupImage" useGeneratedKeys="true">
insert into t_backup_image (`uid`, fid, `path`,
device, gps, iso, shutter,
aperture, high, width,
fileLength, remark, createTime
)
values (#{uid,jdbcType=INTEGER}, #{fid,jdbcType=INTEGER}, #{path,jdbcType=VARCHAR},
#{device,jdbcType=VARCHAR}, #{gps,jdbcType=VARCHAR}, #{iso,jdbcType=INTEGER}, #{shutter,jdbcType=VARCHAR},
#{aperture,jdbcType=FLOAT}, #{high,jdbcType=INTEGER}, #{width,jdbcType=INTEGER},
#{filelength,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupImage" useGeneratedKeys="true">
insert into t_backup_image
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uid != null">
`uid`,
</if>
<if test="fid != null">
fid,
</if>
<if test="path != null">
`path`,
</if>
<if test="device != null">
device,
</if>
<if test="gps != null">
gps,
</if>
<if test="iso != null">
iso,
</if>
<if test="shutter != null">
shutter,
</if>
<if test="aperture != null">
aperture,
</if>
<if test="high != null">
high,
</if>
<if test="width != null">
width,
</if>
<if test="filelength != null">
fileLength,
</if>
<if test="remark != null">
remark,
</if>
<if test="createtime != null">
createTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null">
#{uid,jdbcType=INTEGER},
</if>
<if test="fid != null">
#{fid,jdbcType=INTEGER},
</if>
<if test="path != null">
#{path,jdbcType=VARCHAR},
</if>
<if test="device != null">
#{device,jdbcType=VARCHAR},
</if>
<if test="gps != null">
#{gps,jdbcType=VARCHAR},
</if>
<if test="iso != null">
#{iso,jdbcType=INTEGER},
</if>
<if test="shutter != null">
#{shutter,jdbcType=VARCHAR},
</if>
<if test="aperture != null">
#{aperture,jdbcType=FLOAT},
</if>
<if test="high != null">
#{high,jdbcType=INTEGER},
</if>
<if test="width != null">
#{width,jdbcType=INTEGER},
</if>
<if test="filelength != null">
#{filelength,jdbcType=INTEGER},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
#{createtime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupImageExample" resultType="java.lang.Long">
select count(*) from t_backup_image
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_backup_image
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.uid != null">
`uid` = #{record.uid,jdbcType=INTEGER},
</if>
<if test="record.fid != null">
fid = #{record.fid,jdbcType=INTEGER},
</if>
<if test="record.path != null">
`path` = #{record.path,jdbcType=VARCHAR},
</if>
<if test="record.device != null">
device = #{record.device,jdbcType=VARCHAR},
</if>
<if test="record.gps != null">
gps = #{record.gps,jdbcType=VARCHAR},
</if>
<if test="record.iso != null">
iso = #{record.iso,jdbcType=INTEGER},
</if>
<if test="record.shutter != null">
shutter = #{record.shutter,jdbcType=VARCHAR},
</if>
<if test="record.aperture != null">
aperture = #{record.aperture,jdbcType=FLOAT},
</if>
<if test="record.high != null">
high = #{record.high,jdbcType=INTEGER},
</if>
<if test="record.width != null">
width = #{record.width,jdbcType=INTEGER},
</if>
<if test="record.filelength != null">
fileLength = #{record.filelength,jdbcType=INTEGER},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createtime != null">
createTime = #{record.createtime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_backup_image
set id = #{record.id,jdbcType=INTEGER},
`uid` = #{record.uid,jdbcType=INTEGER},
fid = #{record.fid,jdbcType=INTEGER},
`path` = #{record.path,jdbcType=VARCHAR},
device = #{record.device,jdbcType=VARCHAR},
gps = #{record.gps,jdbcType=VARCHAR},
iso = #{record.iso,jdbcType=INTEGER},
shutter = #{record.shutter,jdbcType=VARCHAR},
aperture = #{record.aperture,jdbcType=FLOAT},
high = #{record.high,jdbcType=INTEGER},
width = #{record.width,jdbcType=INTEGER},
fileLength = #{record.filelength,jdbcType=INTEGER},
remark = #{record.remark,jdbcType=VARCHAR},
createTime = #{record.createtime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupImage">
update t_backup_image
<set>
<if test="uid != null">
`uid` = #{uid,jdbcType=INTEGER},
</if>
<if test="fid != null">
fid = #{fid,jdbcType=INTEGER},
</if>
<if test="path != null">
`path` = #{path,jdbcType=VARCHAR},
</if>
<if test="device != null">
device = #{device,jdbcType=VARCHAR},
</if>
<if test="gps != null">
gps = #{gps,jdbcType=VARCHAR},
</if>
<if test="iso != null">
iso = #{iso,jdbcType=INTEGER},
</if>
<if test="shutter != null">
shutter = #{shutter,jdbcType=VARCHAR},
</if>
<if test="aperture != null">
aperture = #{aperture,jdbcType=FLOAT},
</if>
<if test="high != null">
high = #{high,jdbcType=INTEGER},
</if>
<if test="width != null">
width = #{width,jdbcType=INTEGER},
</if>
<if test="filelength != null">
fileLength = #{filelength,jdbcType=INTEGER},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
createTime = #{createtime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupImage">
update t_backup_image
set `uid` = #{uid,jdbcType=INTEGER},
fid = #{fid,jdbcType=INTEGER},
`path` = #{path,jdbcType=VARCHAR},
device = #{device,jdbcType=VARCHAR},
gps = #{gps,jdbcType=VARCHAR},
iso = #{iso,jdbcType=INTEGER},
shutter = #{shutter,jdbcType=VARCHAR},
aperture = #{aperture,jdbcType=FLOAT},
high = #{high,jdbcType=INTEGER},
width = #{width,jdbcType=INTEGER},
fileLength = #{filelength,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
createTime = #{createtime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@ -0,0 +1,205 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yutou.mobilecloud.mybatis.dao.TBackupInfoDao">
<resultMap id="BaseResultMap" type="com.yutou.mobilecloud.mybatis.model.TBackupInfo">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="uid" jdbcType="VARCHAR" property="uid" />
<result column="fid" jdbcType="INTEGER" property="fid" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, `uid`, fid, `type`, createTime
</sql>
<select id="selectByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupInfoExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_backup_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_backup_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_backup_info
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupInfoExample">
delete from t_backup_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupInfo" useGeneratedKeys="true">
insert into t_backup_info (`uid`, fid, `type`,
createTime)
values (#{uid,jdbcType=VARCHAR}, #{fid,jdbcType=INTEGER}, #{type,jdbcType=INTEGER},
#{createtime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupInfo" useGeneratedKeys="true">
insert into t_backup_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uid != null">
`uid`,
</if>
<if test="fid != null">
fid,
</if>
<if test="type != null">
`type`,
</if>
<if test="createtime != null">
createTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null">
#{uid,jdbcType=VARCHAR},
</if>
<if test="fid != null">
#{fid,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="createtime != null">
#{createtime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupInfoExample" resultType="java.lang.Long">
select count(*) from t_backup_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_backup_info
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.uid != null">
`uid` = #{record.uid,jdbcType=VARCHAR},
</if>
<if test="record.fid != null">
fid = #{record.fid,jdbcType=INTEGER},
</if>
<if test="record.type != null">
`type` = #{record.type,jdbcType=INTEGER},
</if>
<if test="record.createtime != null">
createTime = #{record.createtime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_backup_info
set id = #{record.id,jdbcType=INTEGER},
`uid` = #{record.uid,jdbcType=VARCHAR},
fid = #{record.fid,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=INTEGER},
createTime = #{record.createtime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupInfo">
update t_backup_info
<set>
<if test="uid != null">
`uid` = #{uid,jdbcType=VARCHAR},
</if>
<if test="fid != null">
fid = #{fid,jdbcType=INTEGER},
</if>
<if test="type != null">
`type` = #{type,jdbcType=INTEGER},
</if>
<if test="createtime != null">
createTime = #{createtime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yutou.mobilecloud.mybatis.model.TBackupInfo">
update t_backup_info
set `uid` = #{uid,jdbcType=VARCHAR},
fid = #{fid,jdbcType=INTEGER},
`type` = #{type,jdbcType=INTEGER},
createTime = #{createtime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@ -3,8 +3,8 @@
<mapper namespace="com.yutou.mobilecloud.mybatis.dao.TUserConfigDao"> <mapper namespace="com.yutou.mobilecloud.mybatis.dao.TUserConfigDao">
<resultMap id="BaseResultMap" type="com.yutou.mobilecloud.mybatis.model.TUserConfig"> <resultMap id="BaseResultMap" type="com.yutou.mobilecloud.mybatis.model.TUserConfig">
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<result column="uid" jdbcType="VARCHAR" property="uid" /> <result column="uid" jdbcType="INTEGER" property="uid" />
<result column="cloudmodel" jdbcType="INTEGER" property="cloudmodel" /> <result column="infoVersionBackup" jdbcType="INTEGER" property="infoversionbackup" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -65,7 +65,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `uid`, cloudmodel id, `uid`, infoVersionBackup
</sql> </sql>
<select id="selectByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TUserConfigExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.yutou.mobilecloud.mybatis.model.TUserConfigExample" resultMap="BaseResultMap">
select select
@ -98,8 +98,8 @@
</if> </if>
</delete> </delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TUserConfig" useGeneratedKeys="true"> <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TUserConfig" useGeneratedKeys="true">
insert into t_user_config (`uid`, cloudmodel) insert into t_user_config (`uid`, infoVersionBackup)
values (#{uid,jdbcType=VARCHAR}, #{cloudmodel,jdbcType=INTEGER}) values (#{uid,jdbcType=INTEGER}, #{infoversionbackup,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TUserConfig" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.mobilecloud.mybatis.model.TUserConfig" useGeneratedKeys="true">
insert into t_user_config insert into t_user_config
@ -107,16 +107,16 @@
<if test="uid != null"> <if test="uid != null">
`uid`, `uid`,
</if> </if>
<if test="cloudmodel != null"> <if test="infoversionbackup != null">
cloudmodel, infoVersionBackup,
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null"> <if test="uid != null">
#{uid,jdbcType=VARCHAR}, #{uid,jdbcType=INTEGER},
</if> </if>
<if test="cloudmodel != null"> <if test="infoversionbackup != null">
#{cloudmodel,jdbcType=INTEGER}, #{infoversionbackup,jdbcType=INTEGER},
</if> </if>
</trim> </trim>
</insert> </insert>
@ -133,10 +133,10 @@
id = #{record.id,jdbcType=INTEGER}, id = #{record.id,jdbcType=INTEGER},
</if> </if>
<if test="record.uid != null"> <if test="record.uid != null">
`uid` = #{record.uid,jdbcType=VARCHAR}, `uid` = #{record.uid,jdbcType=INTEGER},
</if> </if>
<if test="record.cloudmodel != null"> <if test="record.infoversionbackup != null">
cloudmodel = #{record.cloudmodel,jdbcType=INTEGER}, infoVersionBackup = #{record.infoversionbackup,jdbcType=INTEGER},
</if> </if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
@ -146,8 +146,8 @@
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
update t_user_config update t_user_config
set id = #{record.id,jdbcType=INTEGER}, set id = #{record.id,jdbcType=INTEGER},
`uid` = #{record.uid,jdbcType=VARCHAR}, `uid` = #{record.uid,jdbcType=INTEGER},
cloudmodel = #{record.cloudmodel,jdbcType=INTEGER} infoVersionBackup = #{record.infoversionbackup,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -156,18 +156,18 @@
update t_user_config update t_user_config
<set> <set>
<if test="uid != null"> <if test="uid != null">
`uid` = #{uid,jdbcType=VARCHAR}, `uid` = #{uid,jdbcType=INTEGER},
</if> </if>
<if test="cloudmodel != null"> <if test="infoversionbackup != null">
cloudmodel = #{cloudmodel,jdbcType=INTEGER}, infoVersionBackup = #{infoversionbackup,jdbcType=INTEGER},
</if> </if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.yutou.mobilecloud.mybatis.model.TUserConfig"> <update id="updateByPrimaryKey" parameterType="com.yutou.mobilecloud.mybatis.model.TUserConfig">
update t_user_config update t_user_config
set `uid` = #{uid,jdbcType=VARCHAR}, set `uid` = #{uid,jdbcType=INTEGER},
cloudmodel = #{cloudmodel,jdbcType=INTEGER} infoVersionBackup = #{infoversionbackup,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
</mapper> </mapper>