Commit 97cdadfe by 张祺

增加lombok,增加mybatis的工具,省去getset方法和mybatis一些公共的查询代码

parent 1819a260
...@@ -129,6 +129,18 @@ ...@@ -129,6 +129,18 @@
<artifactId>mybatis-spring-boot-starter</artifactId> <artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.2</version> <version>2.1.2</version>
</dependency> </dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
<version>2.0.4</version>
</dependency>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
<version>1.16.18</version>
</dependency>
</dependencies> </dependencies>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
......
...@@ -5,6 +5,7 @@ import java.util.List; ...@@ -5,6 +5,7 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.keymobile.indicators.model.entity.GeneralParm; import com.keymobile.indicators.model.entity.GeneralParm;
...@@ -33,4 +34,10 @@ public class IndAcsDefCtrl { ...@@ -33,4 +34,10 @@ public class IndAcsDefCtrl {
public List<GeneralParm> getAllParm()throws Exception{ public List<GeneralParm> getAllParm()throws Exception{
return generalParmService.getAll(); return generalParmService.getAll();
} }
@ApiOperation(value = "根据id获取分析指标", notes = "根据id获取分析指标")
@PostMapping(value = "/getById")
public IndAcsDef getById(@RequestParam("id")Integer id){
return indAcsDefService.getById(id);
}
} }
package com.keymobile.indicators.model.entity; package com.keymobile.indicators.model.entity;
import lombok.Data;
import javax.persistence.Table;
import java.util.Date; import java.util.Date;
/** /**
* author:zhangkb time:2020-4-15 desc:考核指标定义表 * author:zhangkb time:2020-4-15 desc:考核指标定义表
*/ */
@Table(name="ind_acs_ind_def_inf")
@Data
public class IndAcsDef { public class IndAcsDef {
private String indId;//指标编号 private String indId;//指标编号
private String indName;//指标名称 private String indName;//指标名称
...@@ -31,149 +36,6 @@ public class IndAcsDef { ...@@ -31,149 +36,6 @@ public class IndAcsDef {
private String updUserId;//更新人用户编号 private String updUserId;//更新人用户编号
private Date updTime;//更新时间 private Date updTime;//更新时间
public String getIndId() {
return indId;
}
public void setIndId(String indId) {
this.indId = indId;
}
public String getIndName() {
return indName;
}
public void setIndName(String indName) {
this.indName = indName;
}
public String getIndTypeCd() {
return indTypeCd;
}
public void setIndTypeCd(String indTypeCd) {
this.indTypeCd = indTypeCd;
}
public String getIndType() {
return indType;
}
public void setIndType(String indType) {
this.indType = indType;
}
public String getAcsSysCd() {
return acsSysCd;
}
public void setAcsSysCd(String acsSysCd) {
this.acsSysCd = acsSysCd;
}
public String getAcsSysName() {
return acsSysName;
}
public void setAcsSysName(String acsSysName) {
this.acsSysName = acsSysName;
}
public String getAcsDimCd() {
return acsDimCd;
}
public void setAcsDimCd(String acsDimCd) {
this.acsDimCd = acsDimCd;
}
public String getAcsDimName() {
return acsDimName;
}
public void setAcsDimName(String acsDimName) {
this.acsDimName = acsDimName;
}
public String getUndType() {
return undType;
}
public void setUndType(String undType) {
this.undType = undType;
}
public String getUnt() {
return unt;
}
public void setUnt(String unt) {
this.unt = unt;
}
public String getMarkTypeCd() {
return markTypeCd;
}
public void setMarkTypeCd(String markTypeCd) {
this.markTypeCd = markTypeCd;
}
public String getMarkType() {
return markType;
}
public void setMarkType(String markType) {
this.markType = markType;
}
public String getFreqCd() {
return freqCd;
}
public void setFreqCd(String freqCd) {
this.freqCd = freqCd;
}
public String getFreqName() {
return freqName;
}
public void setFreqName(String freqName) {
this.freqName = freqName;
}
public double getWeight() {
return weight;
}
public void setWeight(double weight) {
this.weight = weight;
}
public String getCltCmt() {
return cltCmt;
}
public void setCltCmt(String cltCmt) {
this.cltCmt = cltCmt;
}
public String getMarkRule() {
return markRule;
}
public void setMarkRule(String markRule) {
this.markRule = markRule;
}
public String getIsValid() {
return isValid;
}
public void setIsValid(String isValid) {
this.isValid = isValid;
}
public String getDefUserId() {
return defUserId;
}
public void setDefUserId(String defUserId) {
this.defUserId = defUserId;
}
public Date getDefTime() {
return defTime;
}
public void setDefTime(Date defTime) {
this.defTime = defTime;
}
public String getUpdUserId() {
return updUserId;
}
public void setUpdUserId(String updUserId) {
this.updUserId = updUserId;
}
public Date getUpdTime() {
return updTime;
}
public void setUpdTime(Date updTime) {
this.updTime = updTime;
}
public String getDataSrc() {
return dataSrc;
}
public void setDataSrc(String dataSrc) {
this.dataSrc = dataSrc;
}
public String getDataHbr() {
return dataHbr;
}
public void setDataHbr(String dataHbr) {
this.dataHbr = dataHbr;
}
} }
...@@ -5,8 +5,9 @@ import java.util.List; ...@@ -5,8 +5,9 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import com.keymobile.indicators.model.entity.IndAcsDef; import com.keymobile.indicators.model.entity.IndAcsDef;
import tk.mybatis.mapper.common.BaseMapper;
@Mapper @Mapper
public interface IndAcsDefMapper { public interface IndAcsDefMapper extends BaseMapper<IndAcsDef> {
List<IndAcsDef> getAll(); List<IndAcsDef> getAll();
} }
...@@ -16,4 +16,8 @@ public class IndAcsDefService { ...@@ -16,4 +16,8 @@ public class IndAcsDefService {
public List<IndAcsDef> getAll(){ public List<IndAcsDef> getAll(){
return indAcsDefMapper.getAll(); return indAcsDefMapper.getAll();
} }
public IndAcsDef getById(Integer id) {
return indAcsDefMapper.selectByPrimaryKey(id);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment