update 功能安全中心成员-分页列表查询
This commit is contained in:
+1
-2
@@ -50,9 +50,8 @@ public class SafetyCenterSubitemController extends JeroController<SafetyCenterSu
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<SafetyCenterSubitem> queryWrapper = QueryGenerator.initQueryWrapper(safetyCenterSubitem, req.getParameterMap());
|
||||
Page<SafetyCenterSubitem> page = new Page<>(pageNo, pageSize);
|
||||
IPage<SafetyCenterSubitem> pageList = safetyCenterSubitemService.pageList(page, queryWrapper);
|
||||
IPage<SafetyCenterSubitem> pageList = safetyCenterSubitemService.pageList(page, safetyCenterSubitem);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -46,6 +46,12 @@ public class SafetyCenterSubitem {
|
||||
@Excel(name = "成员单位", width = 15, dictTable = "pay_company_management", dicText = "company_name", dicCode = "id")
|
||||
@Dict(dictTable = "pay_company_management", dicText = "company_name", dicCode = "id")
|
||||
private String companyId;
|
||||
/**
|
||||
* 成员单位名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "成员单位名称")
|
||||
private String companyName;
|
||||
|
||||
/**企业联系人id*/
|
||||
@TableField(exist = false)
|
||||
|
||||
+5
@@ -1,11 +1,16 @@
|
||||
package com.jero.functionalsafetycenter.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.functionalsafetycenter.entity.SafetyCenterSubitem;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
* @date 2024-06-12 16:40
|
||||
*/
|
||||
public interface SafetyCenterSubitemMapper extends BaseMapper<SafetyCenterSubitem> {
|
||||
IPage<SafetyCenterSubitem> pageList(Page<SafetyCenterSubitem> page, @Param("safetyCenterSubitem") SafetyCenterSubitem safetyCenterSubitem);
|
||||
}
|
||||
+13
@@ -17,4 +17,17 @@
|
||||
<!--@mbg.generated-->
|
||||
id, project_id, company_id, remarks, create_by, create_time, update_by, update_time
|
||||
</sql>
|
||||
|
||||
<select id="pageList" resultMap="BaseResultMap">
|
||||
select *
|
||||
from pay_functional_safety_center_subitem pfscs
|
||||
left join pay_company_management pcm on pfscs.company_id = pcm.id
|
||||
<where>
|
||||
project_id = #{safetyCenterSubitem.projectId}
|
||||
<if test="safetyCenterSubitem.companyName != null and safetyCenterSubitem.companyName != ''">
|
||||
and pcm.company_name like concat('%',#{safetyCenterSubitem.companyName},'%')
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
+2
-3
@@ -2,7 +2,6 @@ package com.jero.functionalsafetycenter.service;
|
||||
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
@@ -119,8 +118,8 @@ public class SafetyCenterSubitemService extends ServiceImpl<SafetyCenterSubitemM
|
||||
return safetyCenterSubitem;
|
||||
}
|
||||
|
||||
public IPage<SafetyCenterSubitem> pageList(Page<SafetyCenterSubitem> page, QueryWrapper<SafetyCenterSubitem> queryWrapper) {
|
||||
IPage<SafetyCenterSubitem> pageList = this.page(page, queryWrapper);
|
||||
public IPage<SafetyCenterSubitem> pageList(Page<SafetyCenterSubitem> page, SafetyCenterSubitem safetyCenterSubitem) {
|
||||
IPage<SafetyCenterSubitem> pageList = baseMapper.pageList(page, safetyCenterSubitem);
|
||||
List<SafetyCenterSubitem> records = pageList.getRecords();
|
||||
//根据企业id获取所有联系人
|
||||
List<String> companyIdList = records.stream().map(SafetyCenterSubitem::getCompanyId).collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user