APP领料代码提交
This commit is contained in:
parent
152226b4e9
commit
c319fc413a
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.bonus.sgzb.app.controller;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.app.domain.LeaseUserBook;
|
||||||
|
import com.bonus.sgzb.app.service.LeaseUserBookService;
|
||||||
|
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||||
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author c liu
|
||||||
|
* @date 2024/1/4
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/leaseUserBook")
|
||||||
|
public class LeaseUserBookController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private LeaseUserBookService service;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
public AjaxResult getLeaseUserBook(){
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
return AjaxResult.success(service.getLeaseUserBook(userId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody LeaseUserBook bean){
|
||||||
|
return toAjax(service.add(bean));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/update")
|
||||||
|
public AjaxResult update(@RequestBody LeaseUserBook bean){
|
||||||
|
return toAjax(service.update(bean));
|
||||||
|
}
|
||||||
|
@DeleteMapping
|
||||||
|
public AjaxResult batchDel(@RequestBody ArrayList<Integer> ids){
|
||||||
|
return toAjax(service.batchDel(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.sgzb.app.controller;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.bonus.sgzb.app.service.LeaseApplyDetailsService;
|
import com.bonus.sgzb.app.service.LeaseApplyDetailsService;
|
||||||
import com.bonus.sgzb.app.service.LeaseApplyInfoService;
|
import com.bonus.sgzb.app.service.LeaseApplyInfoService;
|
||||||
|
import com.bonus.sgzb.app.service.LeaseUserBookService;
|
||||||
import com.bonus.sgzb.app.service.TmTaskService;
|
import com.bonus.sgzb.app.service.TmTaskService;
|
||||||
import com.bonus.sgzb.base.api.domain.LeaseApplyDetails;
|
import com.bonus.sgzb.base.api.domain.LeaseApplyDetails;
|
||||||
import com.bonus.sgzb.base.api.domain.LeaseApplyInfo;
|
import com.bonus.sgzb.base.api.domain.LeaseApplyInfo;
|
||||||
|
|
@ -14,9 +15,12 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||||
import com.bonus.sgzb.common.log.annotation.Log;
|
import com.bonus.sgzb.common.log.annotation.Log;
|
||||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
@ -41,6 +45,9 @@ public class TmTaskController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private LeaseApplyDetailsService leaseApplyDetailsService; // 领料申请明细表Service
|
private LeaseApplyDetailsService leaseApplyDetailsService; // 领料申请明细表Service
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private LeaseUserBookService leaseUserBookService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领料审核,分公司,分管,机具分公司统一接口
|
* 领料审核,分公司,分管,机具分公司统一接口
|
||||||
|
|
@ -85,6 +92,7 @@ public class TmTaskController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@Log(title = "往来单位提交领料申请", businessType = BusinessType.INSERT)
|
@Log(title = "往来单位提交领料申请", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("submitLeaseApply")
|
@PostMapping("submitLeaseApply")
|
||||||
|
@Transactional
|
||||||
public AjaxResult submitLeaseApply(@RequestBody TmTask task) {
|
public AjaxResult submitLeaseApply(@RequestBody TmTask task) {
|
||||||
if (StringUtils.isNull(task)) {
|
if (StringUtils.isNull(task)) {
|
||||||
return AjaxResult.error("参数错误");
|
return AjaxResult.error("参数错误");
|
||||||
|
|
@ -132,14 +140,17 @@ public class TmTaskController extends BaseController {
|
||||||
if (addLeaseTaskResult) {
|
if (addLeaseTaskResult) {
|
||||||
// 领料任务编号
|
// 领料任务编号
|
||||||
Integer leaseTaskId = leaseApplyInfo.getId();
|
Integer leaseTaskId = leaseApplyInfo.getId();
|
||||||
|
ArrayList<Integer> ids = new ArrayList();
|
||||||
if (StringUtils.isNotNull(leaseTaskId)) {
|
if (StringUtils.isNotNull(leaseTaskId)) {
|
||||||
for (LeaseApplyDetails leaseApplyDetails : leaseApplyDetailsList) {
|
for (LeaseApplyDetails leaseApplyDetails : leaseApplyDetailsList) {
|
||||||
leaseApplyDetails.setParenntId(leaseTaskId); // 设置领料任务ID
|
leaseApplyDetails.setParenntId(leaseTaskId); // 设置领料任务ID
|
||||||
|
ids.add(leaseApplyDetails.getId());
|
||||||
}
|
}
|
||||||
// 插入领料任务明细
|
// 插入领料任务明细
|
||||||
boolean addLeaseTaskDetailsResult = leaseApplyDetailsService.batchInsert(leaseApplyDetailsList) > 0;
|
boolean addLeaseTaskDetailsResult = leaseApplyDetailsService.batchInsert(leaseApplyDetailsList) > 0;
|
||||||
if (addLeaseTaskDetailsResult) {
|
if (addLeaseTaskDetailsResult) {
|
||||||
System.out.println("领料任务创建成功");
|
System.out.println("领料任务创建成功");
|
||||||
|
leaseUserBookService.batchDel(ids);
|
||||||
} else {
|
} else {
|
||||||
System.out.println("领料任务创建成功,但领料任务明细插入失败");
|
System.out.println("领料任务创建成功,但领料任务明细插入失败");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.bonus.sgzb.app.domain;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author c liu
|
||||||
|
* @date 2024/1/4
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value="预约车")
|
||||||
|
public class LeaseUserBook {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 机具规格ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "机具规格ID")
|
||||||
|
private Long typeId;
|
||||||
|
/**
|
||||||
|
* 预约数量
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "预约数量")
|
||||||
|
private int bookNum;
|
||||||
|
private Long companyId;
|
||||||
|
private String parentName;
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
/** 图片路径 */
|
||||||
|
@ApiModelProperty(value = "图片路径")
|
||||||
|
private String photoUrl = "https://zlpt-1259760603.cos.ap-nanjing.myqcloud.com/zhcc/405D4B1F-0942-424e-B45A-C66FDDA74EEA.png";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.bonus.sgzb.app.mapper;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.app.domain.LeaseUserBook;
|
||||||
|
import com.bonus.sgzb.base.api.domain.MaType;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author c liu
|
||||||
|
* @date 2024/1/4
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface LeaseUserBookMapper {
|
||||||
|
List<LeaseUserBook> getLeaseUserBook(Long userId);
|
||||||
|
|
||||||
|
int add(LeaseUserBook bean);
|
||||||
|
|
||||||
|
int batchDel(@Param("ids") ArrayList<Integer> ids);
|
||||||
|
|
||||||
|
int update(LeaseUserBook bean);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.bonus.sgzb.app.service;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.app.domain.LeaseUserBook;
|
||||||
|
import com.bonus.sgzb.base.api.domain.MaType;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface LeaseUserBookService {
|
||||||
|
List<LeaseUserBook> getLeaseUserBook(Long userId);
|
||||||
|
|
||||||
|
int add(LeaseUserBook bean);
|
||||||
|
|
||||||
|
int batchDel(ArrayList<Integer> ids);
|
||||||
|
|
||||||
|
int update(LeaseUserBook bean);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.bonus.sgzb.app.service.impl;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.app.domain.LeaseUserBook;
|
||||||
|
import com.bonus.sgzb.app.mapper.LeaseApplyInfoMapper;
|
||||||
|
import com.bonus.sgzb.app.mapper.LeaseUserBookMapper;
|
||||||
|
import com.bonus.sgzb.app.service.LeaseUserBookService;
|
||||||
|
import com.bonus.sgzb.base.api.domain.MaType;
|
||||||
|
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class LeaseUserBookServiceImpl implements LeaseUserBookService {
|
||||||
|
@Autowired
|
||||||
|
private LeaseUserBookMapper mapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LeaseUserBook> getLeaseUserBook(Long userId) {
|
||||||
|
return mapper.getLeaseUserBook(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int add(LeaseUserBook bean) {
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
bean.setUserId(userId);
|
||||||
|
return mapper.add(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchDel(ArrayList<Integer> ids) {
|
||||||
|
return mapper.batchDel(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(LeaseUserBook bean) {
|
||||||
|
return mapper.update(bean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,7 @@ import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
|
@ -75,6 +76,7 @@ public class TmTaskServiceImpl implements TmTaskService{
|
||||||
* @param record 审核数据及信息
|
* @param record 审核数据及信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public int updateLeaseTaskAuditInfo(TmTask record) {
|
public int updateLeaseTaskAuditInfo(TmTask record) {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
if (StringUtils.isNotNull(record)) {
|
if (StringUtils.isNotNull(record)) {
|
||||||
|
|
@ -84,7 +86,7 @@ public class TmTaskServiceImpl implements TmTaskService{
|
||||||
if (CollUtil.isNotEmpty(record.getLeaseApplyInfoList())) {
|
if (CollUtil.isNotEmpty(record.getLeaseApplyInfoList())) {
|
||||||
for (LeaseApplyInfo leaseApplyInfo : record.getLeaseApplyInfoList()) {
|
for (LeaseApplyInfo leaseApplyInfo : record.getLeaseApplyInfoList()) {
|
||||||
if (leaseApplyInfo != null) {
|
if (leaseApplyInfo != null) {
|
||||||
leaseApplyInfo.setExamineStatusId(record.getExamineStatusId());
|
//leaseApplyInfo.setExamineStatusId(record.getExamineStatusId());
|
||||||
result += tmTaskMapper.updateLeaseApplyInfoAuditInfo(leaseApplyInfo);
|
result += tmTaskMapper.updateLeaseApplyInfoAuditInfo(leaseApplyInfo);
|
||||||
// 再审核领料任务详情表
|
// 再审核领料任务详情表
|
||||||
if (CollUtil.isNotEmpty(leaseApplyInfo.getLeaseApplyDetails())) {
|
if (CollUtil.isNotEmpty(leaseApplyInfo.getLeaseApplyDetails())) {
|
||||||
|
|
|
||||||
|
|
@ -84,18 +84,18 @@ public class MaTypeController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取规格层级的设备列表")
|
@ApiOperation(value = "获取规格层级的设备列表")
|
||||||
@GetMapping("/selectMaTypeListByLevelIndex")
|
@GetMapping("/selectMaTypeListByLevelIndex")
|
||||||
public AjaxResult selectMaTypeListByLevelIndex(@RequestParam(value = "level", required = false) Integer level, @RequestParam(value = "type") Integer type, @RequestParam(value = "parentId", required = false) Integer parentId){
|
public AjaxResult selectMaTypeListByLevelIndex(@RequestParam(value = "level", required = false) Integer level, @RequestParam(value = "type") Integer type, @RequestParam(value = "parentId", required = false) Integer parentId, @RequestParam(value = "keyword", required = false) String keyword){
|
||||||
if (type == null) { return AjaxResult.error("参数错误,类型不能为空"); }
|
if (type == null) { return AjaxResult.error("参数错误,类型不能为空"); }
|
||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
// 查询全部机具类型
|
// 查询全部机具类型
|
||||||
if (level == 0 || level == 1) {
|
if (level == 0 || level == 1) {
|
||||||
// 查询全部等级、一级
|
// 查询全部等级、一级
|
||||||
List<TreeSelect> treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(null));
|
List<TreeSelect> treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(null,null));
|
||||||
return AjaxResult.success(treeSelectList);
|
return AjaxResult.success(treeSelectList);
|
||||||
}
|
}
|
||||||
if (level == 2) {
|
if (level == 2) {
|
||||||
// 查询二级
|
// 查询二级
|
||||||
return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString()));
|
return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString(),keyword));
|
||||||
|
|
||||||
// List<TreeSelect> treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString()));
|
// List<TreeSelect> treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString()));
|
||||||
//
|
//
|
||||||
|
|
@ -118,10 +118,12 @@ public class MaTypeController extends BaseController {
|
||||||
// 查询施工机具
|
// 查询施工机具
|
||||||
List<TreeSelect> treeSelectList;
|
List<TreeSelect> treeSelectList;
|
||||||
if (level != 2) {
|
if (level != 2) {
|
||||||
treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(null));
|
treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(null,null));
|
||||||
return AjaxResult.success(treeSelectList.stream().filter(item -> Objects.equals(item.getId(), 1L)).collect(Collectors.toList()));
|
// treeSelectList.removeIf(item -> item.getId() == 1L);
|
||||||
|
List<TreeSelect> treeSelectList1 = treeSelectList.stream().filter(item -> Objects.equals(item.getId(), 1L)).collect(Collectors.toList());
|
||||||
|
return AjaxResult.success(treeSelectList);
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString()));
|
return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString(),keyword));
|
||||||
// treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString()));
|
// treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString()));
|
||||||
// // 先过滤出施工机具
|
// // 先过滤出施工机具
|
||||||
// treeSelectList = treeSelectList.stream().filter(item -> Objects.equals(item.getId(), 1L)).collect(Collectors.toList());
|
// treeSelectList = treeSelectList.stream().filter(item -> Objects.equals(item.getId(), 1L)).collect(Collectors.toList());
|
||||||
|
|
@ -144,11 +146,11 @@ public class MaTypeController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type == 2) {
|
if (type == 2) {
|
||||||
List<TreeSelect> treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(null));
|
List<TreeSelect> treeSelectList = iTypeService.buildDeptTreeSelect(maTypeMapper.selectMaTypeListByLevelNotFour(null,null));
|
||||||
treeSelectList = treeSelectList.stream().filter(item -> Objects.equals(item.getId(), 2L)).collect(Collectors.toList());
|
//treeSelectList = treeSelectList.stream().filter(item -> Objects.equals(item.getId(), 2L)).collect(Collectors.toList());
|
||||||
// 查询安全工器具
|
// 查询安全工器具
|
||||||
if (level == 2) {
|
if (level == 2) {
|
||||||
return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString()));
|
return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(parentId.toString(),keyword));
|
||||||
// if (!treeSelectList.isEmpty()) {
|
// if (!treeSelectList.isEmpty()) {
|
||||||
// for (TreeSelect treeSelect : treeSelectList) {
|
// for (TreeSelect treeSelect : treeSelectList) {
|
||||||
// List<TreeSelect> children = treeSelect.getChildren();
|
// List<TreeSelect> children = treeSelect.getChildren();
|
||||||
|
|
@ -165,7 +167,7 @@ public class MaTypeController extends BaseController {
|
||||||
}
|
}
|
||||||
return AjaxResult.success(treeSelectList);
|
return AjaxResult.success(treeSelectList);
|
||||||
}
|
}
|
||||||
return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(null));
|
return AjaxResult.success(maTypeMapper.selectMaTypeListByLevelNotFour(null,null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ public interface MaTypeMapper {
|
||||||
|
|
||||||
List<MaType> selectMaTypeTreeByLevel(String id);
|
List<MaType> selectMaTypeTreeByLevel(String id);
|
||||||
|
|
||||||
List<MaType> selectMaTypeListByLevelNotFour(String parentId);
|
List<MaType> selectMaTypeListByLevelNotFour(@Param("parentId") String parentId,@Param("keyword")String keyword);
|
||||||
|
|
||||||
List<MaType> getMaTypeSelect(String parentId);
|
List<MaType> getMaTypeSelect(String parentId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@
|
||||||
|
|
||||||
|
|
||||||
<select id="getDayLeaseNum" resultType="java.lang.Integer">
|
<select id="getDayLeaseNum" resultType="java.lang.Integer">
|
||||||
select COALESCE(SUM(pre_num), 0)
|
select COALESCE(SUM(audit_num), 0)
|
||||||
from lease_apply_details
|
from lease_apply_details
|
||||||
WHERE create_time >= #{startTime} AND create_time <= #{endTime};
|
WHERE create_time >= #{startTime} AND create_time <= #{endTime} AND status in ('1','2')
|
||||||
</select>
|
</select>
|
||||||
<select id="getDayBackNum" resultType="java.lang.Integer">
|
<select id="getDayBackNum" resultType="java.lang.Integer">
|
||||||
select COALESCE(sum(pre_num), 0)
|
select COALESCE(sum(pre_num), 0)
|
||||||
|
|
@ -25,8 +25,8 @@
|
||||||
</select>
|
</select>
|
||||||
<select id="getLeaseNum" resultType="java.lang.Integer">
|
<select id="getLeaseNum" resultType="java.lang.Integer">
|
||||||
select count(1)
|
select count(1)
|
||||||
from lease_apply_details
|
from tm_task
|
||||||
where status = '0'
|
where task_type = '29' and task_status in ('30','31','32') and status = '1'
|
||||||
</select>
|
</select>
|
||||||
<select id="getBackNum" resultType="java.lang.Integer">
|
<select id="getBackNum" resultType="java.lang.Integer">
|
||||||
select count(1)
|
select count(1)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?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.bonus.sgzb.app.mapper.LeaseUserBookMapper">
|
||||||
|
<insert id="add">
|
||||||
|
insert into lease_user_book (user_id,type_id,book_num,book_time,company_id)
|
||||||
|
values (#{userId},#{typeId},#{bookNum},now(),#{companyId});
|
||||||
|
</insert>
|
||||||
|
<update id="update">
|
||||||
|
update lease_user_book
|
||||||
|
set book_num = #{bookNum}
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
<delete id="batchDel">
|
||||||
|
delete
|
||||||
|
from lease_user_book
|
||||||
|
where id in
|
||||||
|
<foreach close=")" collection="ids" item="id" open="(" separator=", ">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getLeaseUserBook" resultType="com.bonus.sgzb.app.domain.LeaseUserBook">
|
||||||
|
select lub.id,
|
||||||
|
lub.user_id as userId,
|
||||||
|
lub.type_id as typeId,
|
||||||
|
mt2.type_name as parentName,
|
||||||
|
mt.type_name as typeName,
|
||||||
|
lub.book_num as bookNum,
|
||||||
|
lub.company_id as companyId
|
||||||
|
from lease_user_book lub
|
||||||
|
left join ma_type mt on lub.type_id = mt.type_id
|
||||||
|
left join ma_type mt2 on mt.parent_id = mt2.type_id
|
||||||
|
where lub.user_id = #{userId}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -600,6 +600,14 @@
|
||||||
direct_audit_time = now(),
|
direct_audit_time = now(),
|
||||||
direct_audit_remark = #{record.companyAuditRemark},
|
direct_audit_remark = #{record.companyAuditRemark},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.examineStatusId == 33 and record.examineStatusId == '33'">
|
||||||
|
update_by = #{record.companyAuditBy},
|
||||||
|
update_time = now(),
|
||||||
|
</if>
|
||||||
|
<if test="record.examineStatusId == 34 and record.examineStatusId == '34'">
|
||||||
|
update_by = #{record.companyAuditBy},
|
||||||
|
update_time = now(),
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
WHERE
|
WHERE
|
||||||
task_id = #{record.taskId}
|
task_id = #{record.taskId}
|
||||||
|
|
|
||||||
|
|
@ -365,9 +365,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
from ma_type m
|
from ma_type m
|
||||||
<where>
|
<where>
|
||||||
m.level != 4
|
m.level != 4
|
||||||
<if test="_parameter!= null and _parameter != ''">
|
<if test="parentId!= null and parentId != ''">
|
||||||
and m.parent_id = #{parentId}
|
and m.parent_id = #{parentId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="keyword!= null and keyword != ''">
|
||||||
|
and locate(#{keyword}, m.type_name) > 0
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue