353 lines
13 KiB
XML
353 lines
13 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.adc.da.slrs.sarStandProjectLibrary.dao.SarStandProjectLibraryDao">
|
|
<insert id="batchInsert">
|
|
insert into sar_stand_project_relation(project_id,stand_id) VALUES
|
|
<foreach collection="list" item="list" separator=",">
|
|
(#{list.projectId,jdbcType=VARCHAR},#{list.standId,jdbcType=VARCHAR})
|
|
</foreach>
|
|
</insert>
|
|
|
|
|
|
<select id="queryProjectManagerPage"
|
|
resultType="com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary">
|
|
select s.product_line,t.UNAME as uName ,s.project_manager as projectManager
|
|
from sar_stand_project_library s
|
|
INNER JOIN ts_user t
|
|
ON s.project_manager=t.USID
|
|
GROUP BY s.product_line
|
|
limit #{current},#{pageSize}
|
|
</select>
|
|
|
|
<delete id="deleteByIds">
|
|
delete from sar_stand_project_relation where
|
|
<foreach collection="ids" item="list" separator="or">
|
|
( project_id= #{list.projectId} and stand_id = #{list.standId} )
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
<delete id="deleteByProjectId">
|
|
delete from sar_stand_project_relation where
|
|
project_id= #{projectId}
|
|
</delete>
|
|
|
|
<update id="updateByProjectId">
|
|
update sar_stand_project_library
|
|
<if test="id != null">
|
|
set detailed_list_version = #{version} where id = #{id}
|
|
</if>
|
|
</update>
|
|
|
|
<select id="selectCount" resultType="java.lang.Integer">
|
|
SELECT
|
|
count(
|
|
library.id
|
|
) AS total
|
|
FROM
|
|
sar_stand_project_library as library
|
|
LEFT JOIN sar_stand_project_team as team ON team.project_code = library.project_number
|
|
WHERE
|
|
|
|
<if test="flag == 1">
|
|
library.id NOT IN ( SELECT project_id FROM sar_stand_project_relation )
|
|
</if>
|
|
<if test="flag == 2">
|
|
library.id IN ( SELECT project_id FROM sar_stand_project_relation )
|
|
</if>
|
|
<if test="flag == 4">
|
|
1=1
|
|
</if>
|
|
<if test="qu != null">
|
|
<if test="qu.projectNumber != null">
|
|
AND library.project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
|
</if>
|
|
<if test="qu.projectName != null">
|
|
AND library.project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
|
</if>
|
|
<if test="qu.projectClassification != null">
|
|
AND library.project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
|
</if>
|
|
<if test="qu.projectPlatfor != null">
|
|
AND library.project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
|
</if>
|
|
<if test="qu.projectGroup != null">
|
|
AND library.project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
|
</if>
|
|
<if test="qu.projectStatus != null">
|
|
AND library.project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
|
</if>
|
|
<if test="qu.currentNode != null">
|
|
AND library.current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
|
</if>
|
|
<if test="qu.projectLevel != null">
|
|
AND library.project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
|
</if>
|
|
<if test="qu.projectManager != null">
|
|
AND team.name LIKE concat(concat('%',#{qu.projectManager}),'%')
|
|
</if>
|
|
<if test="qu.productLine != null">
|
|
AND library.product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
|
</if>
|
|
<if test="qu.projectStartDate != null">
|
|
AND library.project_start_date >= #{qu.projectStartDate}
|
|
</if>
|
|
<if test="qu.projectEndDate != null">
|
|
AND library.project_end_date <= #{qu.projectEndDate}
|
|
</if>
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<select id="selectPages" resultType="com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary">
|
|
SELECT
|
|
library.*,
|
|
team.`name` as uName
|
|
FROM
|
|
sar_stand_project_library as library
|
|
LEFT JOIN sar_stand_project_team as team
|
|
ON team.project_code = library.project_number
|
|
WHERE
|
|
<if test="flag == 1">
|
|
library.id NOT IN ( SELECT project_id FROM sar_stand_project_relation )
|
|
</if>
|
|
<if test="flag == 2">
|
|
library.id IN ( SELECT project_id FROM sar_stand_project_relation )
|
|
</if>
|
|
<if test="flag == 4">
|
|
1=1
|
|
</if>
|
|
<if test="qu != null">
|
|
|
|
<if test="qu.projectNumber != null">
|
|
AND library.project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
|
</if>
|
|
<if test="qu.projectName != null">
|
|
AND library.project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
|
</if>
|
|
<if test="qu.projectClassification != null">
|
|
AND library.project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
|
</if>
|
|
<if test="qu.projectPlatfor != null">
|
|
AND library.project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
|
</if>
|
|
<if test="qu.projectGroup != null">
|
|
AND library.project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
|
</if>
|
|
<if test="qu.projectStatus != null">
|
|
AND library.project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
|
</if>
|
|
<if test="qu.currentNode != null">
|
|
AND library.current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
|
</if>
|
|
<if test="qu.projectLevel != null">
|
|
AND library.project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
|
</if>
|
|
<if test="qu.projectManager != null">
|
|
AND team.name LIKE concat(concat('%',#{qu.projectManager}),'%')
|
|
</if>
|
|
<if test="qu.productLine != null">
|
|
AND library.product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
|
</if>
|
|
<if test="qu.projectStartDate != null">
|
|
AND library.project_start_date >= #{qu.projectStartDate}
|
|
</if>
|
|
<if test="qu.projectEndDate != null">
|
|
AND library.project_end_date <= #{qu.projectEndDate}
|
|
</if>
|
|
</if>
|
|
|
|
limit ${(page-1)*size},${page*size}
|
|
</select>
|
|
|
|
<select id="selectPagessolostar" resultType="java.lang.String">
|
|
SELECT
|
|
<if test="type == 'ProjectClassification' ">
|
|
distinct library.project_classification
|
|
</if>
|
|
<if test="type == 'ProjectStatus' ">
|
|
distinct library.project_status
|
|
</if>
|
|
FROM
|
|
sar_stand_project_library as library
|
|
LEFT JOIN sar_stand_project_team as team
|
|
ON team.project_code = library.project_number
|
|
WHERE
|
|
<if test="flag == 1">
|
|
library.id NOT IN ( SELECT project_id FROM sar_stand_project_relation )
|
|
</if>
|
|
<if test="flag == 2">
|
|
library.id IN ( SELECT project_id FROM sar_stand_project_relation )
|
|
</if>
|
|
<if test="flag == 4">
|
|
1=1
|
|
</if>
|
|
</select>
|
|
|
|
<select id="selectPagesWorkFlow"
|
|
resultType="com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary">
|
|
SELECT
|
|
library.*, team.`name` AS uName
|
|
FROM
|
|
sar_stand_project_library as library
|
|
LEFT JOIN sar_stand_project_team as team ON team.project_code = library.project_number
|
|
WHERE
|
|
(
|
|
library.id IN (
|
|
SELECT DISTINCT
|
|
project_id
|
|
FROM
|
|
sar_stand_project_relation
|
|
WHERE
|
|
project_id NOT IN (
|
|
SELECT DISTINCT
|
|
STAND_ID
|
|
FROM
|
|
sar_stand_items
|
|
)
|
|
)
|
|
<if test="qu != null">
|
|
<if test="qu.projectNumber != null">
|
|
AND library.project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
|
</if>
|
|
<if test="qu.projectName != null">
|
|
AND library.project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
|
</if>
|
|
<if test="qu.projectClassification != null">
|
|
AND library.project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
|
</if>
|
|
<if test="qu.projectPlatfor != null">
|
|
AND library.project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
|
</if>
|
|
<if test="qu.projectGroup != null">
|
|
AND library.project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
|
</if>
|
|
<if test="qu.projectStatus != null">
|
|
AND library.project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
|
</if>
|
|
<if test="qu.currentNode != null">
|
|
AND library.current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
|
</if>
|
|
<if test="qu.projectLevel != null">
|
|
AND library.project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
|
</if>
|
|
<if test="qu.projectManager != null">
|
|
AND team.name LIKE concat(concat('%',#{qu.projectManager}),'%')
|
|
</if>
|
|
<if test="qu.productLine != null">
|
|
AND library.product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
|
</if>
|
|
<if test="qu.projectStartDate != null">
|
|
AND library.project_start_date >= #{qu.projectStartDate}
|
|
</if>
|
|
<if test="qu.projectEndDate != null">
|
|
AND library.project_end_date <= #{qu.projectEndDate}
|
|
</if>
|
|
</if>
|
|
)
|
|
limit ${(page-1)*size},${page*size}
|
|
|
|
</select>
|
|
|
|
<select id="selectPagesWorkFlowsolostar"
|
|
resultType="java.lang.String">
|
|
SELECT
|
|
<if test="type == 'ProjectClassification' ">
|
|
distinct library.project_classification
|
|
</if>
|
|
<if test="type == 'ProjectStatus' ">
|
|
distinct library.project_status
|
|
</if>
|
|
FROM
|
|
sar_stand_project_library as library
|
|
LEFT JOIN sar_stand_project_team as team ON team.project_code = library.project_number
|
|
WHERE
|
|
(
|
|
library.id IN (
|
|
SELECT DISTINCT
|
|
project_id
|
|
FROM
|
|
sar_stand_project_relation
|
|
WHERE
|
|
project_id NOT IN (
|
|
SELECT DISTINCT
|
|
STAND_ID
|
|
FROM
|
|
sar_stand_items
|
|
)
|
|
)
|
|
)
|
|
</select>
|
|
<select id="selectCountWorkFlow" resultType="java.lang.Integer">
|
|
SELECT
|
|
count(
|
|
library.id
|
|
) AS total
|
|
FROM
|
|
sar_stand_project_library AS library
|
|
LEFT JOIN sar_stand_project_team AS team ON team.project_code = library.project_number
|
|
WHERE
|
|
(
|
|
library.id IN (
|
|
SELECT DISTINCT
|
|
project_id
|
|
FROM
|
|
sar_stand_project_relation
|
|
WHERE
|
|
project_id NOT IN (
|
|
SELECT DISTINCT
|
|
STAND_ID
|
|
FROM
|
|
sar_stand_items
|
|
)
|
|
)
|
|
|
|
<if test="qu != null">
|
|
<if test="qu.projectNumber != null">
|
|
AND library.project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
|
</if>
|
|
<if test="qu.projectName != null">
|
|
AND library.project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
|
</if>
|
|
<if test="qu.projectClassification != null">
|
|
AND library.project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
|
</if>
|
|
<if test="qu.projectPlatfor != null">
|
|
AND library.project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
|
</if>
|
|
<if test="qu.projectGroup != null">
|
|
AND library.project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
|
</if>
|
|
<if test="qu.projectStatus != null">
|
|
AND library.project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
|
</if>
|
|
<if test="qu.currentNode != null">
|
|
AND library.current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
|
</if>
|
|
<if test="qu.projectLevel != null">
|
|
AND library.project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
|
</if>
|
|
<if test="qu.projectManager != null">
|
|
AND team.name LIKE concat(concat('%',#{qu.projectManager}),'%')
|
|
</if>
|
|
<if test="qu.productLine != null">
|
|
AND library.product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
|
</if>
|
|
<if test="qu.projectStartDate != null">
|
|
AND library.project_start_date >= #{qu.projectStartDate}
|
|
</if>
|
|
<if test="qu.projectEndDate != null">
|
|
AND library.project_end_date <= #{qu.projectEndDate}
|
|
</if>
|
|
</if>
|
|
)
|
|
</select>
|
|
<select id="getAllStands" resultType="java.lang.String">
|
|
SELECT DISTINCT STAND_ID FROM sar_stand_items
|
|
</select>
|
|
|
|
<select id="getAllStand" resultType="java.lang.String">
|
|
SELECT DISTINCT ID FROM sar_standards_info where VALID_FLAG=0
|
|
</select>
|
|
</mapper>
|