Commit f53c002c authored by hongguangwu's avatar hongguangwu

MVP1.5.1-收入证明等

parent 5ea4e3af
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 收入证明附件关系表
*
* @author pwang
* @date 2019-11-08 11:23:53
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("m_salary_prova_atta")
@Schema(description = "收入证明附件关系表")
public class MSalaryProvaAtta extends Model<MSalaryProvaAtta> {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键", name = "id")
private String id;
/**
* 收入证明申请id
*/
@NotBlank(message = "收入证明申请id不能为空")
@Length(max = 32, message = "收入证明申请id不能超过32个字符")
private String salaryProvaId;
/**
* 附件id
*/
@NotBlank(message = "附件id不能为空")
@Length(max = 32, message = "附件id不能超过32个字符")
private String attaId;
}
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.MSalaryProvaAtta;
import org.apache.ibatis.annotations.Mapper;
/**
* 收入证明附件关系表
*
* @author pwang
* @date 2019-11-08 11:23:53
*/
@Mapper
public interface MSalaryProvaAttaMapper extends BaseMapper<MSalaryProvaAtta> {
}
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.MSalaryProvaAtta;
/**
* 收入证明附件关系表
*
* @author pwang
* @date 2019-11-08 11:23:53
*/
public interface MSalaryProvaAttaService extends IService<MSalaryProvaAtta> {
}
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.MSalaryProvaAtta;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.MSalaryProvaAttaMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.MSalaryProvaAttaService;
import org.springframework.stereotype.Service;
/**
* 收入证明附件关系表
*
* @author pwang
* @date 2019-11-08 11:23:53
*/
@Service
public class MSalaryProvaAttaServiceImpl extends ServiceImpl<MSalaryProvaAttaMapper, MSalaryProvaAtta> implements MSalaryProvaAttaService {
}
......@@ -4,10 +4,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.MSalaryProvaAtta;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TProveApply;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TProveApplyMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.MSalaryProvaAttaService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TProveApplyService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
......@@ -29,7 +29,7 @@ import java.util.List;
public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProveApply> implements TProveApplyService {
@Autowired
private MSalaryProvaAttaService salaryProvaAttaService;
private TAttaInfoService tAttaInfoService;
/**
* 简单分页查询
......@@ -66,15 +66,15 @@ public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProv
if (Common.isNotNull(attaIdArray)) {
//保存关系
List<MSalaryProvaAtta> mList = new ArrayList<>();
MSalaryProvaAtta m;
List<TAttaInfo> mList = new ArrayList<>();
TAttaInfo m;
for (String id : attaIdArray) {
m = new MSalaryProvaAtta();
m.setAttaId(id);
m.setSalaryProvaId(proveApply.getId());
m = new TAttaInfo();
m.setId(id);
m.setDomainId(proveApply.getId());
mList.add(m);
}
salaryProvaAttaService.saveBatch(mList);
tAttaInfoService.updateBatchById(mList);
}
return R.ok("操作成功!");
}
......
<?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.yifu.cloud.plus.v1.yifu.archives.mapper.MSalaryProvaAttaMapper">
<resultMap id="mSalaryProvaAttaMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.MSalaryProvaAtta">
<id property="id" column="id"/>
<result property="salaryProvaId" column="SALARY_PROVA_ID"/>
<result property="attaId" column="ATTA_ID"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.SALARY_PROVA_ID,
a.ATTA_ID
</sql>
<sql id="mSalaryProvaAtta_where">
<if test="mSalaryProvaAtta != null">
<if test="mSalaryProvaAtta.id != null and mSalaryProvaAtta.id.trim() != ''">
AND a.id = #{mSalaryProvaAtta.id}
</if>
<if test="mSalaryProvaAtta.salaryProvaId != null and mSalaryProvaAtta.salaryProvaId.trim() != ''">
AND a.SALARY_PROVA_ID = #{mSalaryProvaAtta.salaryProvaId}
</if>
<if test="mSalaryProvaAtta.attaId != null and mSalaryProvaAtta.attaId.trim() != ''">
AND a.ATTA_ID = #{mSalaryProvaAtta.attaId}
</if>
</if>
</sql>
</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