1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?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.DegreeMapper">
-
- <select id="selectPage" resultType="com.ym.mec.biz.dal.entity.Degree">
- SELECT
- t.*
- FROM degree t
- <where>
- <if test="param.keyword != null and param.keyword != ''">
- AND (t.name_ LIKE CONCAT('%',#{param.keyword},'%') OR t.id_ LIKE CONCAT('%',#{param.keyword},'%'))
- </if>
- <if test="param.startTime !=null and param.endTime != null">
- and t.start_time_ <= #{param.endTime} and t.end_time_ >= #{param.startTime}
- </if>
- <if test="param.status != null">
- and t.status_ = #{param.status}
- </if>
- <if test="param.tenantId != null">
- and t.tenant_id_ = #{param.tenantId}
- </if>
- <if test="param.organId != null">
- AND FIND_IN_SET(#{param.organId},t.organ_ids_)
- </if>
- <if test="param.degreeStatuses != null">
- AND t.status_ IN (<foreach collection="param.degreeStatuses" separator="," item="item">#{item}</foreach>)
- </if>
- </where>
- </select>
- <update id="degreeStatusChange">
- UPDATE degree SET status_ =
- case
- when start_time_ < now() and end_time_ > now() then 'START'
- when end_time_ <= now() then 'END'
- else 'NOT_START'
- end
- WHERE status_ != 'END' and start_time_ < now()
- </update>
- </mapper>
|