Browse Source

Merge branch 'dev_issue_category' into dev_temp

master
sunyuchao 5 years ago
parent
commit
f9a5dd3ee7
  1. 29
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml

29
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml

@ -9,32 +9,41 @@
ip.category_name AS "name" ip.category_name AS "name"
FROM FROM
issue_category ic issue_category ic
INNER JOIN issue_project_category_dict ip ON ic.category_id = ip.id INNER JOIN (
SELECT
a.id AS "idd",
a.customer_id AS "customer_id",
a.sort AS "sort",
CONCAT(b.category_name, '-', a.category_name) AS "category_name"
FROM issue_project_category_dict a
INNER JOIN issue_project_category_dict b ON a.pid = b.id
) ip ON ic.category_id = ip.idd
AND ic.customer_id = ip.customer_id AND ic.customer_id = ip.customer_id
WHERE WHERE
ic.del_flag = '0' ic.del_flag = '0'
AND ip.del_flag = '0'
AND ic.issue_id = #{issueId} AND ic.issue_id = #{issueId}
ORDER BY ORDER BY
ip.sort ASC ip.sort ASC
</select> </select>
<select id="selectProjectCategoryList" resultType="com.epmet.dto.result.ProjectCategoryTagResultDTO"> <select id="selectProjectCategoryList" resultType="com.epmet.dto.result.ProjectCategoryTagResultDTO">
SELECT SELECT DISTINCT
id AS "id", ip.id AS "id",
category_name AS "name" CONCAT(cd.category_name,'-',ip.category_name) AS "name"
FROM FROM
issue_project_category_dict issue_project_category_dict ip
INNER JOIN issue_project_category_dict cd ON ip.pid = cd.id
WHERE WHERE
del_flag = '0' ip.del_flag = '0'
AND customer_id = #{customerId} AND cd.DEL_FLAG = '0'
AND ip.customer_id = #{customerId}
<if test="categoryIdList != null and categoryIdList.size() > 0"> <if test="categoryIdList != null and categoryIdList.size() > 0">
<foreach collection="categoryIdList" item="id" open="AND( " separator=" OR " index="index" close=")"> <foreach collection="categoryIdList" item="id" open="AND( " separator=" OR " index="index" close=")">
id = #{id} ip.id = #{id}
</foreach> </foreach>
</if> </if>
ORDER BY ORDER BY
sort ASC ip.sort ASC
</select> </select>
<select id="selectCategoryByIssue" resultType="com.epmet.dto.IssueCategoryDTO"> <select id="selectCategoryByIssue" resultType="com.epmet.dto.IssueCategoryDTO">

Loading…
Cancel
Save