DegreeNewsMapper.xml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.ym.mec.biz.dal.mapper.DegreeNewsMapper">
  4. <select id="selectPage" resultType="com.ym.mec.biz.dal.vo.DegreeNewsVo">
  5. select dn.*,GROUP_CONCAT(distinct o.name_) organNames from degree_news dn
  6. left join organization o ON FIND_IN_SET(o.id_,dn.organ_ids_)
  7. <where>
  8. <if test="param.keyword != null and param.keyword != ''">
  9. AND dn.title_ LIKE CONCAT('%',#{param.keyword},'%')
  10. </if>
  11. <if test="param.type != null">
  12. AND dn.type_ = #{param.type}
  13. </if>
  14. <if test="param.status != null">
  15. AND dn.status_ = #{param.status}
  16. </if>
  17. <if test="param.tenantId != null">
  18. AND dn.tenant_id_ = #{param.tenantId}
  19. </if>
  20. <if test="param.organId != null">
  21. AND (FIND_IN_SET(#{param.organId},dn.organ_ids_) OR dn.organ_ids_ IS NULL OR dn.organ_ids_ = '')
  22. </if>
  23. <if test="param.organId == null and param.defaultOrganId != null and param.defaultOrganId != ''">
  24. AND (INTE_ARRAY(#{param.defaultOrganId},dn.organ_ids_) OR dn.organ_ids_ IS NULL OR dn.organ_ids_ = '')
  25. </if>
  26. </where>
  27. group by dn.id_
  28. <choose>
  29. <when test="param.sortedTime != null">ORDER BY dn.update_time_ DESC</when>
  30. <otherwise>ORDER BY dn.id_ DESC</otherwise>
  31. </choose>
  32. </select>
  33. </mapper>