基础模块调整,控制器增加注解,yml配置
This commit is contained in:
parent
7b62acf7de
commit
0a2315d4fa
|
|
@ -7,12 +7,14 @@ import java.util.Map;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entity基类
|
* Entity基类
|
||||||
*
|
*
|
||||||
* @author bonus
|
* @author bonus
|
||||||
*/
|
*/
|
||||||
|
@Setter
|
||||||
public class BaseEntity implements Serializable
|
public class BaseEntity implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
@ -47,61 +49,31 @@ public class BaseEntity implements Serializable
|
||||||
return searchValue;
|
return searchValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSearchValue(String searchValue)
|
|
||||||
{
|
|
||||||
this.searchValue = searchValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCreateBy()
|
public String getCreateBy()
|
||||||
{
|
{
|
||||||
return createBy;
|
return createBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreateBy(String createBy)
|
|
||||||
{
|
|
||||||
this.createBy = createBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getCreateTime()
|
public Date getCreateTime()
|
||||||
{
|
{
|
||||||
return createTime;
|
return createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreateTime(Date createTime)
|
|
||||||
{
|
|
||||||
this.createTime = createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUpdateBy()
|
public String getUpdateBy()
|
||||||
{
|
{
|
||||||
return updateBy;
|
return updateBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUpdateBy(String updateBy)
|
|
||||||
{
|
|
||||||
this.updateBy = updateBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getUpdateTime()
|
public Date getUpdateTime()
|
||||||
{
|
{
|
||||||
return updateTime;
|
return updateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUpdateTime(Date updateTime)
|
|
||||||
{
|
|
||||||
this.updateTime = updateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRemark()
|
public String getRemark()
|
||||||
{
|
{
|
||||||
return remark;
|
return remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemark(String remark)
|
|
||||||
{
|
|
||||||
this.remark = remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> getParams()
|
public Map<String, Object> getParams()
|
||||||
{
|
{
|
||||||
if (params == null)
|
if (params == null)
|
||||||
|
|
@ -111,8 +83,4 @@ public class BaseEntity implements Serializable
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParams(Map<String, Object> params)
|
|
||||||
{
|
|
||||||
this.params = params;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||||
* @author 阮世耀
|
* @author 阮世耀
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/bm_agreement")
|
@RequestMapping("/agreement")
|
||||||
public class BmAgreementController extends BaseController {
|
public class BmAgreementController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -30,7 +30,7 @@ public class BmAgreementController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/getAgreementList")
|
||||||
public TableDataInfo list(BmAgreement bmAgreement) {
|
public TableDataInfo list(BmAgreement bmAgreement) {
|
||||||
startPage();
|
startPage();
|
||||||
List<BmAgreement> list = this.bmAgreementService.selectAll();
|
List<BmAgreement> list = this.bmAgreementService.selectAll();
|
||||||
|
|
@ -56,7 +56,7 @@ public class BmAgreementController extends BaseController {
|
||||||
* @return 新增结果
|
* @return 新增结果
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public ResultBean<Boolean> add(BmAgreement bmAgreement) {
|
public ResultBean<Boolean> add(@RequestBody BmAgreement bmAgreement) {
|
||||||
int result = this.bmAgreementService.insertSelective(bmAgreement);
|
int result = this.bmAgreementService.insertSelective(bmAgreement);
|
||||||
return result > 0 ? ResultBean.success(true) : ResultBean.error("删除失败");
|
return result > 0 ? ResultBean.success(true) : ResultBean.error("删除失败");
|
||||||
}
|
}
|
||||||
|
|
@ -68,7 +68,7 @@ public class BmAgreementController extends BaseController {
|
||||||
* @return 编辑结果
|
* @return 编辑结果
|
||||||
*/
|
*/
|
||||||
@PutMapping(value = "/update")
|
@PutMapping(value = "/update")
|
||||||
public ResultBean<Boolean> edit(BmAgreement bmAgreement) {
|
public ResultBean<Boolean> edit(@RequestBody BmAgreement bmAgreement) {
|
||||||
this.bmAgreementService.updateByPrimaryKeySelective(bmAgreement);
|
this.bmAgreementService.updateByPrimaryKeySelective(bmAgreement);
|
||||||
return ResultBean.success(true);
|
return ResultBean.success(true);
|
||||||
}
|
}
|
||||||
|
|
@ -80,9 +80,8 @@ public class BmAgreementController extends BaseController {
|
||||||
* @return 删除是否成功
|
* @return 删除是否成功
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/delete/{id}")
|
@PostMapping(value = "/delete/{id}")
|
||||||
public ResultBean<Boolean> deleteById(@PathVariable("id") Integer id) {
|
public ResultBean<String> deleteById(@PathVariable("id") Integer id) {
|
||||||
this.bmAgreementService.deleteByPrimaryKey(id);
|
return ResultBean.toIsSuccess(this.bmAgreementService.deleteByPrimaryKey(id), "删除成功");
|
||||||
return ResultBean.success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,16 +26,16 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/customer")
|
@RequestMapping("/customer")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BmCustomerController extends BaseController
|
public class BmCustomerController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBmCustomerService customerService;
|
private IBmCustomerService customerService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取往来单位列表
|
* 获取往来单位列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("bm:customer:list")
|
@RequiresPermissions("base:customer:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/getList")
|
||||||
@SysLog(title = "往来单位", businessType = OperaType.QUERY, logType = 0, module = "基础管理->往来单位")
|
@SysLog(title = "往来单位", businessType = OperaType.QUERY, logType = 0, module = "基础管理->往来单位")
|
||||||
public TableDataInfo list(BmCustomer bmCustomer) {
|
public TableDataInfo list(BmCustomer bmCustomer) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -51,7 +51,7 @@ public class BmCustomerController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 根据往来单位编号获取详细信息
|
* 根据往来单位编号获取详细信息
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("bm:customer:query")
|
@RequiresPermissions("base:customer:query")
|
||||||
@GetMapping(value = "/{customerId}")
|
@GetMapping(value = "/{customerId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long customerId) {
|
public AjaxResult getInfo(@PathVariable Long customerId) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -60,14 +60,13 @@ public class BmCustomerController extends BaseController
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
}
|
}
|
||||||
return error("系统异常");
|
return error("系统异常");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增往来单位
|
* 新增往来单位
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("bm:customer:add")
|
@RequiresPermissions("base:customer:add")
|
||||||
@PostMapping
|
@PostMapping("/add")
|
||||||
@SysLog(title = "往来单位", businessType = OperaType.INSERT, logType = 0, module = "基础管理->往来单位")
|
@SysLog(title = "往来单位", businessType = OperaType.INSERT, logType = 0, module = "基础管理->往来单位")
|
||||||
public AjaxResult add(@Validated @RequestBody BmCustomer customer) {
|
public AjaxResult add(@Validated @RequestBody BmCustomer customer) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -77,15 +76,13 @@ public class BmCustomerController extends BaseController
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
}
|
}
|
||||||
return error("系统异常");
|
return error("系统异常");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改往来单位
|
* 修改往来单位
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("bm:customer:edit")
|
@RequiresPermissions("base:customer:edit")
|
||||||
@PutMapping
|
@PutMapping("/update")
|
||||||
@SysLog(title = "往来单位", businessType = OperaType.UPDATE, logType = 0, module = "基础管理->往来单位")
|
@SysLog(title = "往来单位", businessType = OperaType.UPDATE, logType = 0, module = "基础管理->往来单位")
|
||||||
public AjaxResult edit(@Validated @RequestBody BmCustomer customer) {
|
public AjaxResult edit(@Validated @RequestBody BmCustomer customer) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -95,13 +92,12 @@ public class BmCustomerController extends BaseController
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
}
|
}
|
||||||
return error("系统异常");
|
return error("系统异常");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除往来单位
|
* 删除往来单位
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("bm:customer:remove")
|
@RequiresPermissions("base:customer:remove")
|
||||||
@DeleteMapping("/{customerIds}")
|
@DeleteMapping("/{customerIds}")
|
||||||
@SysLog(title = "往来单位", businessType = OperaType.DELETE, logType = 0, module = "基础管理->往来单位")
|
@SysLog(title = "往来单位", businessType = OperaType.DELETE, logType = 0, module = "基础管理->往来单位")
|
||||||
public AjaxResult remove(@PathVariable Long[] customerIds) {
|
public AjaxResult remove(@PathVariable Long[] customerIds) {
|
||||||
|
|
@ -111,6 +107,6 @@ public class BmCustomerController extends BaseController
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
}
|
}
|
||||||
return error("系统异常");
|
return error("系统异常");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ public class BmCustomerTypeController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
@RequiresPermissions("base:customerType:add")
|
@RequiresPermissions("base:customerType:add")
|
||||||
public ResultBean<Boolean> add(BmCustomerType bmCustomerType) {
|
public ResultBean<Boolean> add(@RequestBody BmCustomerType bmCustomerType) {
|
||||||
this.bmCustomerTypeService.insertSelective(bmCustomerType);
|
this.bmCustomerTypeService.insertSelective(bmCustomerType);
|
||||||
return ResultBean.success(true);
|
return ResultBean.success(true);
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +70,7 @@ public class BmCustomerTypeController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@PutMapping(value = "/update")
|
@PutMapping(value = "/update")
|
||||||
@RequiresPermissions("base:customerType:edit")
|
@RequiresPermissions("base:customerType:edit")
|
||||||
public ResultBean<Boolean> edit(BmCustomerType bmCustomerType) {
|
public ResultBean<Boolean> edit(@RequestBody BmCustomerType bmCustomerType) {
|
||||||
this.bmCustomerTypeService.updateByPrimaryKeySelective(bmCustomerType);
|
this.bmCustomerTypeService.updateByPrimaryKeySelective(bmCustomerType);
|
||||||
return ResultBean.success(true);
|
return ResultBean.success(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package com.bonus.base.controller;
|
package com.bonus.base.controller;
|
||||||
import com.bonus.base.domain.BmCustomerType;
|
|
||||||
import com.bonus.base.domain.BmProject;
|
import com.bonus.base.domain.BmProject;
|
||||||
import com.bonus.base.service.BmProjectService;
|
import com.bonus.base.service.BmProjectService;
|
||||||
import com.bonus.base.utils.ResultBean;
|
import com.bonus.base.utils.ResultBean;
|
||||||
|
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.page.TableDataInfo;
|
import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||||
|
|
@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -18,7 +19,7 @@ import java.util.List;
|
||||||
* @author 阮世耀
|
* @author 阮世耀
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/bm_project")
|
@RequestMapping("/project")
|
||||||
public class BmProjectController extends BaseController {
|
public class BmProjectController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -60,7 +61,7 @@ public class BmProjectController extends BaseController {
|
||||||
* @return 新增结果
|
* @return 新增结果
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public ResultBean<Boolean> add(BmProject obj) {
|
public ResultBean<Boolean> add(@RequestBody BmProject obj) {
|
||||||
int result = this.bmProjectService.insertSelective(obj);
|
int result = this.bmProjectService.insertSelective(obj);
|
||||||
return result > 0 ? ResultBean.success(true) : ResultBean.error(0, "增加失败");
|
return result > 0 ? ResultBean.success(true) : ResultBean.error(0, "增加失败");
|
||||||
}
|
}
|
||||||
|
|
@ -72,21 +73,31 @@ public class BmProjectController extends BaseController {
|
||||||
* @return 编辑结果
|
* @return 编辑结果
|
||||||
*/
|
*/
|
||||||
@PutMapping(value = "/update")
|
@PutMapping(value = "/update")
|
||||||
public ResultBean<Boolean> edit(BmProject obj) {
|
public ResultBean<Boolean> edit(@RequestBody BmProject obj) {
|
||||||
this.bmProjectService.updateByPrimaryKeySelective(obj);
|
this.bmProjectService.updateByPrimaryKeySelective(obj);
|
||||||
return ResultBean.success(true);
|
return ResultBean.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除数据
|
* 逻辑删除
|
||||||
*
|
*
|
||||||
* @param id 主键
|
* @param id 主键
|
||||||
* @return 删除是否成功
|
* @return 删除是否成功
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/delete/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ResultBean<Boolean> deleteById(@PathVariable("id") Integer id) {
|
public ResultBean<String> deleteById(@PathVariable("id") Integer id) {
|
||||||
this.bmProjectService.deleteByPrimaryKey(id);
|
return ResultBean.toIsSuccess(this.bmProjectService.updateIsActive(id),"删除失败");
|
||||||
return ResultBean.success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量导出excel
|
||||||
|
*/
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, BmProject record) {
|
||||||
|
List<BmProject> list = bmProjectService.selectAll();
|
||||||
|
ExcelUtil<BmProject> util = new ExcelUtil<>(BmProject.class);
|
||||||
|
util.exportExcel(response, list, "工程管理数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "供应商管理")
|
@Api(tags = "供应商管理")
|
||||||
@RequestMapping("/bmSupplier")
|
@RequestMapping("/masupplier")
|
||||||
public class BmSupplierController extends BaseController {
|
public class BmSupplierController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 服务对象
|
* 服务对象
|
||||||
|
|
@ -37,7 +37,7 @@ public class BmSupplierController extends BaseController {
|
||||||
* @return 查询结果
|
* @return 查询结果
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "分页查询供应商列表")
|
@ApiOperation(value = "分页查询供应商列表")
|
||||||
@GetMapping("/list")
|
@GetMapping("/getMaSupplierList")
|
||||||
public TableDataInfo queryByPage(BmSupplier bmSupplier) {
|
public TableDataInfo queryByPage(BmSupplier bmSupplier) {
|
||||||
startPage();
|
startPage();
|
||||||
List<BmSupplier> list = bmSupplierService.queryByPage(bmSupplier);
|
List<BmSupplier> list = bmSupplierService.queryByPage(bmSupplier);
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,21 @@
|
||||||
package com.bonus.base.domain;
|
package com.bonus.base.domain;
|
||||||
|
|
||||||
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import java.io.Serializable;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工程表
|
* 工程管理信息表
|
||||||
* @author 阮世耀
|
* @author 阮世耀
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@ApiModel(description="工程管理")
|
|
||||||
@Data
|
@Data
|
||||||
public class BmProject implements Serializable {
|
@EqualsAndHashCode(callSuper = false) // 添加 callSuper = false
|
||||||
|
public class BmProject extends BaseEntity implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
@ -110,7 +109,7 @@ public class BmProject implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 是否启用0不启用1启用
|
* 是否启用0不启用1启用
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "是否启用:0不启用 1启用")
|
@ApiModelProperty(value = "是否启用0不启用1启用")
|
||||||
private String isActive;
|
private String isActive;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -179,4 +178,5 @@ public class BmProject implements Serializable {
|
||||||
@ApiModelProperty(value = "工程补录是否匹配")
|
@ApiModelProperty(value = "工程补录是否匹配")
|
||||||
private String isMatch;
|
private String isMatch;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
||||||
|
|
@ -61,4 +61,5 @@ public interface BmAgreementMapper {
|
||||||
* @return update count
|
* @return update count
|
||||||
*/
|
*/
|
||||||
int updateByPrimaryKey(BmAgreement record);
|
int updateByPrimaryKey(BmAgreement record);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -55,6 +55,9 @@ public interface BmProjectMapper {
|
||||||
*/
|
*/
|
||||||
int updateByPrimaryKeySelective(BmProject record);
|
int updateByPrimaryKeySelective(BmProject record);
|
||||||
|
|
||||||
|
|
||||||
|
int updateIsActive(Integer id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* update record
|
* update record
|
||||||
* @param record the updated record
|
* @param record the updated record
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.bonus.base.service;
|
package com.bonus.base.service;
|
||||||
|
|
||||||
//import com.baomidou.dynamic.datasource.annotation.DS;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,10 @@ public class BmProjectService{
|
||||||
return bmProjectMapper.deleteByPrimaryKey(id);
|
return bmProjectMapper.deleteByPrimaryKey(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int updateIsActive(Integer id) {
|
||||||
|
return bmProjectMapper.updateIsActive(id);
|
||||||
|
}
|
||||||
|
|
||||||
public int insert(BmProject record) {
|
public int insert(BmProject record) {
|
||||||
return bmProjectMapper.insert(record);
|
return bmProjectMapper.insert(record);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,4 +66,18 @@ public final class ResultBean<T> {
|
||||||
return new ResultBean<>(HttpStatus.SUCCESS, "success", data);
|
return new ResultBean<>(HttpStatus.SUCCESS, "success", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除/修改/新增操作 根据影响条数返回响应内容
|
||||||
|
*
|
||||||
|
* @param data 数据
|
||||||
|
* @return 构建的ResultBean实例
|
||||||
|
*/
|
||||||
|
public static <T> ResultBean<T> toIsSuccess(int record,T data) {
|
||||||
|
// 检查data是否为null
|
||||||
|
if (data == null) {
|
||||||
|
return new ResultBean<>(record > 0 ? HttpStatus.SUCCESS : HttpStatus.NO_CONTENT, "success", null);
|
||||||
|
}
|
||||||
|
return new ResultBean<>(record > 0 ? HttpStatus.SUCCESS : HttpStatus.NO_CONTENT, "error", data);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ server:
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
redis:
|
redis:
|
||||||
host: localhost
|
host: 192.168.0.56
|
||||||
port: 6379
|
port: 6379
|
||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List"/>
|
<include refid="Base_Column_List"/>
|
||||||
from bm_customer_type
|
from bm_customer_type
|
||||||
|
where IS_ACTIVE = '1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateById">
|
<update id="updateById">
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,7 @@
|
||||||
<result column="address" jdbcType="VARCHAR" property="address" />
|
<result column="address" jdbcType="VARCHAR" property="address" />
|
||||||
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
|
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
|
||||||
<result column="material_clerk" jdbcType="VARCHAR" property="materialClerk" />
|
<result column="material_clerk" jdbcType="VARCHAR" property="materialClerk" />
|
||||||
<result column="clerk_phone" jdbcType="VARCHAR" property="clerkPhone" />
|
|
||||||
<result column="voltage class" jdbcType="INTEGER" property="voltageClass" />
|
|
||||||
<result column="company_id" jdbcType="INTEGER" property="companyId" />
|
<result column="company_id" jdbcType="INTEGER" property="companyId" />
|
||||||
<result column="is_balance_end" jdbcType="CHAR" property="isBalanceEnd" />
|
|
||||||
<result column="time" jdbcType="VARCHAR" property="time" />
|
<result column="time" jdbcType="VARCHAR" property="time" />
|
||||||
<result column="is_active" jdbcType="VARCHAR" property="isActive" />
|
<result column="is_active" jdbcType="VARCHAR" property="isActive" />
|
||||||
<result column="lon" jdbcType="VARCHAR" property="lon" />
|
<result column="lon" jdbcType="VARCHAR" property="lon" />
|
||||||
|
|
@ -32,13 +29,14 @@
|
||||||
<result column="cvo" jdbcType="VARCHAR" property="cvo" />
|
<result column="cvo" jdbcType="VARCHAR" property="cvo" />
|
||||||
<result column="stats" jdbcType="VARCHAR" property="stats" />
|
<result column="stats" jdbcType="VARCHAR" property="stats" />
|
||||||
<result column="htzt" jdbcType="VARCHAR" property="htzt" />
|
<result column="htzt" jdbcType="VARCHAR" property="htzt" />
|
||||||
|
<result column="is_match" jdbcType="VARCHAR" property="isMatch" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
id, project_type, `name`, num, manager, nature, telphone, phone, fax, address, remarks,
|
id, project_type, `name`, num, manager, nature, telphone, phone, fax, address, remarks,
|
||||||
material_clerk, clerk_phone, `voltage class`, company_id, is_balance_end, `time`,
|
material_clerk, company_id, `time`,
|
||||||
is_active, lon, lat, company, imp_unit, dept_name, pro_id, dept_id, cvo, stats, htzt
|
is_active, lon, lat, company, imp_unit, dept_name, pro_id, dept_id, cvo, stats, htzt, is_match
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
|
|
@ -68,8 +66,7 @@
|
||||||
insert into bm_project (project_type, `name`, num,
|
insert into bm_project (project_type, `name`, num,
|
||||||
manager, nature, telphone,
|
manager, nature, telphone,
|
||||||
phone, fax, address,
|
phone, fax, address,
|
||||||
remarks, material_clerk, clerk_phone,
|
remarks, material_clerk, company_id,
|
||||||
`voltage class`, company_id, is_balance_end,
|
|
||||||
`time`, is_active, lon,
|
`time`, is_active, lon,
|
||||||
lat, company, imp_unit,
|
lat, company, imp_unit,
|
||||||
dept_name, pro_id, dept_id,
|
dept_name, pro_id, dept_id,
|
||||||
|
|
@ -77,8 +74,7 @@
|
||||||
values (#{projectType,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{num,jdbcType=VARCHAR},
|
values (#{projectType,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{num,jdbcType=VARCHAR},
|
||||||
#{manager,jdbcType=VARCHAR}, #{nature,jdbcType=VARCHAR}, #{telphone,jdbcType=VARCHAR},
|
#{manager,jdbcType=VARCHAR}, #{nature,jdbcType=VARCHAR}, #{telphone,jdbcType=VARCHAR},
|
||||||
#{phone,jdbcType=VARCHAR}, #{fax,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
|
#{phone,jdbcType=VARCHAR}, #{fax,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
|
||||||
#{remarks,jdbcType=VARCHAR}, #{materialClerk,jdbcType=VARCHAR}, #{clerkPhone,jdbcType=VARCHAR},
|
#{remarks,jdbcType=VARCHAR}, #{materialClerk,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER},
|
||||||
#{voltageClass,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{isBalanceEnd,jdbcType=CHAR},
|
|
||||||
#{time,jdbcType=VARCHAR}, '1', #{lon,jdbcType=VARCHAR},
|
#{time,jdbcType=VARCHAR}, '1', #{lon,jdbcType=VARCHAR},
|
||||||
#{lat,jdbcType=VARCHAR}, #{company,jdbcType=VARCHAR}, #{impUnit,jdbcType=VARCHAR},
|
#{lat,jdbcType=VARCHAR}, #{company,jdbcType=VARCHAR}, #{impUnit,jdbcType=VARCHAR},
|
||||||
#{deptName,jdbcType=VARCHAR}, #{proId,jdbcType=VARCHAR}, #{deptId,jdbcType=INTEGER},
|
#{deptName,jdbcType=VARCHAR}, #{proId,jdbcType=VARCHAR}, #{deptId,jdbcType=INTEGER},
|
||||||
|
|
@ -122,18 +118,9 @@
|
||||||
<if test="materialClerk != null and materialClerk != ''">
|
<if test="materialClerk != null and materialClerk != ''">
|
||||||
material_clerk,
|
material_clerk,
|
||||||
</if>
|
</if>
|
||||||
<if test="clerkPhone != null and clerkPhone != ''">
|
|
||||||
clerk_phone,
|
|
||||||
</if>
|
|
||||||
<if test="voltageClass != null">
|
|
||||||
`voltage class`,
|
|
||||||
</if>
|
|
||||||
<if test="companyId != null">
|
<if test="companyId != null">
|
||||||
company_id,
|
company_id,
|
||||||
</if>
|
</if>
|
||||||
<if test="isBalanceEnd != null and isBalanceEnd != ''">
|
|
||||||
is_balance_end,
|
|
||||||
</if>
|
|
||||||
<if test="time != null and time != ''">
|
<if test="time != null and time != ''">
|
||||||
`time`,
|
`time`,
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -168,7 +155,7 @@
|
||||||
stats,
|
stats,
|
||||||
</if>
|
</if>
|
||||||
<if test="htzt != null and htzt != ''">
|
<if test="htzt != null and htzt != ''">
|
||||||
htzt,
|
htzt
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
|
@ -205,18 +192,9 @@
|
||||||
<if test="materialClerk != null and materialClerk != ''">
|
<if test="materialClerk != null and materialClerk != ''">
|
||||||
#{materialClerk,jdbcType=VARCHAR},
|
#{materialClerk,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="clerkPhone != null and clerkPhone != ''">
|
|
||||||
#{clerkPhone,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="voltageClass != null">
|
|
||||||
#{voltageClass,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="companyId != null">
|
<if test="companyId != null">
|
||||||
#{companyId,jdbcType=INTEGER},
|
#{companyId,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="isBalanceEnd != null and isBalanceEnd != ''">
|
|
||||||
#{isBalanceEnd,jdbcType=CHAR},
|
|
||||||
</if>
|
|
||||||
<if test="time != null and time != ''">
|
<if test="time != null and time != ''">
|
||||||
#{time,jdbcType=VARCHAR},
|
#{time,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -251,7 +229,7 @@
|
||||||
#{stats,jdbcType=VARCHAR},
|
#{stats,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="htzt != null and htzt != ''">
|
<if test="htzt != null and htzt != ''">
|
||||||
#{htzt,jdbcType=VARCHAR},
|
#{htzt,jdbcType=VARCHAR}
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
@ -292,18 +270,9 @@
|
||||||
<if test="materialClerk != null and materialClerk != ''">
|
<if test="materialClerk != null and materialClerk != ''">
|
||||||
material_clerk = #{materialClerk,jdbcType=VARCHAR},
|
material_clerk = #{materialClerk,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="clerkPhone != null and clerkPhone != ''">
|
|
||||||
clerk_phone = #{clerkPhone,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="voltageClass != null">
|
|
||||||
`voltage class` = #{voltageClass,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="companyId != null">
|
<if test="companyId != null">
|
||||||
company_id = #{companyId,jdbcType=INTEGER},
|
company_id = #{companyId,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="isBalanceEnd != null and isBalanceEnd != ''">
|
|
||||||
is_balance_end = #{isBalanceEnd,jdbcType=CHAR},
|
|
||||||
</if>
|
|
||||||
<if test="time != null and time != ''">
|
<if test="time != null and time != ''">
|
||||||
`time` = #{time,jdbcType=VARCHAR},
|
`time` = #{time,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -343,6 +312,7 @@
|
||||||
</set>
|
</set>
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updateByPrimaryKey" parameterType="com.bonus.base.domain.BmProject">
|
<update id="updateByPrimaryKey" parameterType="com.bonus.base.domain.BmProject">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
update bm_project
|
update bm_project
|
||||||
|
|
@ -357,10 +327,7 @@
|
||||||
address = #{address,jdbcType=VARCHAR},
|
address = #{address,jdbcType=VARCHAR},
|
||||||
remarks = #{remarks,jdbcType=VARCHAR},
|
remarks = #{remarks,jdbcType=VARCHAR},
|
||||||
material_clerk = #{materialClerk,jdbcType=VARCHAR},
|
material_clerk = #{materialClerk,jdbcType=VARCHAR},
|
||||||
clerk_phone = #{clerkPhone,jdbcType=VARCHAR},
|
|
||||||
`voltage class` = #{voltageClass,jdbcType=INTEGER},
|
|
||||||
company_id = #{companyId,jdbcType=INTEGER},
|
company_id = #{companyId,jdbcType=INTEGER},
|
||||||
is_balance_end = #{isBalanceEnd,jdbcType=CHAR},
|
|
||||||
`time` = #{time,jdbcType=VARCHAR},
|
`time` = #{time,jdbcType=VARCHAR},
|
||||||
is_active = #{isActive,jdbcType=VARCHAR},
|
is_active = #{isActive,jdbcType=VARCHAR},
|
||||||
lon = #{lon,jdbcType=VARCHAR},
|
lon = #{lon,jdbcType=VARCHAR},
|
||||||
|
|
@ -375,6 +342,7 @@
|
||||||
htzt = #{htzt,jdbcType=VARCHAR}
|
htzt = #{htzt,jdbcType=VARCHAR}
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.bonus.base.domain.BmProject" useGeneratedKeys="true">
|
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.bonus.base.domain.BmProject" useGeneratedKeys="true">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
insert into bm_project
|
insert into bm_project
|
||||||
|
|
@ -393,10 +361,7 @@
|
||||||
address,
|
address,
|
||||||
remarks,
|
remarks,
|
||||||
material_clerk,
|
material_clerk,
|
||||||
clerk_phone,
|
|
||||||
`voltage class`,
|
|
||||||
company_id,
|
company_id,
|
||||||
is_balance_end,
|
|
||||||
`time`,
|
`time`,
|
||||||
is_active,
|
is_active,
|
||||||
lon,
|
lon,
|
||||||
|
|
@ -426,10 +391,7 @@
|
||||||
#{address,jdbcType=VARCHAR},
|
#{address,jdbcType=VARCHAR},
|
||||||
#{remarks,jdbcType=VARCHAR},
|
#{remarks,jdbcType=VARCHAR},
|
||||||
#{materialClerk,jdbcType=VARCHAR},
|
#{materialClerk,jdbcType=VARCHAR},
|
||||||
#{clerkPhone,jdbcType=VARCHAR},
|
|
||||||
#{voltageClass,jdbcType=INTEGER},
|
|
||||||
#{companyId,jdbcType=INTEGER},
|
#{companyId,jdbcType=INTEGER},
|
||||||
#{isBalanceEnd,jdbcType=CHAR},
|
|
||||||
#{time,jdbcType=VARCHAR},
|
#{time,jdbcType=VARCHAR},
|
||||||
#{isActive,jdbcType=VARCHAR},
|
#{isActive,jdbcType=VARCHAR},
|
||||||
#{lon,jdbcType=VARCHAR},
|
#{lon,jdbcType=VARCHAR},
|
||||||
|
|
@ -459,10 +421,7 @@
|
||||||
address = #{address,jdbcType=VARCHAR},
|
address = #{address,jdbcType=VARCHAR},
|
||||||
remarks = #{remarks,jdbcType=VARCHAR},
|
remarks = #{remarks,jdbcType=VARCHAR},
|
||||||
material_clerk = #{materialClerk,jdbcType=VARCHAR},
|
material_clerk = #{materialClerk,jdbcType=VARCHAR},
|
||||||
clerk_phone = #{clerkPhone,jdbcType=VARCHAR},
|
|
||||||
`voltage class` = #{voltageClass,jdbcType=INTEGER},
|
|
||||||
company_id = #{companyId,jdbcType=INTEGER},
|
company_id = #{companyId,jdbcType=INTEGER},
|
||||||
is_balance_end = #{isBalanceEnd,jdbcType=CHAR},
|
|
||||||
`time` = #{time,jdbcType=VARCHAR},
|
`time` = #{time,jdbcType=VARCHAR},
|
||||||
is_active = #{isActive,jdbcType=VARCHAR},
|
is_active = #{isActive,jdbcType=VARCHAR},
|
||||||
lon = #{lon,jdbcType=VARCHAR},
|
lon = #{lon,jdbcType=VARCHAR},
|
||||||
|
|
@ -517,18 +476,9 @@
|
||||||
<if test="materialClerk != null and materialClerk != ''">
|
<if test="materialClerk != null and materialClerk != ''">
|
||||||
material_clerk,
|
material_clerk,
|
||||||
</if>
|
</if>
|
||||||
<if test="clerkPhone != null and clerkPhone != ''">
|
|
||||||
clerk_phone,
|
|
||||||
</if>
|
|
||||||
<if test="voltageClass != null">
|
|
||||||
`voltage class`,
|
|
||||||
</if>
|
|
||||||
<if test="companyId != null">
|
<if test="companyId != null">
|
||||||
company_id,
|
company_id,
|
||||||
</if>
|
</if>
|
||||||
<if test="isBalanceEnd != null and isBalanceEnd != ''">
|
|
||||||
is_balance_end,
|
|
||||||
</if>
|
|
||||||
<if test="time != null and time != ''">
|
<if test="time != null and time != ''">
|
||||||
`time`,
|
`time`,
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -604,18 +554,9 @@
|
||||||
<if test="materialClerk != null and materialClerk != ''">
|
<if test="materialClerk != null and materialClerk != ''">
|
||||||
#{materialClerk,jdbcType=VARCHAR},
|
#{materialClerk,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="clerkPhone != null and clerkPhone != ''">
|
|
||||||
#{clerkPhone,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="voltageClass != null">
|
|
||||||
#{voltageClass,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="companyId != null">
|
<if test="companyId != null">
|
||||||
#{companyId,jdbcType=INTEGER},
|
#{companyId,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="isBalanceEnd != null and isBalanceEnd != ''">
|
|
||||||
#{isBalanceEnd,jdbcType=CHAR},
|
|
||||||
</if>
|
|
||||||
<if test="time != null and time != ''">
|
<if test="time != null and time != ''">
|
||||||
#{time,jdbcType=VARCHAR},
|
#{time,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -691,18 +632,9 @@
|
||||||
<if test="materialClerk != null and materialClerk != ''">
|
<if test="materialClerk != null and materialClerk != ''">
|
||||||
material_clerk = #{materialClerk,jdbcType=VARCHAR},
|
material_clerk = #{materialClerk,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="clerkPhone != null and clerkPhone != ''">
|
|
||||||
clerk_phone = #{clerkPhone,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="voltageClass != null">
|
|
||||||
`voltage class` = #{voltageClass,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="companyId != null">
|
<if test="companyId != null">
|
||||||
company_id = #{companyId,jdbcType=INTEGER},
|
company_id = #{companyId,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="isBalanceEnd != null and isBalanceEnd != ''">
|
|
||||||
is_balance_end = #{isBalanceEnd,jdbcType=CHAR},
|
|
||||||
</if>
|
|
||||||
<if test="time != null and time != ''">
|
<if test="time != null and time != ''">
|
||||||
`time` = #{time,jdbcType=VARCHAR},
|
`time` = #{time,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -741,4 +673,9 @@
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateIsActive">
|
||||||
|
update bm_project set is_active = '0' where id = #{id,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue