Browse Source

新增转租管理;

结构调整
master
梁欣 2 years ago
parent
commit
d61e7b163d
  1. 2
      src/main/java/com/gxwebsoft/tower/controller/TowerContractController.java
  2. 152
      src/main/java/com/gxwebsoft/tower/controller/TowerLendingController.java
  3. 153
      src/main/java/com/gxwebsoft/tower/controller/TowerLendingSettleListController.java
  4. 3
      src/main/java/com/gxwebsoft/tower/entity/TowerContractEquipment.java
  5. 3
      src/main/java/com/gxwebsoft/tower/entity/TowerContractSettleEquipment.java
  6. 5
      src/main/java/com/gxwebsoft/tower/entity/TowerCustomer.java
  7. 84
      src/main/java/com/gxwebsoft/tower/entity/TowerLending.java
  8. 124
      src/main/java/com/gxwebsoft/tower/entity/TowerLendingSettleList.java
  9. 3
      src/main/java/com/gxwebsoft/tower/mapper/TowerEquipmentMapper.java
  10. 38
      src/main/java/com/gxwebsoft/tower/mapper/TowerLendingMapper.java
  11. 38
      src/main/java/com/gxwebsoft/tower/mapper/TowerLendingSettleListMapper.java
  12. 59
      src/main/java/com/gxwebsoft/tower/mapper/xml/TowerLendingMapper.xml
  13. 98
      src/main/java/com/gxwebsoft/tower/mapper/xml/TowerLendingSettleListMapper.xml
  14. 58
      src/main/java/com/gxwebsoft/tower/param/TowerLendingParam.java
  15. 109
      src/main/java/com/gxwebsoft/tower/param/TowerLendingSettleListParam.java
  16. 42
      src/main/java/com/gxwebsoft/tower/service/TowerLendingService.java
  17. 42
      src/main/java/com/gxwebsoft/tower/service/TowerLendingSettleListService.java
  18. 47
      src/main/java/com/gxwebsoft/tower/service/impl/TowerLendingServiceImpl.java
  19. 47
      src/main/java/com/gxwebsoft/tower/service/impl/TowerLendingSettleListServiceImpl.java
  20. 3
      src/test/java/com/gxwebsoft/generator/TowerGenerator.java

2
src/main/java/com/gxwebsoft/tower/controller/TowerContractController.java

@ -100,7 +100,7 @@ public class TowerContractController extends BaseController {
@PutMapping()
public ApiResult<?> update(@RequestBody TowerContract towerContract) {
if (towerContractService.updateById(towerContract)) {
return success("修改成功");
return success(towerContract.getContractId());
}
return fail("修改失败");
}

152
src/main/java/com/gxwebsoft/tower/controller/TowerLendingController.java

@ -0,0 +1,152 @@
package com.gxwebsoft.tower.controller;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.Company;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.tower.entity.*;
import com.gxwebsoft.tower.service.TowerLendingService;
import com.gxwebsoft.tower.param.TowerLendingParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 拆借管理控制器
*
* @author 科技小王子
* @since 2023-06-15 10:29:54
*/
@Api(tags = "拆借管理管理")
@RestController
@RequestMapping("/api/tower/tower-lending")
public class TowerLendingController extends BaseController {
@Resource
private TowerLendingService towerLendingService;
@PreAuthorize("hasAuthority('tower:towerLending:list')")
@OperationLog
@ApiOperation("分页查询拆借管理")
@GetMapping("/page")
public ApiResult<PageResult<TowerLending>> page(TowerLendingParam param) {
MPJLambdaWrapper<TowerLending> wrapper = new MPJLambdaWrapper<>();
wrapper.selectAll(TowerLending.class)
.select(TowerContract::getContactNumber)
.select(TowerContract::getSignDate)
.select(TowerProject::getProjectName)
.selectAs(TowerCustomer::getName, TowerCustomer::getCustomerName)
.select(Company::getCompanyName)
.leftJoin(TowerContract.class, TowerContract::getContractId, TowerLending::getContractId)
.leftJoin(TowerProject.class, TowerProject::getProjectId, TowerContract::getProjectId)
.leftJoin(TowerCustomer.class, TowerCustomer::getCustomerId, TowerContract::getCustomerId)
.leftJoin(Company.class, Company::getCompanyId, TowerContract::getCompanyId);
PageParam<TowerLending, TowerLendingParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(towerLendingService.page(page, wrapper));
// 使用关联查询
//return success(towerLendingService.pageRel(param));
}
@PreAuthorize("hasAuthority('tower:towerLending:list')")
@OperationLog
@ApiOperation("查询全部拆借管理")
@GetMapping()
public ApiResult<List<TowerLending>> list(TowerLendingParam param) {
PageParam<TowerLending, TowerLendingParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(towerLendingService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(towerLendingService.listRel(param));
}
@PreAuthorize("hasAuthority('tower:towerLending:list')")
@OperationLog
@ApiOperation("根据id查询拆借管理")
@GetMapping("/{id}")
public ApiResult<TowerLending> get(@PathVariable("id") Integer id) {
return success(towerLendingService.getById(id));
// 使用关联查询
//return success(towerLendingService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('tower:towerLending:save')")
@OperationLog
@ApiOperation("添加拆借管理")
@PostMapping()
public ApiResult<?> save(@RequestBody TowerLending towerLending) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
towerLending.setUserId(loginUser.getUserId());
}
if (towerLendingService.save(towerLending)) {
return success(towerLending.getLendingId());
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('tower:towerLending:update')")
@OperationLog
@ApiOperation("修改拆借管理")
@PutMapping()
public ApiResult<?> update(@RequestBody TowerLending towerLending) {
if (towerLendingService.updateById(towerLending)) {
return success(towerLending.getLendingId());
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('tower:towerLending:remove')")
@OperationLog
@ApiOperation("删除拆借管理")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (towerLendingService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('tower:towerLending:save')")
@OperationLog
@ApiOperation("批量添加拆借管理")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<TowerLending> list) {
if (towerLendingService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('tower:towerLending:update')")
@OperationLog
@ApiOperation("批量修改拆借管理")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<TowerLending> batchParam) {
if (batchParam.update(towerLendingService, "lending_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('tower:towerLending:remove')")
@OperationLog
@ApiOperation("批量删除拆借管理")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (towerLendingService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

153
src/main/java/com/gxwebsoft/tower/controller/TowerLendingSettleListController.java

@ -0,0 +1,153 @@
package com.gxwebsoft.tower.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.gxwebsoft.apps.entity.Equipment;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.Company;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.tower.entity.*;
import com.gxwebsoft.tower.service.TowerLendingSettleListService;
import com.gxwebsoft.tower.param.TowerLendingSettleListParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 拆借结算清单控制器
*
* @author 科技小王子
* @since 2023-06-15 10:29:54
*/
@Api(tags = "拆借结算清单管理")
@RestController
@RequestMapping("/api/tower/tower-lending-settle")
public class TowerLendingSettleListController extends BaseController {
@Resource
private TowerLendingSettleListService towerLendingSettleListService;
@PreAuthorize("hasAuthority('tower:towerLending:list')")
@OperationLog
@ApiOperation("分页查询拆借结算清单")
@GetMapping("/page")
public ApiResult<PageResult<TowerLendingSettleList>> page(TowerLendingSettleListParam param) {
PageParam<TowerLendingSettleList, TowerLendingSettleListParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(towerLendingSettleListService.page(page, page.getWrapper()));
// 使用关联查询
//return success(towerLendingSettleListService.pageRel(param));
}
@PreAuthorize("hasAuthority('tower:towerLending:list')")
@OperationLog
@ApiOperation("查询全部拆借结算清单")
@GetMapping()
public ApiResult<List<TowerLendingSettleList>> list(TowerLendingSettleListParam param) {
MPJLambdaWrapper<TowerLendingSettleList> wrapper = new MPJLambdaWrapper<>();
wrapper.selectAll(TowerLendingSettleList.class)
.selectAs(TowerEquipment::getName, TowerEquipment::getEquipmentName)
.select(TowerEquipment::getFactoryNo)
.select(TowerEquipment::getFilingNo)
.select(TowerEquipment::getEquipmentNo)
.leftJoin(TowerEquipment.class, TowerEquipment::getEquipmentId, TowerLendingSettleList::getEquipmentId);
PageParam<TowerLendingSettleList, TowerLendingSettleListParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(towerLendingSettleListService.list(wrapper));
// 使用关联查询
//return success(towerLendingSettleListService.listRel(param));
}
@PreAuthorize("hasAuthority('tower:towerLending:list')")
@OperationLog
@ApiOperation("根据id查询拆借结算清单")
@GetMapping("/{id}")
public ApiResult<TowerLendingSettleList> get(@PathVariable("id") Integer id) {
return success(towerLendingSettleListService.getById(id));
// 使用关联查询
//return success(towerLendingSettleListService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('tower:towerLending:save')")
@OperationLog
@ApiOperation("添加拆借结算清单")
@PostMapping()
public ApiResult<?> save(@RequestBody TowerLendingSettleList towerLendingSettleList) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
towerLendingSettleList.setUserId(loginUser.getUserId());
}
if (towerLendingSettleListService.save(towerLendingSettleList)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('tower:towerLending:update')")
@OperationLog
@ApiOperation("修改拆借结算清单")
@PutMapping()
public ApiResult<?> update(@RequestBody TowerLendingSettleList towerLendingSettleList) {
if (towerLendingSettleListService.updateById(towerLendingSettleList)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('tower:towerLending:remove')")
@OperationLog
@ApiOperation("删除拆借结算清单")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (towerLendingSettleListService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('tower:towerLending:save')")
@OperationLog
@ApiOperation("批量添加拆借结算清单")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<TowerLendingSettleList> list) {
QueryWrapper<TowerLendingSettleList> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("lending_id", list.get(0).getLendingId());
towerLendingSettleListService.remove(queryWrapper);
if (towerLendingSettleListService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('tower:towerLending:update')")
@OperationLog
@ApiOperation("批量修改拆借结算清单")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<TowerLendingSettleList> batchParam) {
if (batchParam.update(towerLendingSettleListService, "lending_settle_list_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('tower:towerLending:remove')")
@OperationLog
@ApiOperation("批量删除拆借结算清单")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (towerLendingSettleListService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

3
src/main/java/com/gxwebsoft/tower/entity/TowerContractEquipment.java

@ -29,6 +29,9 @@ public class TowerContractEquipment implements Serializable {
@ApiModelProperty(value = "合同ID")
private Integer contractId;
@ApiModelProperty(value = "设备ID")
private Integer equipmentId;
@ApiModelProperty(value = "设备")
private String equipmentName;

3
src/main/java/com/gxwebsoft/tower/entity/TowerContractSettleEquipment.java

@ -28,6 +28,9 @@ public class TowerContractSettleEquipment implements Serializable {
private Integer contractId;
@ApiModelProperty(value = "设备ID")
private Integer equipmentId;
@ApiModelProperty(value = "设备")
private String equipmentName;

5
src/main/java/com/gxwebsoft/tower/entity/TowerCustomer.java

@ -1,6 +1,7 @@
package com.gxwebsoft.tower.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
@ -28,6 +29,10 @@ public class TowerCustomer implements Serializable {
@ApiModelProperty(value = "客户名称")
private String name;
@ApiModelProperty(value = "客户名称")
@TableField(exist = false)
private String customerName;
@ApiModelProperty(value = "全称")
private String fullName;

84
src/main/java/com/gxwebsoft/tower/entity/TowerLending.java

@ -0,0 +1,84 @@
package com.gxwebsoft.tower.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 拆借管理
*
* @author 科技小王子
* @since 2023-06-15 10:29:54
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "TowerLending对象", description = "拆借管理")
public class TowerLending implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "lending_id", type = IdType.AUTO)
private Integer lendingId;
@ApiModelProperty(value = "合同ID")
private Integer contractId;
@ApiModelProperty(value = "产权单位")
private String propertyCompany;
@ApiModelProperty(value = "结算日期")
private String settleDate;
@ApiModelProperty(value = "本期结算金额")
private BigDecimal settleAmount;
@ApiModelProperty(value = "附件")
private String fileList;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "所有人")
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
@ApiModelProperty(value = "合同编号")
@TableField(exist = false)
private String contactNumber;
@ApiModelProperty(value = "签订时间")
@TableField(exist = false)
private LocalDateTime signDate;
@ApiModelProperty(value = "项目名称")
@TableField(exist = false)
private String projectName;
@ApiModelProperty(value = "承租方")
@TableField(exist = false)
private String customerName;
@ApiModelProperty(value = "租赁方")
@TableField(exist = false)
private String companyName;
}

124
src/main/java/com/gxwebsoft/tower/entity/TowerLendingSettleList.java

@ -0,0 +1,124 @@
package com.gxwebsoft.tower.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 拆借结算清单
*
* @author 科技小王子
* @since 2023-06-15 10:29:54
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "TowerLendingSettleList对象", description = "拆借结算清单")
public class TowerLendingSettleList implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "lending_settle_list_id", type = IdType.AUTO)
private Integer lendingSettleListId;
@ApiModelProperty(value = "拆借主单id")
private Integer lendingId;
@ApiModelProperty(value = "设备")
private Integer equipmentId;
@ApiModelProperty(value = "拆借路线")
private String lendingPath;
@ApiModelProperty(value = "合作方式")
private String coopWay;
@ApiModelProperty(value = "结算开始日期")
private String startDate;
@ApiModelProperty(value = "结算截止日期")
private String stopDate;
@ApiModelProperty(value = "计费天数")
private Integer calDay;
@ApiModelProperty(value = "整月")
private Boolean isFullMonth;
@ApiModelProperty(value = "月计费天数")
private Integer daysInMonth;
@ApiModelProperty(value = "月租金")
private BigDecimal monthRentAmount;
@ApiModelProperty(value = "应付租金")
private BigDecimal shouldPayRentAmount;
@ApiModelProperty(value = "日租金")
private BigDecimal dailyRentAmount;
@ApiModelProperty(value = "应补租金")
private BigDecimal shouldSupplementAmount;
@ApiModelProperty(value = "应扣租金")
private BigDecimal shouldDeductionAmount;
@ApiModelProperty(value = "实付金额")
private BigDecimal paidAmount;
@ApiModelProperty(value = "税率")
private BigDecimal taxRate;
@ApiModelProperty(value = "税金")
private BigDecimal taxAmount;
@ApiModelProperty(value = "税价合计")
private BigDecimal totalAmountWithTax;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
@ApiModelProperty(value = "设备名称")
@TableField(exist = false)
private String equipmentName;
@ApiModelProperty(value = "出厂编号")
@TableField(exist = false)
private String factoryNo;
@ApiModelProperty(value = "备案编号")
@TableField(exist = false)
private String filingNo;
@ApiModelProperty(value = "设备编号")
@TableField(exist = false)
private String equipmentNo;
}

3
src/main/java/com/gxwebsoft/tower/mapper/TowerEquipmentMapper.java

@ -2,6 +2,7 @@ package com.gxwebsoft.tower.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.yulichang.base.MPJBaseMapper;
import com.gxwebsoft.tower.entity.TowerEquipment;
import com.gxwebsoft.tower.param.TowerEquipmentParam;
import org.apache.ibatis.annotations.Param;
@ -14,7 +15,7 @@ import java.util.List;
* @author 科技小王子
* @since 2023-05-20 15:06:43
*/
public interface TowerEquipmentMapper extends BaseMapper<TowerEquipment> {
public interface TowerEquipmentMapper extends MPJBaseMapper<TowerEquipment> {
/**
* 分页查询

38
src/main/java/com/gxwebsoft/tower/mapper/TowerLendingMapper.java

@ -0,0 +1,38 @@
package com.gxwebsoft.tower.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.yulichang.base.MPJBaseMapper;
import com.gxwebsoft.tower.entity.TowerLending;
import com.gxwebsoft.tower.param.TowerLendingParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 拆借管理Mapper
*
* @author 科技小王子
* @since 2023-06-15 10:29:54
*/
public interface TowerLendingMapper extends MPJBaseMapper<TowerLending> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<TowerLending>
*/
List<TowerLending> selectPageRel(@Param("page") IPage<TowerLending> page,
@Param("param") TowerLendingParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<TowerLending> selectListRel(@Param("param") TowerLendingParam param);
}

38
src/main/java/com/gxwebsoft/tower/mapper/TowerLendingSettleListMapper.java

@ -0,0 +1,38 @@
package com.gxwebsoft.tower.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.yulichang.base.MPJBaseMapper;
import com.gxwebsoft.tower.entity.TowerLendingSettleList;
import com.gxwebsoft.tower.param.TowerLendingSettleListParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 拆借结算清单Mapper
*
* @author 科技小王子
* @since 2023-06-15 10:29:54
*/
public interface TowerLendingSettleListMapper extends MPJBaseMapper<TowerLendingSettleList> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<TowerLendingSettleList>
*/
List<TowerLendingSettleList> selectPageRel(@Param("page") IPage<TowerLendingSettleList> page,
@Param("param") TowerLendingSettleListParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<TowerLendingSettleList> selectListRel(@Param("param") TowerLendingSettleListParam param);
}

59
src/main/java/com/gxwebsoft/tower/mapper/xml/TowerLendingMapper.xml

@ -0,0 +1,59 @@
<?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.gxwebsoft.tower.mapper.TowerLendingMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM tower_lending a
<where>
<if test="param.lendingId != null">
AND a.lending_id = #{param.lendingId}
</if>
<if test="param.contractId != null">
AND a.contract_id = #{param.contractId}
</if>
<if test="param.propertyCompany != null">
AND a.property_company LIKE CONCAT('%', #{param.propertyCompany}, '%')
</if>
<if test="param.settleDate != null">
AND a.settle_date LIKE CONCAT('%', #{param.settleDate}, '%')
</if>
<if test="param.settleAmount != null">
AND a.settle_amount = #{param.settleAmount}
</if>
<if test="param.fileList != null">
AND a.file_list LIKE CONCAT('%', #{param.fileList}, '%')
</if>
<if test="param.remark != null">
AND a.remark LIKE CONCAT('%', #{param.remark}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.tower.entity.TowerLending">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.tower.entity.TowerLending">
<include refid="selectSql"></include>
</select>
</mapper>

98
src/main/java/com/gxwebsoft/tower/mapper/xml/TowerLendingSettleListMapper.xml

@ -0,0 +1,98 @@
<?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.gxwebsoft.tower.mapper.TowerLendingSettleListMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM tower_lending_settle_list a
<where>
<if test="param.lendingSettleListId != null">
AND a.lending_settle_list_id = #{param.lendingSettleListId}
</if>
<if test="param.lendingId != null">
AND a.lending_id = #{param.lendingId}
</if>
<if test="param.equipmentId != null">
AND a.equipment_id = #{param.equipmentId}
</if>
<if test="param.lendingPath != null">
AND a.lending_path LIKE CONCAT('%', #{param.lendingPath}, '%')
</if>
<if test="param.coopWay != null">
AND a.coop_way LIKE CONCAT('%', #{param.coopWay}, '%')
</if>
<if test="param.startDate != null">
AND a.start_date LIKE CONCAT('%', #{param.startDate}, '%')
</if>
<if test="param.stopDate != null">
AND a.stop_date LIKE CONCAT('%', #{param.stopDate}, '%')
</if>
<if test="param.calDay != null">
AND a.cal_day = #{param.calDay}
</if>
<if test="param.isFullMonth != null">
AND a.is_full_month = #{param.isFullMonth}
</if>
<if test="param.daysInMonth != null">
AND a.days_in_month = #{param.daysInMonth}
</if>
<if test="param.monthRentAmount != null">
AND a.month_rent_amount = #{param.monthRentAmount}
</if>
<if test="param.shouldPayRentAmount != null">
AND a.should_pay_rent_amount = #{param.shouldPayRentAmount}
</if>
<if test="param.dailyRentAmount != null">
AND a.daily_rent_amount = #{param.dailyRentAmount}
</if>
<if test="param.shouldSupplementAmount != null">
AND a.should_supplement_amount = #{param.shouldSupplementAmount}
</if>
<if test="param.shouldDeductionAmount != null">
AND a.should_deduction_amount = #{param.shouldDeductionAmount}
</if>
<if test="param.paidAmount != null">
AND a.paid_amount = #{param.paidAmount}
</if>
<if test="param.taxRate != null">
AND a.tax_rate = #{param.taxRate}
</if>
<if test="param.taxAmount != null">
AND a.tax_amount = #{param.taxAmount}
</if>
<if test="param.totalAmountWithTax != null">
AND a.total_amount_with_tax = #{param.totalAmountWithTax}
</if>
<if test="param.remark != null">
AND a.remark LIKE CONCAT('%', #{param.remark}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.tower.entity.TowerLendingSettleList">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.tower.entity.TowerLendingSettleList">
<include refid="selectSql"></include>
</select>
</mapper>

58
src/main/java/com/gxwebsoft/tower/param/TowerLendingParam.java

@ -0,0 +1,58 @@
package com.gxwebsoft.tower.param;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 拆借管理查询参数
*
* @author 科技小王子
* @since 2023-06-15 10:29:54
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "TowerLendingParam对象", description = "拆借管理查询参数")
public class TowerLendingParam extends BaseParam {
private static final long serialVersionUID = 1L;
@QueryField(type = QueryType.EQ)
private Integer lendingId;
@ApiModelProperty(value = "合同ID")
@QueryField(type = QueryType.EQ)
private Integer contractId;
@ApiModelProperty(value = "产权单位")
private String propertyCompany;
@ApiModelProperty(value = "结算日期")
private String settleDate;
@ApiModelProperty(value = "本期结算金额")
@QueryField(type = QueryType.EQ)
private BigDecimal settleAmount;
@ApiModelProperty(value = "附件")
private String fileList;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "所有人")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
}

109
src/main/java/com/gxwebsoft/tower/param/TowerLendingSettleListParam.java

@ -0,0 +1,109 @@
package com.gxwebsoft.tower.param;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 拆借结算清单查询参数
*
* @author 科技小王子
* @since 2023-06-15 10:29:54
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "TowerLendingSettleListParam对象", description = "拆借结算清单查询参数")
public class TowerLendingSettleListParam extends BaseParam {
private static final long serialVersionUID = 1L;
@QueryField(type = QueryType.EQ)
private Integer lendingSettleListId;
@ApiModelProperty(value = "拆借主单id")
@QueryField(type = QueryType.EQ)
private Integer lendingId;
@ApiModelProperty(value = "设备")
@QueryField(type = QueryType.EQ)
private Integer equipmentId;
@ApiModelProperty(value = "拆借路线")
private String lendingPath;
@ApiModelProperty(value = "合作方式")
private String coopWay;
@ApiModelProperty(value = "结算开始日期")
private String startDate;
@ApiModelProperty(value = "结算截止日期")
private String stopDate;
@ApiModelProperty(value = "计费天数")
@QueryField(type = QueryType.EQ)
private Integer calDay;
@ApiModelProperty(value = "整月")
@QueryField(type = QueryType.EQ)
private Boolean isFullMonth;
@ApiModelProperty(value = "月计费天数")
@QueryField(type = QueryType.EQ)
private Integer daysInMonth;
@ApiModelProperty(value = "月租金")
@QueryField(type = QueryType.EQ)
private BigDecimal monthRentAmount;
@ApiModelProperty(value = "应付租金")
@QueryField(type = QueryType.EQ)
private BigDecimal shouldPayRentAmount;
@ApiModelProperty(value = "日租金")
@QueryField(type = QueryType.EQ)
private BigDecimal dailyRentAmount;
@ApiModelProperty(value = "应补租金")
@QueryField(type = QueryType.EQ)
private BigDecimal shouldSupplementAmount;
@ApiModelProperty(value = "应扣租金")
@QueryField(type = QueryType.EQ)
private BigDecimal shouldDeductionAmount;
@ApiModelProperty(value = "实付金额")
@QueryField(type = QueryType.EQ)
private BigDecimal paidAmount;
@ApiModelProperty(value = "税率")
@QueryField(type = QueryType.EQ)
private BigDecimal taxRate;
@ApiModelProperty(value = "税金")
@QueryField(type = QueryType.EQ)
private BigDecimal taxAmount;
@ApiModelProperty(value = "税价合计")
@QueryField(type = QueryType.EQ)
private BigDecimal totalAmountWithTax;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "用户ID")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
}

42
src/main/java/com/gxwebsoft/tower/service/TowerLendingService.java

@ -0,0 +1,42 @@
package com.gxwebsoft.tower.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.tower.entity.TowerLending;
import com.gxwebsoft.tower.param.TowerLendingParam;
import java.util.List;
/**
* 拆借管理Service
*
* @author 科技小王子
* @since 2023-06-15 10:29:54
*/
public interface TowerLendingService extends IService<TowerLending> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<TowerLending>
*/
PageResult<TowerLending> pageRel(TowerLendingParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<TowerLending>
*/
List<TowerLending> listRel(TowerLendingParam param);
/**
* 根据id查询
*
* @param lendingId
* @return TowerLending
*/
TowerLending getByIdRel(Integer lendingId);
}

42
src/main/java/com/gxwebsoft/tower/service/TowerLendingSettleListService.java

@ -0,0 +1,42 @@
package com.gxwebsoft.tower.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.tower.entity.TowerLendingSettleList;
import com.gxwebsoft.tower.param.TowerLendingSettleListParam;
import java.util.List;
/**
* 拆借结算清单Service
*
* @author 科技小王子
* @since 2023-06-15 10:29:54
*/
public interface TowerLendingSettleListService extends IService<TowerLendingSettleList> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<TowerLendingSettleList>
*/
PageResult<TowerLendingSettleList> pageRel(TowerLendingSettleListParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<TowerLendingSettleList>
*/
List<TowerLendingSettleList> listRel(TowerLendingSettleListParam param);
/**
* 根据id查询
*
* @param lendingSettleListId
* @return TowerLendingSettleList
*/
TowerLendingSettleList getByIdRel(Integer lendingSettleListId);
}

47
src/main/java/com/gxwebsoft/tower/service/impl/TowerLendingServiceImpl.java

@ -0,0 +1,47 @@
package com.gxwebsoft.tower.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.tower.mapper.TowerLendingMapper;
import com.gxwebsoft.tower.service.TowerLendingService;
import com.gxwebsoft.tower.entity.TowerLending;
import com.gxwebsoft.tower.param.TowerLendingParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 拆借管理Service实现
*
* @author 科技小王子
* @since 2023-06-15 10:29:54
*/
@Service
public class TowerLendingServiceImpl extends ServiceImpl<TowerLendingMapper, TowerLending> implements TowerLendingService {
@Override
public PageResult<TowerLending> pageRel(TowerLendingParam param) {
PageParam<TowerLending, TowerLendingParam> page = new PageParam<>(param);
//page.setDefaultOrder("create_time desc");
List<TowerLending> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<TowerLending> listRel(TowerLendingParam param) {
List<TowerLending> list = baseMapper.selectListRel(param);
// 排序
PageParam<TowerLending, TowerLendingParam> page = new PageParam<>();
//page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public TowerLending getByIdRel(Integer lendingId) {
TowerLendingParam param = new TowerLendingParam();
param.setLendingId(lendingId);
return param.getOne(baseMapper.selectListRel(param));
}
}

47
src/main/java/com/gxwebsoft/tower/service/impl/TowerLendingSettleListServiceImpl.java

@ -0,0 +1,47 @@
package com.gxwebsoft.tower.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.tower.mapper.TowerLendingSettleListMapper;
import com.gxwebsoft.tower.service.TowerLendingSettleListService;
import com.gxwebsoft.tower.entity.TowerLendingSettleList;
import com.gxwebsoft.tower.param.TowerLendingSettleListParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 拆借结算清单Service实现
*
* @author 科技小王子
* @since 2023-06-15 10:29:54
*/
@Service
public class TowerLendingSettleListServiceImpl extends ServiceImpl<TowerLendingSettleListMapper, TowerLendingSettleList> implements TowerLendingSettleListService {
@Override
public PageResult<TowerLendingSettleList> pageRel(TowerLendingSettleListParam param) {
PageParam<TowerLendingSettleList, TowerLendingSettleListParam> page = new PageParam<>(param);
//page.setDefaultOrder("create_time desc");
List<TowerLendingSettleList> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<TowerLendingSettleList> listRel(TowerLendingSettleListParam param) {
List<TowerLendingSettleList> list = baseMapper.selectListRel(param);
// 排序
PageParam<TowerLendingSettleList, TowerLendingSettleListParam> page = new PageParam<>();
//page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public TowerLendingSettleList getByIdRel(Integer lendingSettleListId) {
TowerLendingSettleListParam param = new TowerLendingSettleListParam();
param.setLendingSettleListId(lendingSettleListId);
return param.getOne(baseMapper.selectListRel(param));
}
}

3
src/test/java/com/gxwebsoft/generator/TowerGenerator.java

@ -51,7 +51,8 @@ public class TowerGenerator {
// "tower_settle",
// "tower_settle_detail",
// "tower_history_settle",
"tower_rent_record",
"tower_lending",
"tower_lending_settle_list",
};
// 需要去除的表前缀
private static final String[] TABLE_PREFIX = new String[]{

Loading…
Cancel
Save