feat: 项目分页查询改用xml方式
This commit is contained in:
@@ -13,6 +13,8 @@ import org.agt.framework.common.pojo.PageResult;
|
||||
import org.agt.framework.common.util.object.BeanUtils;
|
||||
import org.agt.framework.excel.core.util.ExcelUtils;
|
||||
import org.agt.framework.translate.core.TranslateUtils;
|
||||
import org.agt.module.license.controller.admin.license.vo.ImportRespVO;
|
||||
import org.agt.module.license.controller.admin.project.vo.ProjectImportRespVO;
|
||||
import org.agt.module.license.controller.admin.project.vo.ProjectListReqVO;
|
||||
import org.agt.module.license.controller.admin.project.vo.ProjectPageReqVO;
|
||||
import org.agt.module.license.controller.admin.project.vo.ProjectRespVO;
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.agt.module.license.dal.mysql.project;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.agt.framework.common.pojo.PageResult;
|
||||
import org.agt.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.agt.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
@@ -12,6 +13,7 @@ import org.agt.module.license.controller.admin.project.vo.ProjectRespVO;
|
||||
import org.agt.module.license.dal.dataobject.license.LicenseDO;
|
||||
import org.agt.module.license.dal.dataobject.project.ProjectDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -78,4 +80,6 @@ public interface ProjectMapper extends BaseMapperX<ProjectDO> {
|
||||
}
|
||||
|
||||
Integer selectMaxCode();
|
||||
|
||||
IPage<ProjectRespVO> queryPage(IPage<?> page, @Param("query") ProjectPageReqVO reqVO);
|
||||
}
|
||||
@@ -86,7 +86,8 @@ public class ProjectServiceImpl implements ProjectService {
|
||||
|
||||
@Override
|
||||
public PageResult<ProjectRespVO> getProjectPage(ProjectPageReqVO pageReqVO) {
|
||||
return projectMapper.selectPage(pageReqVO);
|
||||
IPage<ProjectRespVO> page = projectMapper.queryPage(new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO);
|
||||
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,4 +6,63 @@
|
||||
SELECT max(`code` + 0) from crm_project;
|
||||
</select>
|
||||
|
||||
<select id="queryPage" resultType="org.agt.module.license.controller.admin.project.vo.ProjectRespVO">
|
||||
SELECT
|
||||
p.*,
|
||||
CONCAT( c.`code`, p.`code` ) serial_no
|
||||
FROM
|
||||
crm_project p
|
||||
LEFT JOIN crm_customer c ON p.customer_id = c.id
|
||||
AND c.deleted = 0
|
||||
WHERE
|
||||
p.deleted = 0
|
||||
<if test="query.customerId != null">
|
||||
AND p.customer_id = #{query.customerId}
|
||||
</if>
|
||||
<if test="query.name != null and query.name != ''">
|
||||
AND p.name LIKE CONCAT('%',#{query.name},'%')
|
||||
</if>
|
||||
<if test="query.code != null and query.code != ''">
|
||||
AND p.code LIKE CONCAT('%',#{query.code },'%')
|
||||
</if>
|
||||
<if test="query.contractCode != null and query.contractCode != ''">
|
||||
AND p.contract_code LIKE CONCAT('%',#{query.contractCode},'%')
|
||||
</if>
|
||||
<if test="query.businessStatus != null">
|
||||
AND p.business_status = #{query.businessStatus}
|
||||
</if>
|
||||
<if test="query.businessOwner != null and query.businessOwner != ''">
|
||||
AND p.business_owner LIKE CONCAT('%',#{query.businessOwner},'%')
|
||||
</if>
|
||||
<if test="query.customerOwner != null and query.customerOwner != ''">
|
||||
AND p.customer_owner LIKE CONCAT('%',#{query.customerOwner},'%')
|
||||
</if>
|
||||
<if test="query.startTime != null and query.startTime.length > 1">
|
||||
AND p.start_time BETWEEN #{query.startTime[0]} AND #{query.startTime[1]}
|
||||
</if>
|
||||
<if test="query.endTime != null and query.endTime.length > 1">
|
||||
AND p.end_time BETWEEN #{query.endTime[0]} AND #{query.endTime[1]}
|
||||
</if>
|
||||
<if test="query.createTime != null and query.createTime.length > 1">
|
||||
AND p.create_time BETWEEN #{query.createTime[0]} AND #{query.createTime[1]}
|
||||
</if>
|
||||
<if test="query.status != null">
|
||||
AND p.status = #{query.status}
|
||||
</if>
|
||||
<if test="query.envInfo != null and query.envInfo != ''">
|
||||
AND p.env_info LIKE CONCAT('%',#{query.envInfo},'%')
|
||||
</if>
|
||||
<if test="query.serialNo != null and query.serialNo != ''">
|
||||
AND CONCAT( c.`code`, p.`code` ) LIKE CONCAT('%',#{query.serialNo},'%')
|
||||
</if>
|
||||
<if test="query.technicalOwner != null and query.technicalOwner != ''">
|
||||
AND (p.technical_owner_a LIKE CONCAT('%',#{query.technicalOwner},'%')
|
||||
OR p.technical_owner_b LIKE CONCAT('%',#{query.technicalOwner},'%')
|
||||
OR p.technical_owner_c LIKE CONCAT('%',#{query.technicalOwner},'%'))
|
||||
</if>
|
||||
|
||||
ORDER BY
|
||||
p.id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user