<?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.stylefeng.guns.modular.system.dao.TActivityMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TActivity">
|
<id column="id" property="id"/>
|
<result column="companyId" property="companyId"/>
|
<result column="companyType" property="companyType"/>
|
<result column="activityName" property="activityName"/>
|
<result column="cover" property="cover"/>
|
<result column="startTime" property="startTime"/>
|
<result column="endTime" property="endTime"/>
|
<result column="provinceName" property="provinceName"/>
|
<result column="provinceCode" property="provinceCode"/>
|
<result column="cityName" property="cityName"/>
|
<result column="cityCode" property="cityCode"/>
|
<result column="districtName" property="districtName"/>
|
<result column="districtCode" property="districtCode"/>
|
<result column="sortBy" property="sortBy"/>
|
<result column="content" property="content"/>
|
<result column="createTime" property="createTime"/>
|
<result column="createBy" property="createBy"/>
|
<result column="status" property="status"/>
|
</resultMap>
|
<select id="getList" resultType="com.stylefeng.guns.modular.system.model.TActivity">
|
SELECT
|
a.id,
|
a.companyId,
|
a.companyType,
|
a.activityName,
|
a.cover,
|
a.startTime,
|
a.endTime,
|
a.sortBy,
|
a.content,
|
a.createTime,
|
a.createBy,
|
a.status,
|
ta.provinceName,
|
ta.provinceCode,
|
ta.cityName,
|
ta.cityCode,
|
ta.areaName,
|
ta.areaCode
|
,tbo.branchOfficeName
|
FROM t_activity a
|
LEFT JOIN t_activity_area ta on a.id = ta.activityId
|
LEFT JOIN t_branch_office tbo on a.companyId = tbo.id
|
<where>
|
<if test="beginTime != null and endTime != null">
|
and a.createTime between #{beginTime} and #{endTime}
|
</if>
|
<if test="objectId != null and objectId != 1">
|
and a.companyId = #{objectId}
|
</if>
|
<if test="roleType !=null and roleType != 1">
|
and a.companyType = #{roleType}
|
</if>
|
<if test="branchOfficeName != null and branchOfficeName != ''">
|
and tbo.branchOfficeName like concat('%',#{branchOfficeName},'%')
|
</if>
|
<if test="provinceCode != null and provinceCode != ''">
|
and ta.provinceCode = #{provinceCode}
|
</if>
|
<if test="activityName != null and activityName != ''">
|
and a.activityName like concat('%', #{activityName},'%')
|
</if>
|
<if test="cityCode != null and cityCode != ''">
|
and ta.cityCode = #{cityCode}
|
</if>
|
<if test="areaCode != null and areaCode != ''">
|
and ta.areaCode = #{areaCode}
|
</if>
|
<if test="status != null and status == 1">
|
and a.status = 1
|
</if>
|
<if test="status != null and status == 3">
|
and a.status = 3
|
</if>
|
<if test="status != null and status == 4">
|
and a.status = 2 and a.startTime >= now()
|
</if>
|
<if test="status != null and status == 5">
|
and a.status = 2 and a.startTime < now() and a.endTime >= now()
|
</if>
|
<if test="status != null and status == 6">
|
and a.status = 2 and a.endTime < now()
|
</if>
|
AND a.isDelete = 0
|
</where>
|
group by a.id
|
</select>
|
|
|
</mapper>
|