车型项目库!
This commit is contained in:
+3
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarStandProjectLibrary.dao;
|
|||||||
|
|
||||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary;
|
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary;
|
||||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.StandProjectRelationDto;
|
import com.adc.da.slrs.sarStandProjectLibrary.entity.StandProjectRelationDto;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -19,4 +20,6 @@ public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLib
|
|||||||
List<SarStandProjectLibrary> queryProjectManagerPage(@Param("current") int current, @Param("pageSize") int pageSize);
|
List<SarStandProjectLibrary> queryProjectManagerPage(@Param("current") int current, @Param("pageSize") int pageSize);
|
||||||
void deleteByIds(@Param("ids") List<StandProjectRelationDto> ids);
|
void deleteByIds(@Param("ids") List<StandProjectRelationDto> ids);
|
||||||
void batchInsert(@Param("list") List<StandProjectRelationDto> list);
|
void batchInsert(@Param("list") List<StandProjectRelationDto> list);
|
||||||
|
List<SarStandProjectLibrary> selectPages(@Param("page")Integer page, @Param("size")Integer size,@Param("qu") SarStandProjectLibrary sar,@Param("flag")int flag);
|
||||||
|
Integer selectCount(@Param("qu") SarStandProjectLibrary sar,@Param("flag")int flag);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -27,6 +27,8 @@ public class StandAttrInfoDto {
|
|||||||
private String standSort;
|
private String standSort;
|
||||||
//标准年份
|
//标准年份
|
||||||
private String standYear;
|
private String standYear;
|
||||||
|
//标准类型
|
||||||
|
private String standType;
|
||||||
//中文名称
|
//中文名称
|
||||||
@ExcelProperty("中文名称")
|
@ExcelProperty("中文名称")
|
||||||
private String standName;
|
private String standName;
|
||||||
|
|||||||
+14
-35
@@ -64,21 +64,8 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
|||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
QueryWrapper<SarStandProjectLibrary> wrapper = new QueryWrapper<>();
|
int flag=2;
|
||||||
wrapper.inSql("id", "select project_id from sar_stand_project_relation")
|
return getSarStandProjectLibraryIPage(current, pageSize, sar,flag);
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectPlatfor()),"project_platfor",sar.getProjectPlatfor())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectNumber()),"project_number",sar.getProjectNumber())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectName()),"project_name",sar.getProjectName())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectGroup()),"project_group",sar.getProjectGroup())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectClassification()),"project_classification",sar.getProjectClassification())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectStatus()),"project_status",sar.getProjectStatus())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getCurrentNode()),"current_node",sar.getCurrentNode())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectLevel()),"project_level",sar.getProjectLevel())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectManager()),"project_manager",sar.getProjectManager())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProductLine()),"product_line",sar.getProductLine())
|
|
||||||
.ge(sar.getProjectStartDate()!=null,"project_start_date",sar.getProjectStartDate())
|
|
||||||
.le(sar.getProjectEndDate()!=null,"project_end_date",sar.getProjectEndDate());
|
|
||||||
return getSarStandProjectLibraryIPage(current, pageSize, wrapper);
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public IPage<SarStandProjectLibrary> queryNotMaintenanceProject(int current, int pageSize,
|
public IPage<SarStandProjectLibrary> queryNotMaintenanceProject(int current, int pageSize,
|
||||||
@@ -106,21 +93,8 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
|||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
QueryWrapper<SarStandProjectLibrary> wrapper = new QueryWrapper<>();
|
int flag=1;
|
||||||
wrapper.notInSql("id", "select project_id from sar_stand_project_relation")
|
return getSarStandProjectLibraryIPage(current, pageSize, sar,flag);
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectPlatfor()),"project_platfor",sar.getProjectPlatfor())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectNumber()),"project_number",sar.getProjectNumber())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectName()),"project_name",sar.getProjectName())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectGroup()),"project_group",sar.getProjectGroup())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectClassification()),"project_classification",sar.getProjectClassification())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectStatus()),"project_status",sar.getProjectStatus())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getCurrentNode()),"current_node",sar.getCurrentNode())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectLevel()),"project_level",sar.getProjectLevel())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProjectManager()),"project_manager",sar.getProjectManager())
|
|
||||||
.like(StringUtils.isNotEmpty(sar.getProductLine()),"product_line",sar.getProductLine())
|
|
||||||
.ge(sar.getProjectStartDate()!=null,"project_start_date",sar.getProjectStartDate())
|
|
||||||
.le(sar.getProjectEndDate()!=null,"project_end_date",sar.getProjectEndDate());
|
|
||||||
return getSarStandProjectLibraryIPage(current, pageSize, wrapper);
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public List<SarStandProjectLibrary> queryById(String id) {
|
public List<SarStandProjectLibrary> queryById(String id) {
|
||||||
@@ -158,7 +132,7 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
|||||||
@Override
|
@Override
|
||||||
public IPage<StandAttrInfoDto> queryStandInfo(int current, int pageSize, String standId) {
|
public IPage<StandAttrInfoDto> queryStandInfo(int current, int pageSize, String standId) {
|
||||||
QueryWrapper<SarStandardsInfo> wrapper1 = new QueryWrapper<>();
|
QueryWrapper<SarStandardsInfo> wrapper1 = new QueryWrapper<>();
|
||||||
wrapper1.select("ID","STAND_NUMBER","STAND_SORT","STAND_YEAR","STAND_NAME","STAND_EN_NAME");
|
wrapper1.select("ID","STAND_NUMBER","STAND_SORT","STAND_YEAR","STAND_NAME","STAND_EN_NAME","STAND_TYPE");
|
||||||
wrapper1.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_standards_info.ID WHERE r.project_id ='"+ standId+"'");
|
wrapper1.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_standards_info.ID WHERE r.project_id ='"+ standId+"'");
|
||||||
Page<SarStandardsInfo> page1 = new Page<>(current, pageSize);
|
Page<SarStandardsInfo> page1 = new Page<>(current, pageSize);
|
||||||
IPage<SarStandardsInfo> userIPage1 = SarStandardsInfoDao.selectPage(page1, wrapper1);
|
IPage<SarStandardsInfo> userIPage1 = SarStandardsInfoDao.selectPage(page1, wrapper1);
|
||||||
@@ -181,6 +155,7 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
|||||||
p.setStandSort(s.getStandSort());
|
p.setStandSort(s.getStandSort());
|
||||||
p.setStandYear(s.getStandYear());
|
p.setStandYear(s.getStandYear());
|
||||||
p.setStandName(s.getStandName());
|
p.setStandName(s.getStandName());
|
||||||
|
p.setStandType(s.getStandType());
|
||||||
p.setStandEnName(s.getStandEnName());
|
p.setStandEnName(s.getStandEnName());
|
||||||
for (SarStandAttrInfo a:list2){
|
for (SarStandAttrInfo a:list2){
|
||||||
if(s.getId().equals(a.getStandId())){
|
if(s.getId().equals(a.getStandId())){
|
||||||
@@ -282,11 +257,15 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IPage<SarStandProjectLibrary> getSarStandProjectLibraryIPage(int current, int pageSize, QueryWrapper<SarStandProjectLibrary> wrapper) {
|
private IPage<SarStandProjectLibrary> getSarStandProjectLibraryIPage(int current, int pageSize,SarStandProjectLibrary wrapper,int flag) {
|
||||||
Page<SarStandProjectLibrary> page = new Page<>(current, pageSize);
|
Page<SarStandProjectLibrary> page = new Page<>(current, pageSize);
|
||||||
IPage<SarStandProjectLibrary> userIPage = sarStandProjectLibraryDao.selectPage(page, wrapper);
|
IPage<SarStandProjectLibrary> userIPage = new Page<>();
|
||||||
System.out.println("总条数"+userIPage.getTotal());
|
List<SarStandProjectLibrary> sarStandProjectLibraries=sarStandProjectLibraryDao.selectPages(current,pageSize,wrapper,flag);
|
||||||
System.out.println("总页数"+userIPage.getPages());
|
Integer count = sarStandProjectLibraryDao.selectCount(wrapper,flag);
|
||||||
|
userIPage.setCurrent(current);
|
||||||
|
userIPage.setSize(pageSize);
|
||||||
|
userIPage.setRecords(sarStandProjectLibraries);
|
||||||
|
userIPage.setTotal(count);
|
||||||
return userIPage;
|
return userIPage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+110
-2
@@ -9,7 +9,8 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
<select id="queryProjectManagerPage" resultType="com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary">
|
<select id="queryProjectManagerPage"
|
||||||
|
resultType="com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary">
|
||||||
select s.product_line,t.UNAME as uName ,s.project_manager as projectManager
|
select s.product_line,t.UNAME as uName ,s.project_manager as projectManager
|
||||||
from sar_stand_project_library s
|
from sar_stand_project_library s
|
||||||
INNER JOIN ts_user t
|
INNER JOIN ts_user t
|
||||||
@@ -21,8 +22,115 @@
|
|||||||
<delete id="deleteByIds">
|
<delete id="deleteByIds">
|
||||||
delete from sar_stand_project_relation where
|
delete from sar_stand_project_relation where
|
||||||
<foreach collection="ids" item="list" separator="or">
|
<foreach collection="ids" item="list" separator="or">
|
||||||
( project_id= #{list.projectId} and stand_id = #{list.standId} )
|
( project_id= #{list.projectId} and stand_id = #{list.standId} )
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectCount" resultType="java.lang.Integer" >
|
||||||
|
SELECT
|
||||||
|
count(sar_stand_project_library.id ) as total
|
||||||
|
FROM
|
||||||
|
sar_stand_project_library
|
||||||
|
LEFT JOIN ts_user tu ON project_manager = tu.USID
|
||||||
|
WHERE
|
||||||
|
(
|
||||||
|
id NOT IN ( SELECT project_id FROM sar_stand_project_relation )
|
||||||
|
<if test="qu != null">
|
||||||
|
<if test="qu.projectNumber != null">
|
||||||
|
AND project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectName != null">
|
||||||
|
AND project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectClassification != null">
|
||||||
|
AND project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectPlatfor != null">
|
||||||
|
AND project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectGroup != null">
|
||||||
|
AND project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectStatus != null">
|
||||||
|
AND project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.currentNode != null">
|
||||||
|
AND current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectLevel != null">
|
||||||
|
AND project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectManager != null">
|
||||||
|
AND project_manager LIKE concat(concat('%',#{qu.projectManager}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.productLine != null">
|
||||||
|
AND product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectStartDate != null">
|
||||||
|
AND project_start_date >= #{qu.projectStartDate}
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectEndDate != null">
|
||||||
|
AND project_end_date <= #{qu.projectEndDate}
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
)
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPages" resultType="com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary" >
|
||||||
|
SELECT
|
||||||
|
sar_stand_project_library.*,
|
||||||
|
tu.UNAME as uName
|
||||||
|
FROM
|
||||||
|
sar_stand_project_library
|
||||||
|
LEFT JOIN ts_user tu ON project_manager = tu.USID
|
||||||
|
WHERE
|
||||||
|
(
|
||||||
|
<if test="flag == 1">
|
||||||
|
id NOT IN ( SELECT project_id FROM sar_stand_project_relation )
|
||||||
|
</if>
|
||||||
|
<if test="flag == 2">
|
||||||
|
id IN ( SELECT project_id FROM sar_stand_project_relation )
|
||||||
|
</if>
|
||||||
|
<if test="qu != null">
|
||||||
|
<if test="qu.projectNumber != null">
|
||||||
|
AND project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectName != null">
|
||||||
|
AND project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectClassification != null">
|
||||||
|
AND project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectPlatfor != null">
|
||||||
|
AND project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectGroup != null">
|
||||||
|
AND project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectStatus != null">
|
||||||
|
AND project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.currentNode != null">
|
||||||
|
AND current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectLevel != null">
|
||||||
|
AND project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectManager != null">
|
||||||
|
AND project_manager LIKE concat(concat('%',#{qu.projectManager}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.productLine != null">
|
||||||
|
AND product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectStartDate != null">
|
||||||
|
AND project_start_date >= #{qu.projectStartDate}
|
||||||
|
</if>
|
||||||
|
<if test="qu.projectEndDate != null">
|
||||||
|
AND project_end_date <= #{qu.projectEndDate}
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
)
|
||||||
|
limit ${(page-1)*size},${page*size}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user