Commit ac9231e1 authored by zhangyingbin's avatar zhangyingbin

新增 焊工履历列表查询接口

parent 287adeaf
......@@ -51,4 +51,8 @@ public class WorkHistoryDto extends BaseDto {
@ApiModelProperty(value = "备注")
private String remark;
/**
* 焊工姓名
*/
private String name;
}
package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.WorkHistoryDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.WorkHistory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.Map;
/**
* 焊工工作履历表 Mapper 接口
*
......@@ -11,4 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface WorkHistoryMapper extends BaseMapper<WorkHistory> {
IPage<WorkHistoryDto> pageList(Page<WorkHistoryDto> page, WorkHistoryDto tzUgpWorkHistory);
}
......@@ -2,4 +2,27 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.WorkHistoryMapper">
<select id="pageList" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WorkHistoryDto">
SELECT wh.*,ou.biz_org_name AS name FROM `tz_ugp_work_history` AS wh LEFT JOIN cb_org_usr AS ou ON ou.sequence_nbr = wh.welder_id
<where>
<if test="tzUgpWorkHistory.companyName!='' and tzUgpWorkHistory.companyName!=null">
and wh.company_name like concat("%",#{tzUgpWorkHistory.companyName},"%")
</if>
<if test="tzUgpWorkHistory.name!='' and tzUgpWorkHistory.name!=null">
and ou.biz_org_name like concat("%",#{tzUgpWorkHistory.name},"%")
</if>
<if test="tzUgpWorkHistory.projectName!='' and tzUgpWorkHistory.projectName!=null">
and wh.project_name like concat("%",#{tzUgpWorkHistory.projectName},"%")
</if>
<if test="tzUgpWorkHistory.weldNumber!='' and tzUgpWorkHistory.weldNumber!=null">
and wh.weld_number like concat("%",#{tzUgpWorkHistory.weldNumber},"%")
</if>
<if test="tzUgpWorkHistory.startDate!='' and tzUgpWorkHistory.startDate!=null">
and wh.start_date like concat("%",#{tzUgpWorkHistory.startDate},"%")
</if>
<if test="tzUgpWorkHistory.endDate!='' and tzUgpWorkHistory.endDate!=null">
and wh.end_date like concat("%",#{tzUgpWorkHistory.endDate},"%")
</if>
</where>
</select>
</mapper>
......@@ -12,7 +12,10 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.WorkHistoryServiceImpl;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -148,4 +151,18 @@ public class WorkHistoryController extends BaseController {
public ResponseModel<List<WorkHistoryDto>> selectForList() {
return ResponseHelper.buildResponse(workHistoryServiceImpl.queryForWorkHistoryList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
@GetMapping(value = "/pageList")
public ResponseModel<IPage<WorkHistoryDto>> pageList(String pageNum, String pageSize, WorkHistoryDto tzUgpWorkHistory){
if(ValidationUtil.isEmpty(pageNum)){
pageNum = "1";
}
if(ValidationUtil.isEmpty(pageSize)){
pageNum = "15";
}
Page<WorkHistoryDto> page = new Page(Integer.parseInt(pageNum),Integer.parseInt(pageSize));
return ResponseHelper.buildResponse(workHistoryServiceImpl.pageList(page, tzUgpWorkHistory));
}
}
package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.ugp.api.entity.WorkHistory;
import com.yeejoin.amos.boot.module.ugp.api.mapper.WorkHistoryMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IWorkHistoryService;
import com.yeejoin.amos.boot.module.ugp.api.dto.WorkHistoryDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import java.util.Map;
/**
* 焊工工作履历表服务实现类
......@@ -17,6 +20,9 @@ import java.util.List;
*/
@Service
public class WorkHistoryServiceImpl extends BaseService<WorkHistoryDto,WorkHistory,WorkHistoryMapper> implements IWorkHistoryService {
@Autowired
WorkHistoryMapper workHistoryMapper;
/**
* 分页查询
*/
......@@ -30,4 +36,8 @@ public class WorkHistoryServiceImpl extends BaseService<WorkHistoryDto,WorkHisto
public List<WorkHistoryDto> queryForWorkHistoryList() {
return this.queryForList("" , false);
}
public IPage<WorkHistoryDto> pageList(Page<WorkHistoryDto> page, WorkHistoryDto tzUgpWorkHistory){
return workHistoryMapper.pageList(page, tzUgpWorkHistory);
}
}
\ No newline at end of file
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