94 lines
4.9 KiB
XML
94 lines
4.9 KiB
XML
<?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.ruoyi.cms.mapper.JobFairMapper">
|
|
|
|
<resultMap type="JobFair" id="JobFairResult">
|
|
<result property="jobFairId" column="job_fair_id" />
|
|
<result property="name" column="name" />
|
|
<result property="jobFairType" column="job_fair_type" />
|
|
<result property="location" column="location" />
|
|
<result property="latitude" column="latitude" />
|
|
<result property="longitude" column="longitude" />
|
|
<result property="startTime" column="start_time" />
|
|
<result property="endTime" column="end_time" />
|
|
<result property="delFlag" column="del_flag" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="remark" column="remark" />
|
|
<result property="description" column="description" />
|
|
<result property="address" column="address" />
|
|
</resultMap>
|
|
|
|
<sql id="selectJobFairVo">
|
|
select job_fair_id, name, job_fair_type, location, latitude, longitude, start_time, end_time, del_flag, create_by, create_time, update_by, update_time, remark,address,description from job_fair
|
|
</sql>
|
|
|
|
<select id="selectJobFairList" parameterType="JobFair" resultMap="JobFairResult">
|
|
<include refid="selectJobFairVo"/>
|
|
<where> del_flag = '0'
|
|
<if test="name != null and name != ''"> and name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
|
|
<if test="jobFairType != null and jobFairType != ''"> and job_fair_type = #{jobFairType}</if>
|
|
<if test="location != null and location != ''"> and location = #{location}</if>
|
|
<if test="latitude != null "> and latitude = #{latitude}</if>
|
|
<if test="longitude != null "> and longitude = #{longitude}</if>
|
|
<if test="startTime != null "> and start_time = #{startTime}</if>
|
|
<if test="endTime != null "> and end_time = #{endTime}</if>
|
|
</where>
|
|
</select>
|
|
<select id="appList" resultType="com.ruoyi.cms.domain.JobFair" parameterType="com.ruoyi.cms.domain.JobFair">
|
|
<include refid="selectJobFairVo"/>
|
|
<where> del_flag = '0'
|
|
<if test="jobFairType != null and jobFairType != ''"> and job_fair_type = #{jobFairType}</if>
|
|
<if test="queryDate != null "> and start_time >= #{queryDate} and end_time <= #{queryDate}</if>
|
|
</where>
|
|
</select>
|
|
<select id="selectAppList" resultType="com.ruoyi.cms.domain.JobFair">
|
|
select j.*
|
|
from job_fair as j
|
|
inner join fair_collection as f on f.fair_id = j.job_fair_id and f.USER_ID = #{userId}
|
|
where j.DEL_FLAG = '0' and f.DEL_FLAG = '0'
|
|
<if test="type!=null and type==1">
|
|
-- 未开始
|
|
and j.START_TIME > now()
|
|
</if>
|
|
<if test="type!=null and type==2">
|
|
-- 进行中
|
|
and j.START_TIME < NOW() AND J.END_TIME > NOW()
|
|
</if>
|
|
<if test="type!=null and type==3">
|
|
-- 已结束
|
|
and j.END_TIME < now()
|
|
</if>
|
|
order by j.START_TIME desc
|
|
</select>
|
|
|
|
<select id="getCurrentQuarterFairs" resultType="com.ruoyi.cms.domain.JobFair" parameterType="com.ruoyi.cms.domain.JobFair">
|
|
<include refid="selectJobFairVo"/>
|
|
<where>
|
|
del_flag = '0'
|
|
AND NOW() BETWEEN start_time AND end_time
|
|
AND EXTRACT(QUARTER FROM start_time) = EXTRACT(QUARTER FROM NOW())
|
|
AND EXTRACT(YEAR FROM start_time) = EXTRACT(YEAR FROM NOW())
|
|
<if test="jobFairType != null and jobFairType != ''"> and job_fair_type = #{jobFairType}</if>
|
|
<if test="name != null and name != ''"> and name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
|
|
</where>
|
|
ORDER BY start_time DESC
|
|
</select>
|
|
|
|
<select id="getCurrentMonthFairs" resultType="com.ruoyi.cms.domain.JobFair" parameterType="com.ruoyi.cms.domain.JobFair">
|
|
<include refid="selectJobFairVo"/>
|
|
<where>
|
|
del_flag = '0'
|
|
AND NOW() BETWEEN start_time AND end_time
|
|
AND EXTRACT(MONTH FROM start_time) = EXTRACT(MONTH FROM NOW())
|
|
AND EXTRACT(YEAR FROM start_time) = EXTRACT(YEAR FROM NOW())
|
|
<if test="jobFairType != null and jobFairType != ''"> and job_fair_type = #{jobFairType}</if>
|
|
<if test="name != null and name != ''"> and name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
|
|
</where>
|
|
ORDER BY start_time DESC
|
|
</select>
|
|
</mapper> |