259 lines
11 KiB
XML
259 lines
11 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>
|
|
|
|
<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
|
|
(
|
|
<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>
|
|
)
|
|
</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>
|
|
<select id="selectPagesWorkFlow"
|
|
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
|
|
(
|
|
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 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>
|
|
<select id="selectCountWorkFlow" 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 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 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="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>
|