From 2be0eb3a71cfe3bc85fe1fc8fa80db9c824c822f Mon Sep 17 00:00:00 2001 From: houjianhui Date: Mon, 18 Sep 2017 16:04:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E5=94=AE=E7=AB=AFAPP=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9B=B4=E6=96=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unlcn/ils/sales/api/rest/VersionRest.java | 69 ++ .../ils/sales/backend/enums/VersionEnum.java | 35 + .../sales/backend/service/VersionService.java | 57 ++ .../backend/service/VersionServiceImpl.java | 88 ++ .../base/mapper/SaleVersionNoteMapper.java | 96 ++ .../mapper/SaleVersionNoteViewMapper.java | 12 + .../ils/sales/base/model/SaleVersionNote.java | 260 ++++++ .../base/model/SaleVersionNoteExample.java | 853 ++++++++++++++++++ .../mappers/SaleVersionNoteMapper.xml | 321 +++++++ .../mappers/VersionNoteViewMapper.xml | 48 + 10 files changed, 1839 insertions(+) create mode 100644 ils-sales-api/src/main/java/com/unlcn/ils/sales/api/rest/VersionRest.java create mode 100644 ils-sales-backend/src/main/java/com/unlcn/ils/sales/backend/enums/VersionEnum.java create mode 100644 ils-sales-backend/src/main/java/com/unlcn/ils/sales/backend/service/VersionService.java create mode 100644 ils-sales-backend/src/main/java/com/unlcn/ils/sales/backend/service/VersionServiceImpl.java create mode 100644 ils-sales-base/src/main/java/com/unlcn/ils/sales/base/mapper/SaleVersionNoteMapper.java create mode 100644 ils-sales-base/src/main/java/com/unlcn/ils/sales/base/mapper/SaleVersionNoteViewMapper.java create mode 100644 ils-sales-base/src/main/java/com/unlcn/ils/sales/base/model/SaleVersionNote.java create mode 100644 ils-sales-base/src/main/java/com/unlcn/ils/sales/base/model/SaleVersionNoteExample.java create mode 100644 ils-sales-base/src/main/resources/mappers/SaleVersionNoteMapper.xml create mode 100644 ils-sales-base/src/main/resources/mappers/VersionNoteViewMapper.xml diff --git a/ils-sales-api/src/main/java/com/unlcn/ils/sales/api/rest/VersionRest.java b/ils-sales-api/src/main/java/com/unlcn/ils/sales/api/rest/VersionRest.java new file mode 100644 index 0000000..77a20a1 --- /dev/null +++ b/ils-sales-api/src/main/java/com/unlcn/ils/sales/api/rest/VersionRest.java @@ -0,0 +1,69 @@ +package com.unlcn.ils.sales.api.rest; + +import cn.huiyunche.commons.domain.ResultDTO; +import com.unlcn.ils.sales.backend.service.VersionService; +import com.unlcn.ils.sales.base.model.SaleVersionNote; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * Created by houjianhui on 2017/9/18. + */ +@Controller +@RequestMapping(value = "/api/version", produces = MediaType.APPLICATION_JSON_VALUE) +@Api(value = "/order", description = "销售APP版本控制") +public class VersionRest { + + private static final Logger LOGGER = LoggerFactory.getLogger(VersionRest.class); + + private static final String project = "SALE"; + + @Autowired + private VersionService versionService; + + /** + * 获取最新的ANDROID版本信息 + * @return + */ + @RequestMapping(value="/android/latest",method= RequestMethod.GET) + @ApiOperation(value = "获取最新的ANDROID版本信息", notes = "获取最新的ANDROID版本信息", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public ResultDTO latestVersionAndroid(){ + ResultDTO result = new ResultDTO(true, null, "查询成功"); + SaleVersionNote versionNote = versionService.getLasterVersionAndroid(project); + result.setSuccess(true); + result.setData(versionNote); + if( versionNote == null){ + result.setSuccess(false); + result.setMessage("已是最新版本!"); + } + return result; + } + + /** + * 获取最新的IOS版本信息 + * @return + */ + @RequestMapping(value="/ios/latest",method= RequestMethod.GET) + @ApiOperation(value = "获取最新的IOS版本信息", notes = "获取最新的IOS版本信息", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + public ResultDTO latestVersionIOS(){ + ResultDTO result = new ResultDTO(true, null, "查询成功"); + SaleVersionNote versionNote = versionService.getLasterVersionIOS(project); + result.setSuccess(true); + result.setData(versionNote); + if( versionNote == null){ + result.setSuccess(false); + result.setMessage("已是最新版本!"); + } + return result; + } +} diff --git a/ils-sales-backend/src/main/java/com/unlcn/ils/sales/backend/enums/VersionEnum.java b/ils-sales-backend/src/main/java/com/unlcn/ils/sales/backend/enums/VersionEnum.java new file mode 100644 index 0000000..1491d23 --- /dev/null +++ b/ils-sales-backend/src/main/java/com/unlcn/ils/sales/backend/enums/VersionEnum.java @@ -0,0 +1,35 @@ +package com.unlcn.ils.sales.backend.enums; + +/** + * 版本控制枚举 + */ +public enum VersionEnum { + + ANDROID(10, "ANDROID"), + IOS(20, "IOS"); + + private final int value; + private final String text; + + VersionEnum(int value, String text) { + this.value = value; + this.text = text; + } + + public int getValue() { + return value; + } + + public String getText() { + return text; + } + + public static VersionEnum getByValue(int value) { + for (VersionEnum temp : VersionEnum.values()) { + if (temp.getValue() == value) { + return temp; + } + } + return null; + } +} diff --git a/ils-sales-backend/src/main/java/com/unlcn/ils/sales/backend/service/VersionService.java b/ils-sales-backend/src/main/java/com/unlcn/ils/sales/backend/service/VersionService.java new file mode 100644 index 0000000..a3f8e07 --- /dev/null +++ b/ils-sales-backend/src/main/java/com/unlcn/ils/sales/backend/service/VersionService.java @@ -0,0 +1,57 @@ +package com.unlcn.ils.sales.backend.service; + +import com.unlcn.ils.sales.base.model.SaleVersionNote; + +import java.util.List; + +/** + * Created by houjianhui on 2017/9/18. + */ +public interface VersionService { + /** + * 获取IOS最新版本 + * + * @return + */ + SaleVersionNote getLasterVersionIOS(String platform); + + /** + * 获取Android最新版本 + * + * @return + */ + SaleVersionNote getLasterVersionAndroid(String platform); + + /** + * 查询版本列表 + * + * @return + */ + List list() throws Exception; + + /** + * 数据修改 + * + * @param versionNote + * @return + */ + int modifyVersion(SaleVersionNote versionNote) throws Exception; + + /** + * 删除版本号 + * + * @param id 版本ID + * @return + * @throws Exception + */ + int deleteVersion(Long id) throws Exception; + + /** + * 根据ID查询版本信息 + * + * @param id + * @return + * @throws Exception + */ + SaleVersionNote selectVersionId(Long id) throws Exception; +} diff --git a/ils-sales-backend/src/main/java/com/unlcn/ils/sales/backend/service/VersionServiceImpl.java b/ils-sales-backend/src/main/java/com/unlcn/ils/sales/backend/service/VersionServiceImpl.java new file mode 100644 index 0000000..36ff717 --- /dev/null +++ b/ils-sales-backend/src/main/java/com/unlcn/ils/sales/backend/service/VersionServiceImpl.java @@ -0,0 +1,88 @@ +package com.unlcn.ils.sales.backend.service; + +import com.unlcn.ils.sales.backend.enums.VersionEnum; +import com.unlcn.ils.sales.base.mapper.SaleVersionNoteMapper; +import com.unlcn.ils.sales.base.mapper.SaleVersionNoteViewMapper; +import com.unlcn.ils.sales.base.model.SaleVersionNote; +import com.unlcn.ils.sales.base.model.SaleVersionNoteExample; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Objects; + +/** + * Created by houjianhui on 2017/9/18. + */ +@Service +public class VersionServiceImpl implements VersionService { + + private static final Logger LOGGER = LoggerFactory.getLogger(VersionServiceImpl.class); + + @Autowired + private SaleVersionNoteViewMapper saleVersionNoteViewMapper; + + @Autowired + private SaleVersionNoteMapper saleVersionNoteMapper; + + @Override + public SaleVersionNote getLasterVersionIOS(String platform) { + return getVersionNote(platform, VersionEnum.IOS.getValue()); + } + + @Override + public SaleVersionNote getLasterVersionAndroid(String platform) { + return getVersionNote(platform, VersionEnum.ANDROID.getValue()); + } + + private SaleVersionNote getVersionNote(String project, Integer appType) { + return saleVersionNoteViewMapper.selectLatestVersionNote(project, appType); + } + + @Override + public List list() throws Exception { + return saleVersionNoteMapper.selectByExample(new SaleVersionNoteExample()); + } + + @Override + public int modifyVersion(SaleVersionNote versionNote) throws Exception { + LOGGER.info("modifyVersion params versionNote: {}", versionNote); + if (StringUtils.isBlank(versionNote.getAppType())) { + LOGGER.info("appType is null"); + throw new IllegalArgumentException("APP类型不能为空"); + } else if (StringUtils.isBlank(versionNote.getPlatform())) { + LOGGER.info("platform is null"); + throw new IllegalArgumentException("平台类型不能为空"); + } else if (StringUtils.isBlank(versionNote.getVersion())) { + LOGGER.info("version is null"); + throw new IllegalArgumentException("版本号不能为空"); + } else if (versionNote.getVersionCode() == null) { + LOGGER.info("versionCode is null"); + throw new IllegalArgumentException("版本发布序号不能为空"); + } + if (null == versionNote.getId()) { + return saleVersionNoteMapper.insertSelective(versionNote); + } else { + return saleVersionNoteMapper.updateByPrimaryKeySelective(versionNote); + } + } + + @Override + public int deleteVersion(Long id) throws Exception { + LOGGER.info("deleteVersion params id: {}", id); + if (Objects.equals(id, 0) || Objects.equals(id, null)) { + LOGGER.info("id is null"); + throw new IllegalArgumentException("版本ID不能为空"); + } + return saleVersionNoteMapper.deleteByPrimaryKey(id); + } + + @Override + public SaleVersionNote selectVersionId(Long id) throws Exception { + LOGGER.info("selectVersionId params id: {}", id); + return saleVersionNoteMapper.selectByPrimaryKey(id); + } +} diff --git a/ils-sales-base/src/main/java/com/unlcn/ils/sales/base/mapper/SaleVersionNoteMapper.java b/ils-sales-base/src/main/java/com/unlcn/ils/sales/base/mapper/SaleVersionNoteMapper.java new file mode 100644 index 0000000..33d972b --- /dev/null +++ b/ils-sales-base/src/main/java/com/unlcn/ils/sales/base/mapper/SaleVersionNoteMapper.java @@ -0,0 +1,96 @@ +package com.unlcn.ils.sales.base.mapper; + +import com.unlcn.ils.sales.base.model.SaleVersionNote; +import com.unlcn.ils.sales.base.model.SaleVersionNoteExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SaleVersionNoteMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + int countByExample(SaleVersionNoteExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + int deleteByExample(SaleVersionNoteExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + int insert(SaleVersionNote record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + int insertSelective(SaleVersionNote record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + List selectByExample(SaleVersionNoteExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + SaleVersionNote selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + int updateByExampleSelective(@Param("record") SaleVersionNote record, @Param("example") SaleVersionNoteExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + int updateByExample(@Param("record") SaleVersionNote record, @Param("example") SaleVersionNoteExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + int updateByPrimaryKeySelective(SaleVersionNote record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + int updateByPrimaryKey(SaleVersionNote record); +} \ No newline at end of file diff --git a/ils-sales-base/src/main/java/com/unlcn/ils/sales/base/mapper/SaleVersionNoteViewMapper.java b/ils-sales-base/src/main/java/com/unlcn/ils/sales/base/mapper/SaleVersionNoteViewMapper.java new file mode 100644 index 0000000..91e0bc4 --- /dev/null +++ b/ils-sales-base/src/main/java/com/unlcn/ils/sales/base/mapper/SaleVersionNoteViewMapper.java @@ -0,0 +1,12 @@ +package com.unlcn.ils.sales.base.mapper; + +import com.unlcn.ils.sales.base.model.SaleVersionNote; +import org.apache.ibatis.annotations.Param; + +/** + * Created by houjianhui on 2017/9/18. + */ +public interface SaleVersionNoteViewMapper { + + SaleVersionNote selectLatestVersionNote(@Param("platform") String platform, @Param("apptype") Integer apptype); +} diff --git a/ils-sales-base/src/main/java/com/unlcn/ils/sales/base/model/SaleVersionNote.java b/ils-sales-base/src/main/java/com/unlcn/ils/sales/base/model/SaleVersionNote.java new file mode 100644 index 0000000..dd716c4 --- /dev/null +++ b/ils-sales-base/src/main/java/com/unlcn/ils/sales/base/model/SaleVersionNote.java @@ -0,0 +1,260 @@ +package com.unlcn.ils.sales.base.model; + +import java.io.Serializable; + +public class SaleVersionNote implements Serializable { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column sale_version_note.id + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column sale_version_note.release_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + private String releaseNote; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column sale_version_note.url + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + private String url; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column sale_version_note.version + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + private String version; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column sale_version_note.version_code + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + private Long versionCode; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column sale_version_note.platform + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + private String platform; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column sale_version_note.app_type + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + private String appType; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + private static final long serialVersionUID = 1L; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column sale_version_note.id + * + * @return the value of sale_version_note.id + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column sale_version_note.id + * + * @param id the value for sale_version_note.id + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column sale_version_note.release_note + * + * @return the value of sale_version_note.release_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public String getReleaseNote() { + return releaseNote; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column sale_version_note.release_note + * + * @param releaseNote the value for sale_version_note.release_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void setReleaseNote(String releaseNote) { + this.releaseNote = releaseNote == null ? null : releaseNote.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column sale_version_note.url + * + * @return the value of sale_version_note.url + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public String getUrl() { + return url; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column sale_version_note.url + * + * @param url the value for sale_version_note.url + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void setUrl(String url) { + this.url = url == null ? null : url.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column sale_version_note.version + * + * @return the value of sale_version_note.version + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public String getVersion() { + return version; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column sale_version_note.version + * + * @param version the value for sale_version_note.version + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void setVersion(String version) { + this.version = version == null ? null : version.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column sale_version_note.version_code + * + * @return the value of sale_version_note.version_code + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public Long getVersionCode() { + return versionCode; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column sale_version_note.version_code + * + * @param versionCode the value for sale_version_note.version_code + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void setVersionCode(Long versionCode) { + this.versionCode = versionCode; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column sale_version_note.platform + * + * @return the value of sale_version_note.platform + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public String getPlatform() { + return platform; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column sale_version_note.platform + * + * @param platform the value for sale_version_note.platform + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void setPlatform(String platform) { + this.platform = platform == null ? null : platform.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column sale_version_note.app_type + * + * @return the value of sale_version_note.app_type + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public String getAppType() { + return appType; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column sale_version_note.app_type + * + * @param appType the value for sale_version_note.app_type + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void setAppType(String appType) { + this.appType = appType == null ? null : appType.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", releaseNote=").append(releaseNote); + sb.append(", url=").append(url); + sb.append(", version=").append(version); + sb.append(", versionCode=").append(versionCode); + sb.append(", platform=").append(platform); + sb.append(", appType=").append(appType); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/ils-sales-base/src/main/java/com/unlcn/ils/sales/base/model/SaleVersionNoteExample.java b/ils-sales-base/src/main/java/com/unlcn/ils/sales/base/model/SaleVersionNoteExample.java new file mode 100644 index 0000000..8567ac8 --- /dev/null +++ b/ils-sales-base/src/main/java/com/unlcn/ils/sales/base/model/SaleVersionNoteExample.java @@ -0,0 +1,853 @@ +package com.unlcn.ils.sales.base.model; + +import java.util.ArrayList; +import java.util.List; + +public class SaleVersionNoteExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + protected List oredCriteria; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + protected int limitStart = -1; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + protected int limitEnd = -1; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public SaleVersionNoteExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void setLimitStart(int limitStart) { + this.limitStart=limitStart; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public int getLimitStart() { + return limitStart; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public void setLimitEnd(int limitEnd) { + this.limitEnd=limitEnd; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + public int getLimitEnd() { + return limitEnd; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andReleaseNoteIsNull() { + addCriterion("release_note is null"); + return (Criteria) this; + } + + public Criteria andReleaseNoteIsNotNull() { + addCriterion("release_note is not null"); + return (Criteria) this; + } + + public Criteria andReleaseNoteEqualTo(String value) { + addCriterion("release_note =", value, "releaseNote"); + return (Criteria) this; + } + + public Criteria andReleaseNoteNotEqualTo(String value) { + addCriterion("release_note <>", value, "releaseNote"); + return (Criteria) this; + } + + public Criteria andReleaseNoteGreaterThan(String value) { + addCriterion("release_note >", value, "releaseNote"); + return (Criteria) this; + } + + public Criteria andReleaseNoteGreaterThanOrEqualTo(String value) { + addCriterion("release_note >=", value, "releaseNote"); + return (Criteria) this; + } + + public Criteria andReleaseNoteLessThan(String value) { + addCriterion("release_note <", value, "releaseNote"); + return (Criteria) this; + } + + public Criteria andReleaseNoteLessThanOrEqualTo(String value) { + addCriterion("release_note <=", value, "releaseNote"); + return (Criteria) this; + } + + public Criteria andReleaseNoteLike(String value) { + addCriterion("release_note like", value, "releaseNote"); + return (Criteria) this; + } + + public Criteria andReleaseNoteNotLike(String value) { + addCriterion("release_note not like", value, "releaseNote"); + return (Criteria) this; + } + + public Criteria andReleaseNoteIn(List values) { + addCriterion("release_note in", values, "releaseNote"); + return (Criteria) this; + } + + public Criteria andReleaseNoteNotIn(List values) { + addCriterion("release_note not in", values, "releaseNote"); + return (Criteria) this; + } + + public Criteria andReleaseNoteBetween(String value1, String value2) { + addCriterion("release_note between", value1, value2, "releaseNote"); + return (Criteria) this; + } + + public Criteria andReleaseNoteNotBetween(String value1, String value2) { + addCriterion("release_note not between", value1, value2, "releaseNote"); + return (Criteria) this; + } + + public Criteria andUrlIsNull() { + addCriterion("url is null"); + return (Criteria) this; + } + + public Criteria andUrlIsNotNull() { + addCriterion("url is not null"); + return (Criteria) this; + } + + public Criteria andUrlEqualTo(String value) { + addCriterion("url =", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotEqualTo(String value) { + addCriterion("url <>", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlGreaterThan(String value) { + addCriterion("url >", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlGreaterThanOrEqualTo(String value) { + addCriterion("url >=", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLessThan(String value) { + addCriterion("url <", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLessThanOrEqualTo(String value) { + addCriterion("url <=", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLike(String value) { + addCriterion("url like", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotLike(String value) { + addCriterion("url not like", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlIn(List values) { + addCriterion("url in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotIn(List values) { + addCriterion("url not in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlBetween(String value1, String value2) { + addCriterion("url between", value1, value2, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotBetween(String value1, String value2) { + addCriterion("url not between", value1, value2, "url"); + return (Criteria) this; + } + + public Criteria andVersionIsNull() { + addCriterion("version is null"); + return (Criteria) this; + } + + public Criteria andVersionIsNotNull() { + addCriterion("version is not null"); + return (Criteria) this; + } + + public Criteria andVersionEqualTo(String value) { + addCriterion("version =", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotEqualTo(String value) { + addCriterion("version <>", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionGreaterThan(String value) { + addCriterion("version >", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionGreaterThanOrEqualTo(String value) { + addCriterion("version >=", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLessThan(String value) { + addCriterion("version <", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLessThanOrEqualTo(String value) { + addCriterion("version <=", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionLike(String value) { + addCriterion("version like", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotLike(String value) { + addCriterion("version not like", value, "version"); + return (Criteria) this; + } + + public Criteria andVersionIn(List values) { + addCriterion("version in", values, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotIn(List values) { + addCriterion("version not in", values, "version"); + return (Criteria) this; + } + + public Criteria andVersionBetween(String value1, String value2) { + addCriterion("version between", value1, value2, "version"); + return (Criteria) this; + } + + public Criteria andVersionNotBetween(String value1, String value2) { + addCriterion("version not between", value1, value2, "version"); + return (Criteria) this; + } + + public Criteria andVersionCodeIsNull() { + addCriterion("version_code is null"); + return (Criteria) this; + } + + public Criteria andVersionCodeIsNotNull() { + addCriterion("version_code is not null"); + return (Criteria) this; + } + + public Criteria andVersionCodeEqualTo(Long value) { + addCriterion("version_code =", value, "versionCode"); + return (Criteria) this; + } + + public Criteria andVersionCodeNotEqualTo(Long value) { + addCriterion("version_code <>", value, "versionCode"); + return (Criteria) this; + } + + public Criteria andVersionCodeGreaterThan(Long value) { + addCriterion("version_code >", value, "versionCode"); + return (Criteria) this; + } + + public Criteria andVersionCodeGreaterThanOrEqualTo(Long value) { + addCriterion("version_code >=", value, "versionCode"); + return (Criteria) this; + } + + public Criteria andVersionCodeLessThan(Long value) { + addCriterion("version_code <", value, "versionCode"); + return (Criteria) this; + } + + public Criteria andVersionCodeLessThanOrEqualTo(Long value) { + addCriterion("version_code <=", value, "versionCode"); + return (Criteria) this; + } + + public Criteria andVersionCodeIn(List values) { + addCriterion("version_code in", values, "versionCode"); + return (Criteria) this; + } + + public Criteria andVersionCodeNotIn(List values) { + addCriterion("version_code not in", values, "versionCode"); + return (Criteria) this; + } + + public Criteria andVersionCodeBetween(Long value1, Long value2) { + addCriterion("version_code between", value1, value2, "versionCode"); + return (Criteria) this; + } + + public Criteria andVersionCodeNotBetween(Long value1, Long value2) { + addCriterion("version_code not between", value1, value2, "versionCode"); + return (Criteria) this; + } + + public Criteria andPlatformIsNull() { + addCriterion("platform is null"); + return (Criteria) this; + } + + public Criteria andPlatformIsNotNull() { + addCriterion("platform is not null"); + return (Criteria) this; + } + + public Criteria andPlatformEqualTo(String value) { + addCriterion("platform =", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformNotEqualTo(String value) { + addCriterion("platform <>", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformGreaterThan(String value) { + addCriterion("platform >", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformGreaterThanOrEqualTo(String value) { + addCriterion("platform >=", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformLessThan(String value) { + addCriterion("platform <", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformLessThanOrEqualTo(String value) { + addCriterion("platform <=", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformLike(String value) { + addCriterion("platform like", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformNotLike(String value) { + addCriterion("platform not like", value, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformIn(List values) { + addCriterion("platform in", values, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformNotIn(List values) { + addCriterion("platform not in", values, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformBetween(String value1, String value2) { + addCriterion("platform between", value1, value2, "platform"); + return (Criteria) this; + } + + public Criteria andPlatformNotBetween(String value1, String value2) { + addCriterion("platform not between", value1, value2, "platform"); + return (Criteria) this; + } + + public Criteria andAppTypeIsNull() { + addCriterion("app_type is null"); + return (Criteria) this; + } + + public Criteria andAppTypeIsNotNull() { + addCriterion("app_type is not null"); + return (Criteria) this; + } + + public Criteria andAppTypeEqualTo(String value) { + addCriterion("app_type =", value, "appType"); + return (Criteria) this; + } + + public Criteria andAppTypeNotEqualTo(String value) { + addCriterion("app_type <>", value, "appType"); + return (Criteria) this; + } + + public Criteria andAppTypeGreaterThan(String value) { + addCriterion("app_type >", value, "appType"); + return (Criteria) this; + } + + public Criteria andAppTypeGreaterThanOrEqualTo(String value) { + addCriterion("app_type >=", value, "appType"); + return (Criteria) this; + } + + public Criteria andAppTypeLessThan(String value) { + addCriterion("app_type <", value, "appType"); + return (Criteria) this; + } + + public Criteria andAppTypeLessThanOrEqualTo(String value) { + addCriterion("app_type <=", value, "appType"); + return (Criteria) this; + } + + public Criteria andAppTypeLike(String value) { + addCriterion("app_type like", value, "appType"); + return (Criteria) this; + } + + public Criteria andAppTypeNotLike(String value) { + addCriterion("app_type not like", value, "appType"); + return (Criteria) this; + } + + public Criteria andAppTypeIn(List values) { + addCriterion("app_type in", values, "appType"); + return (Criteria) this; + } + + public Criteria andAppTypeNotIn(List values) { + addCriterion("app_type not in", values, "appType"); + return (Criteria) this; + } + + public Criteria andAppTypeBetween(String value1, String value2) { + addCriterion("app_type between", value1, value2, "appType"); + return (Criteria) this; + } + + public Criteria andAppTypeNotBetween(String value1, String value2) { + addCriterion("app_type not between", value1, value2, "appType"); + return (Criteria) this; + } + + public Criteria andReleaseNoteLikeInsensitive(String value) { + addCriterion("upper(release_note) like", value.toUpperCase(), "releaseNote"); + return (Criteria) this; + } + + public Criteria andUrlLikeInsensitive(String value) { + addCriterion("upper(url) like", value.toUpperCase(), "url"); + return (Criteria) this; + } + + public Criteria andVersionLikeInsensitive(String value) { + addCriterion("upper(version) like", value.toUpperCase(), "version"); + return (Criteria) this; + } + + public Criteria andPlatformLikeInsensitive(String value) { + addCriterion("upper(platform) like", value.toUpperCase(), "platform"); + return (Criteria) this; + } + + public Criteria andAppTypeLikeInsensitive(String value) { + addCriterion("upper(app_type) like", value.toUpperCase(), "appType"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table sale_version_note + * + * @mbggenerated do_not_delete_during_merge Mon Sep 18 15:23:10 CST 2017 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table sale_version_note + * + * @mbggenerated Mon Sep 18 15:23:10 CST 2017 + */ + 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); + } + } +} \ No newline at end of file diff --git a/ils-sales-base/src/main/resources/mappers/SaleVersionNoteMapper.xml b/ils-sales-base/src/main/resources/mappers/SaleVersionNoteMapper.xml new file mode 100644 index 0000000..5719ad7 --- /dev/null +++ b/ils-sales-base/src/main/resources/mappers/SaleVersionNoteMapper.xml @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + id, release_note, url, version, version_code, platform, app_type + + + + + + delete from sale_version_note + where id = #{id,jdbcType=BIGINT} + + + + delete from sale_version_note + + + + + + + + SELECT LAST_INSERT_ID() + + insert into sale_version_note (release_note, url, version, + version_code, platform, app_type + ) + values (#{releaseNote,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{version,jdbcType=VARCHAR}, + #{versionCode,jdbcType=BIGINT}, #{platform,jdbcType=VARCHAR}, #{appType,jdbcType=VARCHAR} + ) + + + + + SELECT LAST_INSERT_ID() + + insert into sale_version_note + + + release_note, + + + url, + + + version, + + + version_code, + + + platform, + + + app_type, + + + + + #{releaseNote,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{version,jdbcType=VARCHAR}, + + + #{versionCode,jdbcType=BIGINT}, + + + #{platform,jdbcType=VARCHAR}, + + + #{appType,jdbcType=VARCHAR}, + + + + + + + update sale_version_note + + + id = #{record.id,jdbcType=BIGINT}, + + + release_note = #{record.releaseNote,jdbcType=VARCHAR}, + + + url = #{record.url,jdbcType=VARCHAR}, + + + version = #{record.version,jdbcType=VARCHAR}, + + + version_code = #{record.versionCode,jdbcType=BIGINT}, + + + platform = #{record.platform,jdbcType=VARCHAR}, + + + app_type = #{record.appType,jdbcType=VARCHAR}, + + + + + + + + + update sale_version_note + set id = #{record.id,jdbcType=BIGINT}, + release_note = #{record.releaseNote,jdbcType=VARCHAR}, + url = #{record.url,jdbcType=VARCHAR}, + version = #{record.version,jdbcType=VARCHAR}, + version_code = #{record.versionCode,jdbcType=BIGINT}, + platform = #{record.platform,jdbcType=VARCHAR}, + app_type = #{record.appType,jdbcType=VARCHAR} + + + + + + + update sale_version_note + + + release_note = #{releaseNote,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + version = #{version,jdbcType=VARCHAR}, + + + version_code = #{versionCode,jdbcType=BIGINT}, + + + platform = #{platform,jdbcType=VARCHAR}, + + + app_type = #{appType,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update sale_version_note + set release_note = #{releaseNote,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + version = #{version,jdbcType=VARCHAR}, + version_code = #{versionCode,jdbcType=BIGINT}, + platform = #{platform,jdbcType=VARCHAR}, + app_type = #{appType,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/ils-sales-base/src/main/resources/mappers/VersionNoteViewMapper.xml b/ils-sales-base/src/main/resources/mappers/VersionNoteViewMapper.xml new file mode 100644 index 0000000..87a8a01 --- /dev/null +++ b/ils-sales-base/src/main/resources/mappers/VersionNoteViewMapper.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + \ No newline at end of file -- Gitee