<?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.TCheckCarActivityMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TCheckCarActivity">
|
<id column="id" property="id" />
|
<result column="name" property="name" />
|
<result column="startTime" property="startTime" />
|
<result column="endTime" property="endTime" />
|
<result column="phone" property="phone" />
|
<result column="address" property="address" />
|
<result column="branchOfficeId" property="branchOfficeId" />
|
<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="couponName" property="couponName" />
|
<result column="couponNum" property="couponNum" />
|
<result column="receivedNum" property="receivedNum" />
|
<result column="couponAmount" property="couponAmount" />
|
<result column="duration" property="duration" />
|
<result column="explainContent" property="explainContent" />
|
<result column="auditStatus" property="auditStatus" />
|
<result column="rejectReason" property="rejectReason" />
|
<result column="auditTime" property="auditTime" />
|
<result column="pauseFlag" property="pauseFlag" />
|
<result column="qrCode" property="qrCode" />
|
<result column="createTime" property="createTime" />
|
<result column="updateTime" property="updateTime" />
|
<result column="createBy" property="createBy" />
|
<result column="updateBy" property="updateBy" />
|
<result column="isDelete" property="isDelete" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, name, startTime, endTime, phone, address, branchOfficeId, provinceName, provinceCode, cityName, cityCode, districtName, districtCode, couponName, couponNum, receivedNum, couponAmount, duration, explainContent, auditStatus, rejectReason, auditTime, pauseFlag, qrCode, createTime, updateTime, createBy, updateBy, isDelete
|
</sql>
|
<select id="getOrderList" resultType="com.stylefeng.guns.modular.system.model.TCheckCarActivity">
|
SELECT tcac.id,
|
tcac.name,
|
tcac.startTime,
|
tcac.endTime,
|
tcac.branchOfficeId,
|
tcac.provinceName,
|
tcac.provinceCode,
|
tcac.cityName,
|
tcac.cityCode,
|
tcac.districtName,
|
tcac.districtCode,
|
tcac.couponName,
|
tcac.couponNum,
|
tcac.receivedNum,
|
tcac.couponAmount,
|
tcac.duration,
|
tcac.explainContent,
|
tcac.auditStatus,
|
tcac.rejectReason,
|
tcac.auditTime,
|
tcac.pauseFlag,
|
tcac.qrCode,
|
tcac.createTime,
|
tcac.updateTime,
|
tcac.createBy,
|
tcac.updateBy,
|
tcac.isDelete,
|
tbo.branchOfficeName
|
FROM t_check_car_activity tcac
|
LEFT JOIN t_branch_office tbo ON tcac.branchOfficeId = tbo.id
|
<where>
|
<if test="beginTime != null and endTime != null">
|
and tcac.createTime between #{beginTime} and #{endTime}
|
</if>
|
<if test="objectId != null and roleType != 1">
|
and tcac.branchOfficeId = #{objectId}
|
</if>
|
<if test="branchOfficeName != null and branchOfficeName != ''">
|
and tbo.branchOfficeName like concat('%',#{branchOfficeName},'%')
|
</if>
|
<if test="provinceCode != null and provinceCode != ''">
|
and tcac.provinceCode = #{provinceCode}
|
</if>
|
<if test="name != null and name != ''">
|
and tcac.name like concat('%', #{name},'%')
|
</if>
|
<if test="cityCode != null and cityCode != ''">
|
and tcac.cityCode = #{cityCode}
|
</if>
|
<if test="areaCode != null and areaCode != ''">
|
and tcac.areaCode = #{areaCode}
|
</if>
|
<if test="status != null and status == 1">
|
and tcac.auditStatus = 0
|
</if>
|
<if test="status != null and status == 2">
|
and tcac.auditStatus = 2
|
</if>
|
<if test="status != null and status == 3">
|
and tcac.auditStatus = 1 and tcac.startTime >= now()
|
</if>
|
<if test="status != null and status == 4">
|
and tcac.auditStatus = 1 and tcac.startTime < now() and tcac.endTime >= now()
|
</if>
|
<if test="status != null and status == 5">
|
and tcac.auditStatus = 1 and tcac.startTime < now() and tcac.endTime >= now() and tcac.pauseFlag = 1
|
</if>
|
<if test="status != null and status == 6">
|
and tcac.auditStatus = 1 and tcac.endTime < now()
|
</if>
|
AND tcac.isDelete = 0
|
</where>
|
ORDER BY tcac.createTime DESC
|
</select>
|
|
</mapper>
|