|
|
|
@ -39,42 +39,41 @@
|
|
|
|
|
where submit_user_id = #{userId}) t3
|
|
|
|
|
on t3.submitKnowledgeId = t1.id
|
|
|
|
|
</if>
|
|
|
|
|
<where>
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="status == null">
|
|
|
|
|
-- 如果为空,是查全部通过的
|
|
|
|
|
and ( status = 2)
|
|
|
|
|
</when>
|
|
|
|
|
<when test="status == 1">
|
|
|
|
|
-- 如果是1,只查自己的草稿
|
|
|
|
|
and ( draft_belong_user_id = #{userId} and status = 1)
|
|
|
|
|
</when>
|
|
|
|
|
<when test="status == 9">
|
|
|
|
|
and ( status in (10,11,12) and t3.submitKnowledgeId is not null)
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
and ( status = #{status} and t3.submitKnowledgeId is not null )
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
<if test="title != null and title != ''">
|
|
|
|
|
and title like concat('%',#{title},'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="publishDeptId != null and publishDeptId != ''">
|
|
|
|
|
and publish_dept_id = #{publishDeptId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="baseId != null and baseId != ''">
|
|
|
|
|
and base_id = #{baseId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="submittedDeptId != null and submittedDeptId != ''">
|
|
|
|
|
and submitted_dept_id = #{submittedDeptId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="publishDateBegin != null and publishDateBegin != ''">
|
|
|
|
|
and create_time <![CDATA[ >= ]]> #{publishDateBegin}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="publishDateEnd != null and publishDateEnd != ''">
|
|
|
|
|
and create_time <![CDATA[ <= ]]> #{publishDateEnd}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
where 1 = 1
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="status == null">
|
|
|
|
|
-- 如果为空,是查全部通过的
|
|
|
|
|
and ( status = 2)
|
|
|
|
|
</when>
|
|
|
|
|
<when test="status == 1">
|
|
|
|
|
-- 如果是1,只查自己的草稿
|
|
|
|
|
and ( draft_belong_user_id = #{userId} and status = 1)
|
|
|
|
|
</when>
|
|
|
|
|
<when test="status == 9">
|
|
|
|
|
and ( status in (10,11,12) and t3.submitKnowledgeId is not null)
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
and ( status = #{status} and t3.submitKnowledgeId is not null )
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
<if test="title != null and title != ''">
|
|
|
|
|
and title like concat('%',#{title},'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="publishDeptId != null and publishDeptId != ''">
|
|
|
|
|
and publish_dept_id = #{publishDeptId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="baseId != null and baseId != ''">
|
|
|
|
|
and base_id = #{baseId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="submittedDeptId != null and submittedDeptId != ''">
|
|
|
|
|
and submitted_dept_id = #{submittedDeptId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="publishDateBegin != null and publishDateBegin != ''">
|
|
|
|
|
and create_time <![CDATA[ >= ]]> #{publishDateBegin}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="publishDateEnd != null and publishDateEnd != ''">
|
|
|
|
|
and create_time <![CDATA[ <= ]]> #{publishDateEnd}
|
|
|
|
|
</if>
|
|
|
|
|
order by create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|