Commit 9b423b0f by huluobin

bug fix

parent ad98a2b6
...@@ -11,15 +11,14 @@ public class CostPlanTempDto { ...@@ -11,15 +11,14 @@ public class CostPlanTempDto {
private Integer id; // 费用单表 id private Integer id; // 费用单表 id
private String costPlanNo; // 费用计划编号 private String costPlanNo; // 费用计划编号
private String tempNo; // 计划缓存编号 private String tempNo; // 计划缓存编号
private String kindNo; // 小类编号
private String filePath; // 文件地址 private String filePath; // 文件地址
private String fileName; // 文件名 private String fileName; // 文件名
private BigDecimal amount; // 费用总金额 private BigDecimal amount; // 费用总金额
private String costReason; // 付款理由 private String costReason; // 付款理由
private String typeNo; // 大类编号
private String typeNo; // 大类编号
private String typeNameDto; // 大类标题 private String typeNameDto; // 大类标题
private String kindNameDto; // 小类标题
private String dic; // 币种 private String dic; // 币种
@ApiModelProperty("会计一级科目") @ApiModelProperty("会计一级科目")
...@@ -29,5 +28,11 @@ public class CostPlanTempDto { ...@@ -29,5 +28,11 @@ public class CostPlanTempDto {
private String lendType; private String lendType;
@ApiModelProperty("项目")
private String projectType;
@ApiModelProperty("客户编号")
private String customerNum;
} }
package com.blt.other.common.interceptor; package com.blt.other.common.interceptor;
import com.bailuntec.common.SpringContextUtil;
import com.blt.other.common.base.SysUser; import com.blt.other.common.base.SysUser;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.common.util.JwtUtil; import com.blt.other.common.util.JwtUtil;
...@@ -7,6 +8,7 @@ import com.blt.other.common.util.SessionUtils; ...@@ -7,6 +8,7 @@ import com.blt.other.common.util.SessionUtils;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
...@@ -18,17 +20,31 @@ import javax.servlet.http.HttpServletResponse; ...@@ -18,17 +20,31 @@ import javax.servlet.http.HttpServletResponse;
@Slf4j @Slf4j
public class SessionHandlerInterceptor implements HandlerInterceptor { public class SessionHandlerInterceptor implements HandlerInterceptor {
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
String token = Lists.newArrayList(request.getHeader("Cookie").split(";")) try {
.stream() String token = Lists.newArrayList(request.getHeader("Cookie").split(";"))
.filter(item -> item.contains("BailunToken")) .stream()
.findAny() .filter(item -> item.contains("BailunToken"))
.map(item -> item.replaceAll("BailunToken=", "")) .findAny()
.orElseThrow(() -> new BizRuntimeException("400", "请先登陆")); .map(item -> item.replaceAll("BailunToken=", ""))
.orElseThrow(() -> new BizRuntimeException("400", "请先登陆"));
SysUser sysUser = JwtUtil.validateToken(token);
SessionUtils.putSysUser(sysUser); SysUser sysUser = JwtUtil.validateToken(token);
SessionUtils.putSysUser(sysUser);
} catch (Exception ex) {
String activeProfile = SpringContextUtil.getString("spring.profiles.active");
if (activeProfile.equals("test")) {
SysUser sysUser = new SysUser();
sysUser.setOaUserId(0);
sysUser.setUserName("sys");
SessionUtils.putSysUser(sysUser);
return true;
}
throw ex;
}
return true; return true;
} }
......
...@@ -2,21 +2,28 @@ package com.blt.other.database.model; ...@@ -2,21 +2,28 @@ package com.blt.other.database.model;
import com.bailuntec.common.SpringContextUtil; import com.bailuntec.common.SpringContextUtil;
import com.bailuntec.cost.api.dto.CostPlanTempDto; import com.bailuntec.cost.api.dto.CostPlanTempDto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.blt.other.common.util.PathUtil; import com.blt.other.common.util.PathUtil;
import com.blt.other.module.cost.dao.CostTypeKindDao; import com.blt.other.module.cost.dao.CostTypeDao;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
@TableName("cost_plan_temp")
@Data @Data
public class CostPlanTempDomain { public class CostPlanTempDomain {
// 费用单表 id // 费用单表 id
@TableId(type = IdType.AUTO)
private Integer id; private Integer id;
private String costPlanNo; // 费用计划编号 private String costPlanNo; // 费用计划编号
private String tempNo; // 计划缓存编号 private String tempNo; // 计划缓存编号
private String kindNo; // 种类编号
private String filePath; // 文件地址 private String filePath; // 文件地址
private BigDecimal amount; // 费用总金额 private BigDecimal amount; // 费用总金额
private String costReason; // 付款理由 private String costReason; // 付款理由
...@@ -30,17 +37,21 @@ public class CostPlanTempDomain { ...@@ -30,17 +37,21 @@ public class CostPlanTempDomain {
private String lendType; private String lendType;
@ApiModelProperty("项目")
private String projectType;
@ApiModelProperty("客户编号")
private String customerNum;
public CostPlanTempDto castToDto() { public CostPlanTempDto castToDto() {
CostTypeKindDao costTypeKindDao = SpringContextUtil.getBean(CostTypeKindDao.class);
CostTypeDao costTypeDao = SpringContextUtil.getBean(CostTypeDao.class);
CostPlanTempDto dto = new CostPlanTempDto(); CostPlanTempDto dto = new CostPlanTempDto();
BeanUtils.copyProperties(this, dto); BeanUtils.copyProperties(this, dto);
CostTypeKindDomain costTypeKindDomain = costTypeKindDao.selectByKindNo(this.getKindNo()); dto.setTypeNameDto(costTypeDao.selectByNo(typeNo).getTypeName());
if (null != costTypeKindDomain) {
dto.setTypeNameDto(costTypeKindDomain.getTypeName());
dto.setKindNameDto(costTypeKindDomain.getKindName());
}
dto.setFileName(PathUtil.getFileName(dto.getFilePath())); dto.setFileName(PathUtil.getFileName(dto.getFilePath()));
return dto; return dto;
......
package com.blt.other.module.cost.dao; package com.blt.other.module.cost.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.blt.other.database.model.CostPlanTempDomain; import com.blt.other.database.model.CostPlanTempDomain;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -9,20 +10,17 @@ import java.util.List; ...@@ -9,20 +10,17 @@ import java.util.List;
@Mapper @Mapper
@Repository @Repository
public interface CostPlanTempDao { public interface CostPlanTempDao extends BaseMapper<CostPlanTempDomain> {
CostPlanTempDomain selectByNo(String tempNo); CostPlanTempDomain selectByNo(String tempNo);
Integer insert(CostPlanTempDomain costPlanTempDomain);
CostPlanTempDomain selectByPlanNoAndKindNo(@Param("costPlanNo") String costPlanNo, @Param("kindNo") String kindNo); CostPlanTempDomain selectByPlanNoAndKindNo(@Param("costPlanNo") String costPlanNo, @Param("kindNo") String kindNo);
//获取费用计划子项
List<CostPlanTempDomain> selectListByPlanNo(String costPlanNo); List<CostPlanTempDomain> selectListByPlanNo(String costPlanNo);
Integer deletedByPlanNoAndTempNo(@Param("costPlanNo") String costPlanNo, @Param("tempNo") String tempNo); Integer deletedByPlanNoAndTempNo(@Param("costPlanNo") String costPlanNo, @Param("tempNo") String tempNo);
Integer update(CostPlanTempDomain domain);
void deletedFilePath(String tempNo); void deletedFilePath(String tempNo);
List<CostPlanTempDomain> selectByPlanNoAndTypeNo(@Param("costPlanNo") String costPlanNo, @Param("typeNo") String typeNo); List<CostPlanTempDomain> selectByPlanNoAndTypeNo(@Param("costPlanNo") String costPlanNo, @Param("typeNo") String typeNo);
......
...@@ -61,6 +61,12 @@ public class CostDetailDomain { ...@@ -61,6 +61,12 @@ public class CostDetailDomain {
private String lendType; private String lendType;
@ApiModelProperty("项目")
private String projectType;
@ApiModelProperty("客户编号")
private String customerNum;
} }
...@@ -51,7 +51,6 @@ public interface CostPlanTempService { ...@@ -51,7 +51,6 @@ public interface CostPlanTempService {
* @param tempNo 用计划单项编号 * @param tempNo 用计划单项编号
* @return 费用计划单项 * @return 费用计划单项
*/ */
@NonNull
CostPlanTempDomain getByTempNo(@NonNull String tempNo); CostPlanTempDomain getByTempNo(@NonNull String tempNo);
/** /**
......
...@@ -10,7 +10,7 @@ import com.blt.other.module.auth.model.OaUser; ...@@ -10,7 +10,7 @@ import com.blt.other.module.auth.model.OaUser;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.model.CostTemplate; import com.blt.other.module.cost.model.CostTemplate;
import com.blt.other.module.sys.model.CostReviewer; import com.blt.other.module.sys.model.CostReviewer;
import org.springframework.beans.factory.annotation.Autowired; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -27,10 +27,11 @@ import java.util.stream.Collectors; ...@@ -27,10 +27,11 @@ import java.util.stream.Collectors;
* @author robbendev * @author robbendev
* @since 2020/10/30 2:57 下午 * @since 2020/10/30 2:57 下午
*/ */
@Slf4j
@Component @Component
public class DepartmentCheckState extends CostState { public class DepartmentCheckState extends CostState {
@Autowired @Resource
HrCheckState hrCheckState; HrCheckState hrCheckState;
@Resource @Resource
OaDepartmentMapper oaDepartmentMapper; OaDepartmentMapper oaDepartmentMapper;
...@@ -110,12 +111,10 @@ public class DepartmentCheckState extends CostState { ...@@ -110,12 +111,10 @@ public class DepartmentCheckState extends CostState {
@Override @Override
public void refuse(String rejectReason) { public void refuse(String rejectReason) {
log.info("部门审核拒绝 currentUserId:{},costNo:{}", costContext.currentUserId, costContext.costDomain.getCostNo());
CostDomain costDomain = costContext.costDomain; CostDomain costDomain = costContext.costDomain;
Integer currentUserId = costContext.currentUserId; Integer currentUserId = costContext.currentUserId;
OaUser costUser = oaUserMapper.selectByOaUserId(costDomain.getCreateUserid());
//check status //check status
if (!costDomain.getCostStatus().equals(CostDomain.STATUS_DEPARTMENT_CHECK)) { if (!costDomain.getCostStatus().equals(CostDomain.STATUS_DEPARTMENT_CHECK)) {
throw new BizRuntimeException("invalid status"); throw new BizRuntimeException("invalid status");
...@@ -126,10 +125,7 @@ public class DepartmentCheckState extends CostState { ...@@ -126,10 +125,7 @@ public class DepartmentCheckState extends CostState {
throw new BizRuntimeException("current user no authority"); throw new BizRuntimeException("current user no authority");
} }
costLogService.save(costDomain.getCostNo(), currentUserId, "部门审核拒绝,理由:" + rejectReason, CostLogDomain.TYPE_UPDATE); costLogService.save(costDomain.getCostNo(), currentUserId, "部门审核拒绝,理由:" + rejectReason, CostLogDomain.TYPE_UPDATE);
//sd
costContext.costService.reject(costDomain.getCostNo()); costContext.costService.reject(costDomain.getCostNo());
} }
...@@ -144,7 +140,10 @@ public class DepartmentCheckState extends CostState { ...@@ -144,7 +140,10 @@ public class DepartmentCheckState extends CostState {
.eq(CostReviewer::getReferId, costUser.getPrimaryDepartmentId()) .eq(CostReviewer::getReferId, costUser.getPrimaryDepartmentId())
.eq(CostReviewer::getType, CostReviewer.departmentReviewer)); .eq(CostReviewer::getType, CostReviewer.departmentReviewer));
String departmentReviewerNames = costReviewerList.stream().map(CostReviewer::getReviewerUserName).collect(Collectors.joining(","));
log.info("更新当前审核人为部门审核人:{}", departmentReviewerNames);
costCurrentReviewerService.updateByCostNoAndReviewer(costDomain.getCostNo(), costReviewerList); costCurrentReviewerService.updateByCostNoAndReviewer(costDomain.getCostNo(), costReviewerList);
costLogService.save(costDomain.getCostNo(), costContext.currentUserId, "部门审核人:" + costReviewerList.stream().map(CostReviewer::getReviewerUserName).collect(Collectors.joining(","))); costLogService.save(costDomain.getCostNo(), costContext.currentUserId, "部门审核人:" + departmentReviewerNames);
} }
} }
...@@ -201,9 +201,9 @@ public abstract class AbstractCostPlanService implements CostPlanService { ...@@ -201,9 +201,9 @@ public abstract class AbstractCostPlanService implements CostPlanService {
BeanUtils.copyProperties(costPlanTempDomain, costDetailDomain); BeanUtils.copyProperties(costPlanTempDomain, costDetailDomain);
costDetailDomain.setDetailNo(costPlanDomain.getCostPlanNo() + "-" + index); costDetailDomain.setDetailNo(costPlanDomain.getCostPlanNo() + "-" + index);
CostTypeKindDomain costTypeKindDomain = costTypeKindDao.selectByKindNo(costPlanTempDomain.getKindNo()); CostTypeDomain costTypeDomain = costTypeDao.selectByNo(costPlanTempDomain.getTypeNo());
costDetailDomain.setTypeNo(costTypeKindDomain.getTypeNo()); costDetailDomain.setTypeNo(costTypeDomain.getTypeNo());
costDetailDomain.setTypeName(costTypeKindDomain.getTypeName()); costDetailDomain.setTypeName(costTypeDomain.getTypeName());
return costDetailDomain; return costDetailDomain;
} }
......
...@@ -71,7 +71,7 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement ...@@ -71,7 +71,7 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
List<CostPlanTempDomain> costPlanTempDomains = costPlanTempDao.selectListByPlanNo(costPlanNo); List<CostPlanTempDomain> costPlanTempDomains = costPlanTempDao.selectListByPlanNo(costPlanNo);
if (costPlanTempDomains.stream().anyMatch(temp -> null == temp.getTypeNo() || null == temp.getKindNo())) { if (costPlanTempDomains.stream().anyMatch(temp -> null == temp.getTypeNo())) {
throw new RuntimeException("存在有金额、但是没有选择类型的子项目"); throw new RuntimeException("存在有金额、但是没有选择类型的子项目");
} }
......
...@@ -7,7 +7,6 @@ import com.blt.other.common.util.PathUtil; ...@@ -7,7 +7,6 @@ import com.blt.other.common.util.PathUtil;
import com.blt.other.database.model.CostPlanDomain; import com.blt.other.database.model.CostPlanDomain;
import com.blt.other.database.model.CostPlanTempDomain; import com.blt.other.database.model.CostPlanTempDomain;
import com.blt.other.database.model.CostTypeDomain; import com.blt.other.database.model.CostTypeDomain;
import com.blt.other.database.model.CostTypeKindDomain;
import com.blt.other.module.cost.dao.AccountingSubjectMapper; import com.blt.other.module.cost.dao.AccountingSubjectMapper;
import com.blt.other.module.cost.dao.CostPlanDao; import com.blt.other.module.cost.dao.CostPlanDao;
import com.blt.other.module.cost.dao.CostPlanTempDao; import com.blt.other.module.cost.dao.CostPlanTempDao;
...@@ -169,8 +168,8 @@ public class CostPlanTempServiceImpl implements CostPlanTempService { ...@@ -169,8 +168,8 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
public CostPlanTempDomain resetItem(ResetItemReq req) { public CostPlanTempDomain resetItem(ResetItemReq req) {
CostPlanTempDomain costPlanTempDomain = new CostPlanTempDomain(); CostPlanTempDomain costPlanTempDomain = costPlanTempDao.selectByNo(req.getTempNo());
com.bailuntec.common.BeanUtils.copyProperties(req, costPlanTempDomain); com.bailuntec.common.BeanUtils.copyProperties(req, costPlanTempDomain, "id");
CostTypeDomain costTypeDomain = costTypeDao.selectByNo(req.getTypeNo()); CostTypeDomain costTypeDomain = costTypeDao.selectByNo(req.getTypeNo());
AccountingSubject accountingSubject = accountingSubjectMapper.selectByNo(costTypeDomain.getAccountingSubjectNo()); AccountingSubject accountingSubject = accountingSubjectMapper.selectByNo(costTypeDomain.getAccountingSubjectNo());
...@@ -182,7 +181,7 @@ public class CostPlanTempServiceImpl implements CostPlanTempService { ...@@ -182,7 +181,7 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
if (req.getDelecteFile()) { if (req.getDelecteFile()) {
costPlanTempDao.deletedFilePath(req.getTempNo()); costPlanTempDao.deletedFilePath(req.getTempNo());
} }
costPlanTempDao.update(costPlanTempDomain); costPlanTempDao.updateById(costPlanTempDomain);
this.chalkResetDec(costPlanTempDomain.getCostPlanNo()); this.chalkResetDec(costPlanTempDomain.getCostPlanNo());
......
...@@ -2,9 +2,9 @@ spring: ...@@ -2,9 +2,9 @@ spring:
# 数据源配置 # 数据源配置
datasource: datasource:
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/bailun_other?useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true url: jdbc:mysql://cdb-aanqm573.gz.tencentcdb.com:10120/bailun_other?useUnicode=true&characterEncoding=utf-8&useSSL=false&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true
username: root username: root
password: '123456' password: 'Aarob2020#'
thymeleaf: thymeleaf:
prefix: classpath:/templates/ prefix: classpath:/templates/
...@@ -36,16 +36,12 @@ logging: ...@@ -36,16 +36,12 @@ logging:
#jb #jb
cost: cost:
url: url:
purchaseApplyCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/purchasing/list/detail/ApplyCallbackUrl purchaseApplyCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/purchasing/list/detail/ApplyCallbackUrl
purchaseCashierCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/purchasing/list/detail/CashierCallbackUrl purchaseCashierCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/purchasing/list/detail/CashierCallbackUrl
costApplyCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/cost/check/ApplyCallbackUrl costApplyCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/cost/check/ApplyCallbackUrl
costCashierCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/cost/check/CashierCallbackUrl costCashierCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/cost/check/CashierCallbackUrl
lendCostApplyCallBackUrlPost: http://api.fee.bailuntec.com/purchase/other/cost/check/lend/ApplyCallbackUrl
lendCostCashierCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/cost/check/lend/CashierCallbackUrl
getBuyDetailApi: http://api.fee.bailuntec.com/purchase/other/purchasing/buy/detail getBuyDetailApi: http://api.fee.bailuntec.com/purchase/other/purchasing/buy/detail
getCostDetailApi: http://api.fee.bailuntec.com/purchase/other/cost/finansys/detail getCostDetailApi: http://api.fee.bailuntec.com/purchase/other/cost/finansys/detail
buyUserApi: http://oa.bailuntec.com/Api/User/GetUser buyUserApi: http://oa.bailuntec.com/Api/User/GetUser
logingUserApi: http://oa.bailuntec.com/Login/GetUserByBLUserAcct logingUserApi: http://oa.bailuntec.com/Login/GetUserByBLUserAcct
GetDeparmentListApi: http://oa.bailuntec.com/api/User/GetDeparmentList GetDeparmentListApi: http://oa.bailuntec.com/api/User/GetDeparmentList
......
...@@ -42,16 +42,12 @@ logging: ...@@ -42,16 +42,12 @@ logging:
#jb #jb
cost: cost:
url: url:
purchaseApplyCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/purchasing/list/detail/ApplyCallbackUrl purchaseApplyCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/purchasing/list/detail/ApplyCallbackUrl
purchaseCashierCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/purchasing/list/detail/CashierCallbackUrl purchaseCashierCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/purchasing/list/detail/CashierCallbackUrl
costApplyCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/cost/check/ApplyCallbackUrl costApplyCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/cost/check/ApplyCallbackUrl
costCashierCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/cost/check/CashierCallbackUrl costCashierCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/cost/check/CashierCallbackUrl
lendCostApplyCallBackUrlPost: http://api.fee.bailuntec.com/purchase/other/cost/check/lend/ApplyCallbackUrl
lendCostCashierCallbackUrlPost: http://api.fee.bailuntec.com/purchase/other/cost/check/lend/CashierCallbackUrl
getBuyDetailApi: http://api.fee.bailuntec.com/purchase/other/purchasing/buy/detail getBuyDetailApi: http://api.fee.bailuntec.com/purchase/other/purchasing/buy/detail
getCostDetailApi: http://api.fee.bailuntec.com/purchase/other/cost/finansys/detail getCostDetailApi: http://api.fee.bailuntec.com/purchase/other/cost/finansys/detail
buyUserApi: http://oa.bailuntec.com/Api/User/GetUser buyUserApi: http://oa.bailuntec.com/Api/User/GetUser
logingUserApi: http://oa.bailuntec.com/Login/GetUserByBLUserAcct logingUserApi: http://oa.bailuntec.com/Login/GetUserByBLUserAcct
GetDeparmentListApi: http://oa.bailuntec.com/api/User/GetDeparmentList GetDeparmentListApi: http://oa.bailuntec.com/api/User/GetDeparmentList
......
...@@ -3,104 +3,52 @@ ...@@ -3,104 +3,52 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" > "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.blt.other.module.cost.dao.CostPlanTempDao"> <mapper namespace="com.blt.other.module.cost.dao.CostPlanTempDao">
<select id="selectByNo" resultType="com.blt.other.database.model.CostPlanTempDomain"> <select id="selectByNo" resultType="com.blt.other.database.model.CostPlanTempDomain">
SELECT SELECT *
* FROM cost_plan_temp
FROM WHERE temp_no = #{tempNo}
cost_plan_temp
WHERE
temp_no = #{tempNo}
</select> </select>
<insert id="insert" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
INSERT INTO
cost_plan_temp(
cost_plan_no,temp_no,kind_no,file_path,amount,cost_reason,dic,type_no
)
VALUE
(
#{costPlanNo},#{tempNo},#{kindNo},#{filePath},#{amount},#{costReason},#{dic},#{typeNo}
)
</insert>
<select id="selectByPlanNoAndKindNo" resultType="com.blt.other.database.model.CostPlanTempDomain"> <select id="selectByPlanNoAndKindNo" resultType="com.blt.other.database.model.CostPlanTempDomain">
SELECT SELECT *
* FROM cost_plan_temp
FROM WHERE cost_plan_no = #{costPlanNo}
cost_plan_temp AND kind_no = #{kindNo}
WHERE
cost_plan_no = #{costPlanNo}
AND
kind_no = #{kindNo}
</select> </select>
<select id="selectListByPlanNo" resultType="com.blt.other.database.model.CostPlanTempDomain"> <select id="selectListByPlanNo" resultType="com.blt.other.database.model.CostPlanTempDomain">
SELECT SELECT *
* FROM cost_plan_temp
FROM WHERE cost_plan_no = #{costPlanNo}
cost_plan_temp ORDER BY id DESC
WHERE
cost_plan_no = #{costPlanNo}
ORDER BY
id DESC
</select> </select>
<!--parameterType="StudentEntity"--> <!--parameterType="StudentEntity"-->
<delete id="deletedByPlanNoAndTempNo"> <delete id="deletedByPlanNoAndTempNo">
DELETE FROM DELETE
cost_plan_temp FROM cost_plan_temp
WHERE WHERE cost_plan_no = #{costPlanNo}
cost_plan_no = #{costPlanNo} AND temp_no = #{tempNo}
AND
temp_no = #{tempNo}
</delete> </delete>
<update id="update" parameterType="com.blt.other.database.model.CostPlanTempDomain">
UPDATE
cost_plan_temp
<set>
<if test=" costPlanNo!=null">cost_plan_no=#{costPlanNo},</if>
<if test=" kindNo!=null">kind_no=#{kindNo},</if>
<if test=" filePath!=null">file_path=#{filePath},</if>
<if test=" amount!=null">amount=#{amount},</if>
<if test=" dic!=null">dic=#{dic},</if>
<if test=" typeNo!=null">type_no=#{typeNo},</if>
<if test=" costReason!=null">cost_reason=#{costReason}</if>
</set>
WHERE
temp_no = #{tempNo}
</update>
<update id="deletedFilePath" parameterType="com.blt.other.database.model.CostPlanTempDomain"> <update id="deletedFilePath" parameterType="com.blt.other.database.model.CostPlanTempDomain">
UPDATE UPDATE
cost_plan_temp cost_plan_temp
SET SET file_path = NULL
file_path = NULL WHERE temp_no = #{tempNo}
WHERE
temp_no = #{tempNo}
</update> </update>
<select id="selectByPlanNoAndTypeNo" resultType="com.blt.other.database.model.CostPlanTempDomain"> <select id="selectByPlanNoAndTypeNo" resultType="com.blt.other.database.model.CostPlanTempDomain">
SELECT SELECT *
* FROM cost_plan_temp
FROM WHERE cost_plan_no = #{costPlanNo}
cost_plan_temp AND type_no = #{typeNo}
WHERE ORDER BY id DESC
cost_plan_no = #{costPlanNo}
AND
type_no = #{typeNo}
ORDER BY
id DESC
</select> </select>
<select id="selectByPlanNoAndTempNo" resultType="com.blt.other.database.model.CostPlanTempDomain"> <select id="selectByPlanNoAndTempNo" resultType="com.blt.other.database.model.CostPlanTempDomain">
SELECT SELECT *
* FROM cost_plan_temp
FROM WHERE cost_plan_no = #{costPlanNo}
cost_plan_temp AND temp_no = #{tempNo}
WHERE ORDER BY id DESC
cost_plan_no = #{costPlanNo}
AND
temp_no = #{tempNo}
ORDER BY
id DESC
</select> </select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment