Commit 692e7323 authored by 廖旭伟's avatar 廖旭伟

事项材料增加部门ID字段

parent 1e576c92
......@@ -10,7 +10,7 @@ import com.mortals.xhx.module.matter.model.vo.MatterDatumVo;
* 事项申请材料实体对象
*
* @author zxfei
* @date 2022-10-12
* @date 2022-10-13
*/
public class MatterDatumEntity extends MatterDatumVo {
......@@ -21,6 +21,10 @@ public class MatterDatumEntity extends MatterDatumVo {
*/
private Long matterId;
/**
* 部门ID
*/
private Long deptId;
/**
* 材料名
*/
private String materialName;
......@@ -95,6 +99,20 @@ public class MatterDatumEntity extends MatterDatumVo {
this.matterId = matterId;
}
/**
* 获取 部门ID
* @return Long
*/
public Long getDeptId(){
return deptId;
}
/**
* 设置 部门ID
* @param deptId
*/
public void setDeptId(Long deptId){
this.deptId = deptId;
}
/**
* 获取 材料名
* @return String
*/
......@@ -313,6 +331,7 @@ public class MatterDatumEntity extends MatterDatumVo {
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",matterId:").append(getMatterId());
sb.append(",deptId:").append(getDeptId());
sb.append(",materialName:").append(getMaterialName());
sb.append(",materiaFullName:").append(getMateriaFullName());
sb.append(",source:").append(getSource());
......@@ -334,6 +353,8 @@ public class MatterDatumEntity extends MatterDatumVo {
this.matterId = null;
this.deptId = null;
this.materialName = "";
this.materiaFullName = "";
......
......@@ -6,7 +6,7 @@ import com.mortals.xhx.module.matter.model.MatterDatumEntity;
* 事项申请材料查询对象
*
* @author zxfei
* @date 2022-10-12
* @date 2022-10-13
*/
public class MatterDatumQuery extends MatterDatumEntity {
/** 开始 主键,自增长 */
......@@ -33,6 +33,18 @@ public class MatterDatumQuery extends MatterDatumEntity {
/** 事项matter id列表 */
private List <Long> matterIdList;
/** 开始 部门ID */
private Long deptIdStart;
/** 结束 部门ID */
private Long deptIdEnd;
/** 增加 部门ID */
private Long deptIdIncrement;
/** 部门ID列表 */
private List <Long> deptIdList;
/** 材料名 */
private List<String> materialNameList;
......@@ -271,6 +283,70 @@ public class MatterDatumQuery extends MatterDatumEntity {
this.matterIdList = matterIdList;
}
/**
* 获取 开始 部门ID
* @return deptIdStart
*/
public Long getDeptIdStart(){
return this.deptIdStart;
}
/**
* 设置 开始 部门ID
* @param deptIdStart
*/
public void setDeptIdStart(Long deptIdStart){
this.deptIdStart = deptIdStart;
}
/**
* 获取 结束 部门ID
* @return $deptIdEnd
*/
public Long getDeptIdEnd(){
return this.deptIdEnd;
}
/**
* 设置 结束 部门ID
* @param deptIdEnd
*/
public void setDeptIdEnd(Long deptIdEnd){
this.deptIdEnd = deptIdEnd;
}
/**
* 获取 增加 部门ID
* @return deptIdIncrement
*/
public Long getDeptIdIncrement(){
return this.deptIdIncrement;
}
/**
* 设置 增加 部门ID
* @param deptIdIncrement
*/
public void setDeptIdIncrement(Long deptIdIncrement){
this.deptIdIncrement = deptIdIncrement;
}
/**
* 获取 部门ID
* @return deptIdList
*/
public List<Long> getDeptIdList(){
return this.deptIdList;
}
/**
* 设置 部门ID
* @param deptIdList
*/
public void setDeptIdList(List<Long> deptIdList){
this.deptIdList = deptIdList;
}
/**
* 获取 材料名
* @return materialNameList
......@@ -895,6 +971,51 @@ public class MatterDatumQuery extends MatterDatumEntity {
return this;
}
/**
* 设置 部门ID
* @param deptId
*/
public MatterDatumQuery deptId(Long deptId){
setDeptId(deptId);
return this;
}
/**
* 设置 开始 部门ID
* @param deptIdStart
*/
public MatterDatumQuery deptIdStart(Long deptIdStart){
this.deptIdStart = deptIdStart;
return this;
}
/**
* 设置 结束 部门ID
* @param deptIdEnd
*/
public MatterDatumQuery deptIdEnd(Long deptIdEnd){
this.deptIdEnd = deptIdEnd;
return this;
}
/**
* 设置 增加 部门ID
* @param deptIdIncrement
*/
public MatterDatumQuery deptIdIncrement(Long deptIdIncrement){
this.deptIdIncrement = deptIdIncrement;
return this;
}
/**
* 设置 部门ID
* @param deptIdList
*/
public MatterDatumQuery deptIdList(List<Long> deptIdList){
this.deptIdList = deptIdList;
return this;
}
/**
* 设置 材料名
......
......@@ -100,7 +100,7 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
@Override
protected void saveBefore(MatterDatumEntity entity, Context context) throws AppException {
if(StringUtils.isEmpty(entity.getFileUrl())){
throw new AppException("填单附不能为空");
throw new AppException("填单附不能为空");
}
if(StringUtils.isEmpty(entity.getSamplePath())){
throw new AppException("样表地址不能为空");
......
......@@ -7,6 +7,7 @@
<resultMap type="MatterDatumEntity" id="MatterDatumEntity-Map">
<id property="id" column="id" />
<result property="matterId" column="matterId" />
<result property="deptId" column="deptId" />
<result property="materialName" column="materialName" />
<result property="materiaFullName" column="materiaFullName" />
<result property="source" column="source" />
......@@ -37,6 +38,9 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('matterId') or colPickMode == 1 and data.containsKey('matterId')))">
a.matterId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptId') or colPickMode == 1 and data.containsKey('deptId')))">
a.deptId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('materialName') or colPickMode == 1 and data.containsKey('materialName')))">
a.materialName,
</if>
......@@ -93,18 +97,18 @@
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="MatterDatumEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_matter_datum
(matterId,materialName,materiaFullName,source,isRecommend,total,sort,fileName,fileUrl,sampleName,samplePath,templateName,templatePath,preViewPath,formContent,createTime,createUserId,updateTime)
(matterId,deptId,materialName,materiaFullName,source,isRecommend,total,sort,fileName,fileUrl,sampleName,samplePath,templateName,templatePath,preViewPath,formContent,createTime,createUserId,updateTime)
VALUES
(#{matterId},#{materialName},#{materiaFullName},#{source},#{isRecommend},#{total},#{sort},#{fileName},#{fileUrl},#{sampleName},#{samplePath},#{templateName},#{templatePath},#{preViewPath},#{formContent},#{createTime},#{createUserId},#{updateTime})
(#{matterId},#{deptId},#{materialName},#{materiaFullName},#{source},#{isRecommend},#{total},#{sort},#{fileName},#{fileUrl},#{sampleName},#{samplePath},#{templateName},#{templatePath},#{preViewPath},#{formContent},#{createTime},#{createUserId},#{updateTime})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_matter_datum
(matterId,materialName,materiaFullName,source,isRecommend,total,sort,fileName,fileUrl,sampleName,samplePath,templateName,templatePath,preViewPath,formContent,createTime,createUserId,updateTime)
(matterId,deptId,materialName,materiaFullName,source,isRecommend,total,sort,fileName,fileUrl,sampleName,samplePath,templateName,templatePath,preViewPath,formContent,createTime,createUserId,updateTime)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.matterId},#{item.materialName},#{item.materiaFullName},#{item.source},#{item.isRecommend},#{item.total},#{item.sort},#{item.fileName},#{item.fileUrl},#{item.sampleName},#{item.samplePath},#{item.templateName},#{item.templatePath},#{item.preViewPath},#{item.formContent},#{item.createTime},#{item.createUserId},#{item.updateTime})
(#{item.matterId},#{item.deptId},#{item.materialName},#{item.materiaFullName},#{item.source},#{item.isRecommend},#{item.total},#{item.sort},#{item.fileName},#{item.fileUrl},#{item.sampleName},#{item.samplePath},#{item.templateName},#{item.templatePath},#{item.preViewPath},#{item.formContent},#{item.createTime},#{item.createUserId},#{item.updateTime})
</foreach>
</insert>
......@@ -120,6 +124,12 @@
<if test="(colPickMode==0 and data.containsKey('matterIdIncrement')) or (colPickMode==1 and !data.containsKey('matterIdIncrement'))">
a.matterId=ifnull(a.matterId,0) + #{data.matterIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deptId')) or (colPickMode==1 and !data.containsKey('deptId'))">
a.deptId=#{data.deptId},
</if>
<if test="(colPickMode==0 and data.containsKey('deptIdIncrement')) or (colPickMode==1 and !data.containsKey('deptIdIncrement'))">
a.deptId=ifnull(a.deptId,0) + #{data.deptIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('materialName')) or (colPickMode==1 and !data.containsKey('materialName'))">
a.materialName=#{data.materialName},
</if>
......@@ -210,6 +220,18 @@
</choose>
</foreach>
</trim>
<trim prefix="deptId=(case" suffix="ELSE deptId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deptId')) or (colPickMode==1 and !item.containsKey('deptId'))">
when a.id=#{item.id} then #{item.deptId}
</when>
<when test="(colPickMode==0 and item.containsKey('deptIdIncrement')) or (colPickMode==1 and !item.containsKey('deptIdIncrement'))">
when a.id=#{item.id} then ifnull(a.deptId,0) + #{item.deptIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="materialName=(case" suffix="ELSE materialName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('materialName')) or (colPickMode==1 and !item.containsKey('materialName'))">
......@@ -497,6 +519,27 @@
${_conditionType_} a.matterId <![CDATA[ <= ]]> #{${_conditionParam_}.matterIdEnd}
</if>
<if test="conditionParamRef.containsKey('deptId')">
<if test="conditionParamRef.deptId != null ">
${_conditionType_} a.deptId = #{${_conditionParam_}.deptId}
</if>
<if test="conditionParamRef.deptId == null">
${_conditionType_} a.deptId is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptIdList')">
${_conditionType_} a.deptId in
<foreach collection="conditionParamRef.deptIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdStart') and conditionParamRef.deptIdStart != null">
${_conditionType_} a.deptId <![CDATA[ >= ]]> #{${_conditionParam_}.deptIdStart}
</if>
<if test="conditionParamRef.containsKey('deptIdEnd') and conditionParamRef.deptIdEnd != null">
${_conditionType_} a.deptId <![CDATA[ <= ]]> #{${_conditionParam_}.deptIdEnd}
</if>
<if test="conditionParamRef.containsKey('materialName')">
<if test="conditionParamRef.materialName != null and conditionParamRef.materialName != ''">
......@@ -805,6 +848,11 @@
<if test='orderCol.matterId != null and "DESC".equalsIgnoreCase(orderCol.matterId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptId')">
a.deptId
<if test='orderCol.deptId != null and "DESC".equalsIgnoreCase(orderCol.deptId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('materialName')">
a.materialName
<if test='orderCol.materialName != null and "DESC".equalsIgnoreCase(orderCol.materialName)'>DESC</if>
......
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