| | |
| | | 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 (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) |
| | |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="departmentIds.size != 0 and 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> |
| | | AND issue.parent_issue_id IS NULL |
| | | <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 |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="findByDepartment" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.IssueCondition"> |
| | | <!--<select id="findByDepartment" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.IssueCondition"> |
| | | SELECT |
| | | DISTINCT issue.id as id, |
| | | issue.register_id as registerId, |
| | |
| | | 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"> |
| | | <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},'%') |
| | |
| | | </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} |
| | |
| | | <if test="page != null and !page.equals('')"> |
| | | limit #{pageSize} offset #{page}; |
| | | </if> |
| | | </select> |
| | | </select>--> |
| | | |
| | | <!--<select id="count" resultType="java.lang.Long" parameterType="kr.wisestone.owl.web.condition.IssueCondition"> |
| | | SELECT |
| | |
| | | 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 |
| | | LEFT OUTER JOIN user_department ud ON ud.department_id = isd.department_id |
| | | WHERE 1=1 |
| | | AND issue.parent_issue_id IS NULL |
| | | <if test="title != null and !title.equals('') "> |
| | |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="departmentIds.size != 0 and 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=")"> |
| | |
| | | </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} |