|
@@ -16,15 +16,17 @@
|
|
|
|
|
|
<select id="getAllDeptInfo" resultType="com.diagbot.dto.GetDeptInfoDTO">
|
|
|
SELECT
|
|
|
- DISTINCT a.id,a.gmt_create,b.gmt_modified,b.creator,b.modifier,a.`name`,a.remark
|
|
|
+ a.id,a.gmt_create,b.gmt_modified,b.creator,b.modifier,a.`name`,a.remark,c.type
|
|
|
FROM
|
|
|
`icss_dept_info` a
|
|
|
LEFT JOIN icss_question_usual b ON a.id = b.dept_id
|
|
|
+ LEFT JOIN icss_question_info c ON b.question_id = c.id
|
|
|
WHERE
|
|
|
- a.is_deleted = 'N' AND b.is_deleted = 'N'
|
|
|
+ a.is_deleted = 'N' AND b.is_deleted = 'N' AND c.is_deleted = 'N'
|
|
|
<if test="name != null and name != ''">
|
|
|
AND a.`name` LIKE CONCAT('%',#{name},'%')
|
|
|
</if>
|
|
|
+ GROUP BY a.id,c.type
|
|
|
ORDER BY
|
|
|
b.gmt_modified DESC
|
|
|
</select>
|