| | |
| | | |
| | | <select id="find" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.IssueCondition"> |
| | | SELECT |
| | | DISTINCT issue.id as id, |
| | | issue.id as id, |
| | | issue.register_id as registerId, |
| | | issue.reverse_index as reverseIndex, |
| | | issue.title as title, |
| | |
| | | project.project_key as projectKey, |
| | | issue_type.id as issueTypeId, |
| | | issue_type.name as issueTypeName, |
| | | issue_type.inherit_partners as inheritPartners, |
| | | issue_status.id as issueStatusId, |
| | | issue_status.issue_status_type as issueStatusType, |
| | | issue_status.name as issueStatusName, |
| | |
| | | severity.id as severityId, |
| | | severity.name as severityName, |
| | | severity.color as severityColor, |
| | | ic.name AS companyName, |
| | | ii.name AS ispName, |
| | | ih.name AS hostingName, |
| | | d.department_name AS departmentName, |
| | | GROUP_CONCAT(issue_custom.use_value) AS useValue, |
| | | IFNULL(temp_attached_file.attachedFileCount, 0) as attachedFileCount, |
| | | IFNULL(temp_issue_comment.issueCommentCount, 0) as issueCommentCount |
| | |
| | | LEFT OUTER JOIN issue_custom_field_value issue_custom FORCE INDEX(issueIdIndex) ON issue.id = issue_custom.issue_id |
| | | LEFT OUTER JOIN issue_department isd FORCE INDEX(issueIdIndex) ON issue.id = isd.issue_id |
| | | LEFT OUTER JOIN issue_user issue_user FORCE INDEX(issueIdIndex) ON issue.id = issue_user.issue_id |
| | | LEFT OUTER JOIN user_department ud ON ud.department_id = isd.department_id |
| | | LEFT OUTER JOIN department d ON d.id = isd.department_id |
| | | LEFT OUTER JOIN issue_company ic FORCE INDEX(issueIdIndex) ON ic.issue_id = issue.id |
| | | LEFT OUTER JOIN issue_isp ii FORCE INDEX(issueIdIndex) ON ii.issue_id = issue.id |
| | | LEFT OUTER JOIN issue_hosting ih FORCE INDEX(issueIdIndex) ON ih.issue_id = issue.id |
| | | LEFT OUTER JOIN (SELECT issue_id, COUNT(id) as attachedFileCount FROM attached_file GROUP BY issue_id) |
| | | temp_attached_file on (temp_attached_file.issue_id = issue.id) |
| | | LEFT OUTER JOIN (SELECT issue_id, COUNT(id) as issueCommentCount FROM issue_comment GROUP BY issue_id) |
| | | temp_issue_comment on (temp_issue_comment.issue_id = issue.id) |
| | | LEFT OUTER JOIN user user ON issue_user.user_id = user.id |
| | | WHERE 1=1 |
| | | <if test="keyWord != null and !keyWord.equals('') "> |
| | | AND issue.title like CONCAT('%',#{keyWord},'%') |
| | | AND (issue.title like CONCAT('%',#{keyWord},'%') |
| | | OR issue.description like CONCAT('%',#{keyWord},'%') |
| | | OR issue.start_date like CONCAT('%',#{keyWord},'%') |
| | | OR issue.complete_date like CONCAT('%',#{keyWord},'%') |
| | |
| | | OR priority.name like CONCAT('%',#{keyWord},'%') |
| | | OR severity.name like CONCAT('%',#{keyWord},'%') |
| | | OR issue_custom.use_value like CONCAT('%',#{keyWord},'%') |
| | | OR d.department_name like CONCAT('%',#{keyWord},'%') |
| | | OR ic.name like CONCAT('%',#{keyWord},'%') |
| | | OR ic.manager like CONCAT('%',#{keyWord},'%') |
| | | OR ic.tel like CONCAT('%',#{keyWord},'%') |
| | | OR ic.email like CONCAT('%',#{keyWord},'%') |
| | | OR ic.url like CONCAT('%',#{keyWord},'%') |
| | | OR ic.memo like CONCAT('%',#{keyWord},'%') |
| | | OR ii.name like CONCAT('%',#{keyWord},'%') |
| | | OR ii.code like CONCAT('%',#{keyWord},'%') |
| | | OR ii.manager like CONCAT('%',#{keyWord},'%') |
| | | OR ii.tel like CONCAT('%',#{keyWord},'%') |
| | | OR ii.email like CONCAT('%',#{keyWord},'%') |
| | | OR ii.url like CONCAT('%',#{keyWord},'%') |
| | | OR ii.memo like CONCAT('%',#{keyWord},'%') |
| | | OR ih.name like CONCAT('%',#{keyWord},'%') |
| | | OR ih.code like CONCAT('%',#{keyWord},'%') |
| | | OR ih.manager like CONCAT('%',#{keyWord},'%') |
| | | OR ih.tel like CONCAT('%',#{keyWord},'%') |
| | | OR ih.email like CONCAT('%',#{keyWord},'%') |
| | | OR ih.url like CONCAT('%',#{keyWord},'%') |
| | | OR ih.memo like CONCAT('%',#{keyWord},'%')) |
| | | </if> |
| | | |
| | | <if test="title != null and !title.equals('')"> |
| | |
| | | ANd issue.complete_date <![CDATA[ <= ]]> #{endCompleteDate} |
| | | </if> |
| | | |
| | | <if test="hideIssue != null and hideIssue == true"> |
| | | <if test="beginDateRange != null and !beginDateRange.equals('') and endDateRange != null and !endDateRange.equals('')"> |
| | | AND (issue.start_date BETWEEN #{beginDateRange} AND #{endDateRange} OR issue.complete_date BETWEEN #{beginDateRange} AND #{endDateRange}) |
| | | </if> |
| | | |
| | | <if test="combinationIssueNumber == null or combinationIssueNumber.equals('')"> |
| | | <if test="hideDownIssue != null and hideDownIssue == true and parentYN == true"> |
| | | AND issue.parent_issue_id IS NULL |
| | | </if> |
| | | </if> |
| | | |
| | | <if test="hideCompleteIssue != null and hideCompleteIssue == true"> |
| | | AND issue_status.issue_status_type != 'CLOSE' |
| | | </if> |
| | | |
| | | <if test="parentYN != null and parentYN == true and hideDownIssue == true"> |
| | | AND issue.parent_issue_id IS NULL |
| | | </if> |
| | | |
| | | <if test="hideDownIssue == false and parentYN == false"> |
| | | AND issue.parent_issue_id IS NOT NULL |
| | | </if> |
| | | |
| | | <choose> |
| | |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="myDepartmentIds != null and myDepartmentIds.size != 0"> |
| | | AND isd.department_id IN |
| | | <foreach collection="myDepartmentIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="registerIds.size != 0"> |
| | | AND issue.register_id IN |
| | | <foreach collection="registerIds" item="item" index="index" separator="," open="(" close=")"> |
| | |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | <if test="combinationIssueNumber == null or combinationIssueNumber.equals('')"> |
| | | AND issue.parent_issue_id IS NULL |
| | | </if> |
| | | AND issue.reverse_index <![CDATA[ < ]]> 0 |
| | | AND workspace.id = #{workspaceId} |
| | | GROUP BY issue.id |
| | | ORDER BY issue.modify_date DESC |
| | | ORDER BY issue.register_date DESC |
| | | <if test="page != null and !page.equals('')"> |
| | | limit #{pageSize} offset #{page}; |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="findByDepartment" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.IssueCondition"> |
| | | <select id="count" resultType="java.lang.Long" parameterType="kr.wisestone.owl.web.condition.IssueCondition"> |
| | | SELECT |
| | | DISTINCT issue.id as id, |
| | | issue.register_id as registerId, |
| | | issue.reverse_index as reverseIndex, |
| | | issue.title as title, |
| | | issue.description as description, |
| | | issue.parent_issue_id as parentIssueId, |
| | | issue.start_date as startDate, |
| | | issue.complete_date as completeDate, |
| | | issue.issue_number as issueNumber, |
| | | issue.register_date as registerDate, |
| | | SUBSTRING(issue.modify_date, 1, 19) as modifyDate, |
| | | project.id as projectId, |
| | | project.name as projectName, |
| | | project.project_key as projectKey, |
| | | issue_type.id as issueTypeId, |
| | | issue_type.name as issueTypeName, |
| | | issue_status.id as issueStatusId, |
| | | issue_status.issue_status_type as issueStatusType, |
| | | issue_status.name as issueStatusName, |
| | | issue_status.color as issueStatusColor, |
| | | priority.id as priorityId, |
| | | priority.name as priorityName, |
| | | priority.color as priorityColor, |
| | | severity.id as severityId, |
| | | severity.name as severityName, |
| | | severity.color as severityColor, |
| | | GROUP_CONCAT(issue_custom.use_value) AS useValue, |
| | | IFNULL(temp_attached_file.attachedFileCount, 0) as attachedFileCount, |
| | | IFNULL(temp_issue_comment.issueCommentCount, 0) as issueCommentCount |
| | | FROM issue issue FORCE INDEX(reverseIndex) |
| | | COUNT(DISTINCT issue.id) |
| | | FROM issue issue |
| | | INNER JOIN project project FORCE INDEX(workspaceIdIndex) ON issue.project_id = project.id |
| | | INNER JOIN workspace workspace ON workspace.id = project.workspace_id |
| | | INNER JOIN issue_status issue_status FORCE INDEX(PRIMARY) ON issue.issue_status_id = issue_status.id |
| | | INNER JOIN issue_type issue_type FORCE INDEX(PRIMARY) ON issue.issue_type_id = issue_type.id |
| | | INNER JOIN priority priority FORCE INDEX(PRIMARY) ON issue.priority_id = priority.id |
| | | INNER JOIN severity severity FORCE INDEX(PRIMARY) ON issue.severity_id = severity.id |
| | | INNER JOIN issue_department isd ON isd.issue_id = issue.id |
| | | INNER JOIN user_department ud ON ud.department_id = isd.department_id |
| | | LEFT OUTER JOIN issue_custom_field_value issue_custom FORCE INDEX(issueIdIndex) ON issue.id = issue_custom.issue_id |
| | | LEFT OUTER JOIN issue_department isd FORCE INDEX(issueIdIndex) ON issue.id = isd.issue_id |
| | | LEFT OUTER JOIN issue_user issue_user FORCE INDEX(issueIdIndex) ON issue.id = issue_user.issue_id |
| | | LEFT OUTER JOIN user_department ud ON ud.department_id = isd.department_id |
| | | LEFT OUTER JOIN department d ON d.id = isd.department_id |
| | | LEFT OUTER JOIN issue_company ic USE index(issueIdIndex) ON ic.issue_id = issue.id |
| | | LEFT OUTER JOIN issue_isp ii USE INDEX(issueIdIndex) ON ii.issue_id = issue.id |
| | | LEFT OUTER JOIN issue_hosting ih USE index(issueIdIndex) ON ih.issue_id = issue.id |
| | | LEFT OUTER JOIN (SELECT issue_id, COUNT(id) as attachedFileCount FROM attached_file GROUP BY issue_id) |
| | | temp_attached_file on (temp_attached_file.issue_id = issue.id) |
| | | LEFT OUTER JOIN (SELECT issue_id, COUNT(id) as issueCommentCount FROM issue_comment GROUP BY issue_id) |
| | | temp_issue_comment on (temp_issue_comment.issue_id = issue.id) |
| | | WHERE 1=1 |
| | | <if test="keyWord != null and !keyWord.equals('') and myDepartmentIds.size != 0"> |
| | | AND issue.title like CONCAT('%',#{keyWord},'%') |
| | | <if test="keyWord != null and !keyWord.equals('') "> |
| | | AND (issue.title like CONCAT('%',#{keyWord},'%') |
| | | OR issue.description like CONCAT('%',#{keyWord},'%') |
| | | OR issue.start_date like CONCAT('%',#{keyWord},'%') |
| | | OR issue.complete_date like CONCAT('%',#{keyWord},'%') |
| | |
| | | OR priority.name like CONCAT('%',#{keyWord},'%') |
| | | OR severity.name like CONCAT('%',#{keyWord},'%') |
| | | OR issue_custom.use_value like CONCAT('%',#{keyWord},'%') |
| | | OR d.department_name like CONCAT('%',#{keyWord},'%') |
| | | OR ic.name like CONCAT('%',#{keyWord},'%') |
| | | OR ic.manager like CONCAT('%',#{keyWord},'%') |
| | | OR ic.tel like CONCAT('%',#{keyWord},'%') |
| | | OR ic.email like CONCAT('%',#{keyWord},'%') |
| | | OR ic.url like CONCAT('%',#{keyWord},'%') |
| | | OR ic.memo like CONCAT('%',#{keyWord},'%') |
| | | OR ii.name like CONCAT('%',#{keyWord},'%') |
| | | OR ii.code like CONCAT('%',#{keyWord},'%') |
| | | OR ii.manager like CONCAT('%',#{keyWord},'%') |
| | | OR ii.tel like CONCAT('%',#{keyWord},'%') |
| | | OR ii.email like CONCAT('%',#{keyWord},'%') |
| | | OR ii.url like CONCAT('%',#{keyWord},'%') |
| | | OR ii.memo like CONCAT('%',#{keyWord},'%') |
| | | OR ih.name like CONCAT('%',#{keyWord},'%') |
| | | OR ih.code like CONCAT('%',#{keyWord},'%') |
| | | OR ih.manager like CONCAT('%',#{keyWord},'%') |
| | | OR ih.tel like CONCAT('%',#{keyWord},'%') |
| | | OR ih.email like CONCAT('%',#{keyWord},'%') |
| | | OR ih.url like CONCAT('%',#{keyWord},'%') |
| | | OR ih.memo like CONCAT('%',#{keyWord},'%')) |
| | | </if> |
| | | |
| | | <if test="title != null and !title.equals('')"> |
| | |
| | | ANd issue.complete_date <![CDATA[ <= ]]> #{endCompleteDate} |
| | | </if> |
| | | |
| | | <if test="hideIssue != null and hideIssue == true"> |
| | | <if test="beginDateRange != null and !beginDateRange.equals('') and endDateRange != null and !endDateRange.equals('')"> |
| | | AND (issue.start_date BETWEEN #{beginDateRange} AND #{endDateRange} OR issue.complete_date BETWEEN #{beginDateRange} AND #{endDateRange}) |
| | | </if> |
| | | |
| | | <if test="combinationIssueNumber == null or combinationIssueNumber.equals('')"> |
| | | <if test="hideDownIssue != null and hideDownIssue == true and parentYN == true"> |
| | | AND issue.parent_issue_id IS NULL |
| | | </if> |
| | | </if> |
| | | |
| | | <if test="hideDownIssue == false and parentYN == false"> |
| | | AND issue.parent_issue_id IS NOT NULL |
| | | </if> |
| | | |
| | | <if test="hideCompleteIssue != null and hideCompleteIssue == true"> |
| | | AND issue_status.issue_status_type != 'CLOSE' |
| | | </if> |
| | | |
| | | <choose> |
| | | <when test="myDepartmentIds.size != 0"> |
| | | <when test="projectIds.size != 0"> |
| | | AND issue.project_id IN |
| | | <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="issueStatusIds.size != 0"> |
| | | AND issue.issue_status_id IN |
| | | <foreach collection="issueStatusIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="issueTypeIds.size != 0"> |
| | | AND issue.issue_type_id IN |
| | | <foreach collection="issueTypeIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="priorityIds.size != 0"> |
| | | AND issue.priority_id IN |
| | | <foreach collection="priorityIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="severityIds.size != 0"> |
| | | AND issue.severity_id IN |
| | | <foreach collection="severityIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="departmentIds.size != 0"> |
| | | AND isd.department_id IN |
| | | <foreach collection="departmentIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="myDepartmentIds != null and myDepartmentIds.size != 0"> |
| | | AND isd.department_id IN |
| | | <foreach collection="myDepartmentIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | AND 1 != 1 |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="projectIds.size != 0"> |
| | | AND project.id IN |
| | | <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="issueStatusIds.size != 0"> |
| | | AND issue_status.id IN |
| | | <foreach collection="issueStatusIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="issueTypeIds.size != 0"> |
| | | AND issue_type.id IN |
| | | <foreach collection="issueTypeIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="priorityIds.size != 0"> |
| | | AND priority.id IN |
| | | <foreach collection="priorityIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="severityIds.size != 0"> |
| | | AND severity.id IN |
| | | <foreach collection="severityIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="registerIds.size != 0"> |
| | | AND issue.register_id IN |
| | | <foreach collection="registerIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="issueIds.size != 0"> |
| | | AND issue.id IN |
| | | <foreach collection="issueIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | <choose> |
| | | <when test="excludeIds.size != 0"> |
| | | AND issue.id NOT IN |
| | | <foreach collection="excludeIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | AND issue.parent_issue_id IS NULL |
| | | AND issue.reverse_index <![CDATA[ < ]]> 0 |
| | | AND workspace.id = #{workspaceId} |
| | | GROUP BY issue.id |
| | | ORDER BY issue.modify_date DESC |
| | | <if test="page != null and !page.equals('')"> |
| | | limit #{pageSize} offset #{page}; |
| | | </if> |
| | | </select> |
| | | |
| | | <!--<select id="count" resultType="java.lang.Long" parameterType="kr.wisestone.owl.web.condition.IssueCondition"> |
| | | SELECT |
| | | COUNT(DISTINCT issue.id) |
| | | FROM issue issue |
| | | LEFT OUTER JOIN issue_user issue_user ON issue.id = issue_user.issue_id |
| | | WHERE 1=1 |
| | | AND issue.parent_issue_id IS NULL |
| | | <if test="title != null and !title.equals('') "> |
| | | AND issue.title like CONCAT('%',#{title},'%') |
| | | </if> |
| | | |
| | | <if test="description != null and !description.equals('')"> |
| | | AND issue.description like CONCAT('%',#{description},'%') |
| | | </if> |
| | | |
| | | <if test="issueNumber != null and !issueNumber.equals('')"> |
| | | AND issue.issue_number = #{issueNumber} |
| | | </if> |
| | | |
| | | <if test="beginRegisterDate != null and !beginRegisterDate.equals('')"> |
| | | ANd issue.register_date >= #{beginRegisterDate} |
| | | </if> |
| | | |
| | | <if test="endRegisterDate != null and !endRegisterDate.equals('')"> |
| | | ANd issue.register_date <![CDATA[ <= ]]> #{endRegisterDate} |
| | | </if> |
| | | |
| | | <if test="beginStartDate != null and !beginStartDate.equals('')"> |
| | | ANd issue.start_date >= #{beginStartDate} |
| | | </if> |
| | | |
| | | <if test="endStartDate != null and !endStartDate.equals('')"> |
| | | ANd issue.start_date <![CDATA[ <= ]]> #{endStartDate} |
| | | </if> |
| | | |
| | | <if test="beginCompleteDate != null and !beginCompleteDate.equals('')"> |
| | | ANd issue.complete_date >= #{beginCompleteDate} |
| | | </if> |
| | | |
| | | <if test="endCompleteDate != null and !endCompleteDate.equals('')"> |
| | | ANd issue.complete_date <![CDATA[ <= ]]> #{endCompleteDate} |
| | | </if> |
| | | |
| | | <choose> |
| | | <when test="projectIds.size != 0"> |
| | | AND issue.project_id IN |
| | | <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="issueStatusIds.size != 0"> |
| | | AND issue.issue_status_id IN |
| | | <foreach collection="issueStatusIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="issueTypeIds.size != 0"> |
| | | AND issue.issue_type_id IN |
| | | <foreach collection="issueTypeIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="priorityIds.size != 0"> |
| | | AND issue.priority_id IN |
| | | <foreach collection="priorityIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="severityIds.size != 0"> |
| | | AND issue.severity_id IN |
| | | <foreach collection="severityIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="userIds.size != 0"> |
| | | AND issue_user.user_id IN |
| | | <foreach collection="userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="departmentIds.size != 0"> |
| | | AND issue_department.department_id IN |
| | | <foreach collection="departmentIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="registerIds.size != 0"> |
| | | AND issue.register_id IN |
| | | <foreach collection="registerIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="issueIds.size != 0"> |
| | | AND issue.id IN |
| | | <foreach collection="issueIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | <choose> |
| | | <when test="excludeIds.size != 0"> |
| | | AND issue.id NOT IN |
| | | <foreach collection="excludeIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | </select>--> |
| | | |
| | | <select id="count" resultType="java.lang.Long" parameterType="kr.wisestone.owl.web.condition.IssueCondition"> |
| | | SELECT |
| | | COUNT(DISTINCT issue.id) |
| | | FROM issue issue |
| | | LEFT OUTER JOIN issue_department isd ON issue.id = isd.issue_id |
| | | LEFT OUTER JOIN issue_status iss ON iss.id = issue.issue_status_id |
| | | WHERE 1=1 |
| | | AND issue.parent_issue_id IS NULL |
| | | <if test="title != null and !title.equals('') "> |
| | | AND issue.title like CONCAT('%',#{title},'%') |
| | | </if> |
| | | |
| | | <if test="description != null and !description.equals('')"> |
| | | AND issue.description like CONCAT('%',#{description},'%') |
| | | </if> |
| | | |
| | | <if test="issueNumber != null and !issueNumber.equals('')"> |
| | | AND issue.issue_number = #{issueNumber} |
| | | </if> |
| | | |
| | | <if test="beginRegisterDate != null and !beginRegisterDate.equals('')"> |
| | | ANd issue.register_date >= #{beginRegisterDate} |
| | | </if> |
| | | |
| | | <if test="endRegisterDate != null and !endRegisterDate.equals('')"> |
| | | ANd issue.register_date <![CDATA[ <= ]]> #{endRegisterDate} |
| | | </if> |
| | | |
| | | <if test="beginStartDate != null and !beginStartDate.equals('')"> |
| | | ANd issue.start_date >= #{beginStartDate} |
| | | </if> |
| | | |
| | | <if test="endStartDate != null and !endStartDate.equals('')"> |
| | | ANd issue.start_date <![CDATA[ <= ]]> #{endStartDate} |
| | | </if> |
| | | |
| | | <if test="beginCompleteDate != null and !beginCompleteDate.equals('')"> |
| | | ANd issue.complete_date >= #{beginCompleteDate} |
| | | </if> |
| | | |
| | | <if test="endCompleteDate != null and !endCompleteDate.equals('')"> |
| | | ANd issue.complete_date <![CDATA[ <= ]]> #{endCompleteDate} |
| | | </if> |
| | | |
| | | <if test="hideIssue != null and hideIssue == true"> |
| | | AND iss.issue_status_type != 'CLOSE' |
| | | </if> |
| | | |
| | | <choose> |
| | | <when test="projectIds.size != 0"> |
| | | AND issue.project_id IN |
| | | <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="issueStatusIds.size != 0"> |
| | | AND issue.issue_status_id IN |
| | | <foreach collection="issueStatusIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="issueTypeIds.size != 0"> |
| | | AND issue.issue_type_id IN |
| | | <foreach collection="issueTypeIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="priorityIds.size != 0"> |
| | | AND issue.priority_id IN |
| | | <foreach collection="priorityIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="severityIds.size != 0"> |
| | | AND issue.severity_id IN |
| | | <foreach collection="severityIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="departmentIds.size != 0"> |
| | | AND isd.department_id IN |
| | | <foreach collection="departmentIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | |
| | | LEFT OUTER JOIN issue_department isd ON issue.id = isd.issue_id |
| | | LEFT OUTER JOIN issue_status iss ON iss.id = issue.issue_status_id |
| | | WHERE 1=1 |
| | | AND issue.parent_issue_id IS NULL |
| | | <if test="title != null and !title.equals('') "> |
| | | AND issue.title like CONCAT('%',#{title},'%') |
| | | </if> |
| | |
| | | ANd issue.complete_date <![CDATA[ <= ]]> #{endCompleteDate} |
| | | </if> |
| | | |
| | | <if test="hideIssue != null and hideIssue == true"> |
| | | <if test="combinationIssueNumber == null or combinationIssueNumber.equals('')"> |
| | | <if test="hideDownIssue != null and hideDownIssue == true"> |
| | | AND issue.parent_issue_id IS NULL |
| | | </if> |
| | | </if> |
| | | |
| | | <if test="hideCompleteIssue != null and hideCompleteIssue == true"> |
| | | AND iss.issue_status_type != 'CLOSE' |
| | | </if> |
| | | |
| | | <choose> |
| | | <when test="myDepartmentIds.size != 0"> |
| | | <when test="myDepartmentIds != null and myDepartmentIds.size != 0"> |
| | | AND isd.department_id IN |
| | | <foreach collection="myDepartmentIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | |
| | | |
| | | <insert id="insertBatch" keyColumn="id" keyProperty="id" useGeneratedKeys="true"> |
| | | INSERT INTO issue(title, description, issue_number, project_id, issue_type_id, priority_id, severity_id, |
| | | start_date, complete_date, |
| | | start_date, complete_date, parent_issue_id, |
| | | issue_status_id, register_id, modify_id, register_date, modify_date) |
| | | VALUES |
| | | <foreach collection="list" item="issueForm" index="index" separator="," open="" close=""> |
| | | (#{issueForm.title}, #{issueForm.description}, #{issueForm.issueNumber}, #{issueForm.projectId}, |
| | | #{issueForm.issueTypeId}, #{issueForm.priorityId}, #{issueForm.severityId}, #{issueForm.startDate}, |
| | | #{issueForm.completeDate}, |
| | | #{issueForm.completeDate}, #{issueForm.parentIssueId}, |
| | | #{issueForm.issueStatusId}, #{issueForm.registerId}, #{issueForm.registerId}, NOW(), NOW()) |
| | | </foreach> |
| | | </insert> |
| | |
| | | issue.id as id, |
| | | issue.title as title, |
| | | customFieldValue.customFieldType AS customFieldType, |
| | | GROUP_CONCAT(customFieldValue.useValue) AS concatUseValue |
| | | GROUP_CONCAT(customFieldValue.useValue ORDER BY customFieldValue.customFieldId ASC) AS concatUseValue |
| | | FROM issue issue FORCE INDEX(reverseIndex) |
| | | INNER JOIN issue_status as issStatus ON issue.issue_status_id = issStatus.id |
| | | LEFT OUTER JOIN ( |
| | | SELECT cf.id AS customFieldId, cf.custom_field_type AS customFieldType, issue_custom.use_value AS useValue, issue_custom.issue_id AS issueId |
| | | FROM issue_custom_field_value issue_custom |
| | | INNER JOIN custom_field cf ON cf.id = issue_custom.custom_field_id |
| | | ORDER BY issue_custom.id ASC) customFieldValue ON customFieldValue.issueId = issue.id |
| | | WHERE issStatus.issue_status_type != 'CLOSE' |
| | | AND issue.issue_type_id = #{issueTypeId} |
| | | <choose> |
| | | <when test="useValues.size != 0"> |
| | | WHERE issue_custom.use_value IN |
| | | <foreach collection="useValues" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </when> |
| | | </choose> |
| | | ) customFieldValue ON customFieldValue.issueId = issue.id |
| | | WHERE issue.issue_type_id = #{issueTypeId} |
| | | <choose> |
| | | <when test="issueStatusType != null"> |
| | | AND issStatus.issue_status_type != #{issueStatusType} |
| | | </when> |
| | | </choose> |
| | | GROUP BY issue.id |
| | | HAVING concatUseValue LIKE CONCAT('%', #{useValue}, '%') |
| | | </select> |
| | | |
| | | <!-- 사용자 정의 필드 값이(SITE,IP) 업체와 동일한 이슈를 조회 --> |
| | | <select id="findByCustomFieldValueBySite" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.IssueCustomFieldValueCondition"> |
| | | SELECT |
| | | issue.id as id, |
| | | issue.title as title, |
| | | issc.ip_start AS ipStart, |
| | | issc.ip_end AS ipEnd, |
| | | customFieldValue.customFieldType AS customFieldType, |
| | | GROUP_CONCAT(customFieldValue.useValue ORDER BY customFieldValue.customFieldId ASC) AS concatUseValue |
| | | FROM issue issue FORCE INDEX(reverseIndex) |
| | | INNER JOIN issue_status as issStatus ON issue.issue_status_id = issStatus.id |
| | | LEFT OUTER JOIN ( |
| | | SELECT cf.id AS customFieldId, cf.custom_field_type AS customFieldType, issue_custom.use_value AS useValue, issue_custom.issue_id AS issueId |
| | | FROM issue_custom_field_value issue_custom |
| | | INNER JOIN custom_field cf ON cf.id = issue_custom.custom_field_id |
| | | ) customFieldValue ON customFieldValue.issueId = issue.id |
| | | LEFT OUTER JOIN issue_company issc ON issc.issue_id = issue.id |
| | | WHERE issue.issue_type_id = #{issueTypeId} |
| | | <if test="useValue != null and useValue != ''"> |
| | | AND issc.url LIKE CONCAT('%',#{useValue},'%') |
| | | </if> |
| | | <choose> |
| | | <when test="issueStatusType != null"> |
| | | AND issStatus.issue_status_type != #{issueStatusType} |
| | | </when> |
| | | </choose> |
| | | GROUP BY issue.id |
| | | </select> |
| | | |
| | | <!-- 종료 안된 하위 이슈 가져오기 --> |
| | | <select id="findNotCompleteByParentIssueId" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.IssueCondition"> |