2025-09-22 17:06:47 +08:00
|
|
|
<?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.JobCollectionMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="JobCollection" id="JobCollectionResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="jobId" column="job_id" />
|
|
|
|
|
<result property="userId" column="user_id" />
|
|
|
|
|
<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" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectJobCollectionVo">
|
|
|
|
|
select id, job_id, user_id, del_flag, create_by, create_time, update_by, update_time, remark from job_collection
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectJobCollectionList" parameterType="JobCollection" resultMap="JobCollectionResult">
|
|
|
|
|
<include refid="selectJobCollectionVo"/>
|
2025-09-24 10:49:59 +08:00
|
|
|
<where> del_flag = '0'
|
2025-09-22 17:06:47 +08:00
|
|
|
<if test="jobId != null "> and job_id = #{jobId}</if>
|
|
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="collectionJob" resultType="com.ruoyi.cms.domain.Job">
|
2025-11-18 10:41:20 +08:00
|
|
|
select j.* from job j
|
|
|
|
|
JOIN ( SELECT job_id, MAX(create_time) as collect_time
|
|
|
|
|
FROM job_collection
|
|
|
|
|
where del_flag = '0' and user_id = #{userId}
|
|
|
|
|
GROUP BY job_id ) as c on j.job_id = c.job_id
|
|
|
|
|
where j.del_flag = '0' and j.is_publish = 1
|
|
|
|
|
ORDER BY c.collect_time desc
|
2025-09-22 17:06:47 +08:00
|
|
|
</select>
|
2025-11-01 16:01:10 +08:00
|
|
|
|
|
|
|
|
<select id="selectJobCollectionListJob" parameterType="JobCollection" resultType="com.ruoyi.cms.domain.Job">
|
2025-11-03 18:37:33 +08:00
|
|
|
select b.*,a.create_time as shareTime,1 AS isCollection from job_collection a inner join job b on a.job_id=b.job_id and b.del_flag='0'
|
2025-11-01 16:01:10 +08:00
|
|
|
<where> a.del_flag = '0'
|
|
|
|
|
<if test="jobId != null "> and a.job_id = #{jobId}</if>
|
|
|
|
|
<if test="userId != null "> and a.user_id = #{userId}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
2025-09-22 17:06:47 +08:00
|
|
|
</mapper>
|