| 1234567891011121314151617181920212223242526272829303132333435 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.ym.mec.biz.dal.mapper.DegreeNewsMapper">
-
- <select id="selectPage" resultType="com.ym.mec.biz.dal.vo.DegreeNewsVo">
- select dn.*,GROUP_CONCAT(distinct o.name_) organNames from degree_news dn
- left join organization o ON FIND_IN_SET(o.id_,dn.organ_ids_)
- <where>
- <if test="param.keyword != null and param.keyword != ''">
- AND dn.title_ LIKE CONCAT('%',#{param.keyword},'%')
- </if>
- <if test="param.type != null">
- AND dn.type_ = #{param.type}
- </if>
- <if test="param.status != null">
- AND dn.status_ = #{param.status}
- </if>
- <if test="param.tenantId != null">
- AND dn.tenant_id_ = #{param.tenantId}
- </if>
- <if test="param.organId != null">
- AND (FIND_IN_SET(#{param.organId},dn.organ_ids_) OR dn.organ_ids_ IS NULL OR dn.organ_ids_ = '')
- </if>
- <if test="param.organId == null and param.defaultOrganId != null and param.defaultOrganId != ''">
- AND (INTE_ARRAY(#{param.defaultOrganId},dn.organ_ids_) OR dn.organ_ids_ IS NULL OR dn.organ_ids_ = '')
- </if>
- </where>
- group by dn.id_
- <choose>
- <when test="param.sortedTime != null">ORDER BY dn.update_time_ DESC</when>
- <otherwise>ORDER BY dn.id_ DESC</otherwise>
- </choose>
- </select>
-
- </mapper>
|