| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?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.xjrsoft.module.activity.mapper.ActivityInfoMapper">
- <select id="getPage" parameterType="com.xjrsoft.module.activity.dto.ActivityInfoPageDto" resultType="com.xjrsoft.module.activity.vo.ActivityInfoPageVo">
- SELECT t1.id,t2.name AS type_cn,t3.company_name AS enterprise_name,t1.name,t1.place,t1.start_date,t1.end_date,
- t1.type, t4.name AS org_name, t1.enroll_end_time, t1.duty_person,t1.duty_person_mobile, t1.cover_file_id,
- t1.enroll_range, t1.status,t1.content,t1.category,t4.name as org_cn,t1.org_id,
- (SELECT COUNT(*) FROM activity_enroll WHERE delete_mark = 0 AND activity_info_id = t1.id) as enroll_count FROM activity_info t1
- LEFT JOIN xjr_dictionary_detail t2 ON t1.type = t2.code
- LEFT JOIN company_coop t3 ON t1.enterprise_id = t3.id
- LEFT JOIN xjr_department t4 ON t1.org_id = t4.id
- WHERE t1.delete_mark = 0
- <if test="dto.category != null">
- and t1.category = #{dto.category}
- </if>
- <if test="dto.isEffective != null and dto.isEffective == 1">
- and (t1.status = 1 or t1.status = 2) and NOW() between t1.start_date and t1.end_date
- </if>
- <if test="dto.name != null and dto.name != ''">
- and t1.name like concat('%', #{dto.name},'%')
- </if>
- <if test="dto.type != null and dto.type != ''">
- and t1.type = #{dto.type}
- </if>
- <if test="dto.orgId != null">
- and t1.org_id = #{dto.orgId}
- </if>
- <if test="dto.status != null ">
- and t1.status = #{dto.status}
- </if>
- </select>
- <select id="getMyPage" parameterType="com.xjrsoft.module.activity.dto.ActivityInfoPageDto" resultType="com.xjrsoft.module.activity.vo.ActivityInfoPageVo">
- SELECT t1.id,t2.name AS type_cn,t3.company_name AS enterprise_name,t1.name,t1.place,t1.start_date,t1.end_date,
- t1.type, t4.name AS org_name, t1.enroll_end_time, t1.duty_person,t1.duty_person_mobile, t1.cover_file_id,
- t1.enroll_range, t1.status,t1.content,t1.category,t5.status as enroll_status,
- (SELECT COUNT(*) FROM activity_enroll WHERE delete_mark = 0 AND activity_info_id = t1.id) as enroll_count FROM activity_info t1
- LEFT JOIN xjr_dictionary_detail t2 ON t1.type = t2.code
- LEFT JOIN company_coop t3 ON t1.enterprise_id = t3.id
- LEFT JOIN xjr_department t4 ON t1.org_id = t4.id
- LEFT JOIN activity_enroll t5 ON t1.id = t5.activity_info_id
- WHERE t1.delete_mark = 0 and t5.user_id = #{dto.loginUserId}
- <if test="dto.category != null">
- and t1.category = #{dto.category}
- </if>
- <if test="dto.isEffective != null and dto.isEffective == 1">
- and (t1.status = 1 or t1.status = 2) and NOW() between t1.start_date and t1.end_date
- </if>
- </select>
- </mapper>
|