<?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.DriverActivityRegisteredMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.DriverActivityRegistered">
|
<id column="id" property="id"/>
|
<result column="companyId" property="companyId"/>
|
<result column="driverActivityId" property="driverActivityId"/>
|
<result column="type" property="type"/>
|
<result column="money" property="money"/>
|
<result column="startTime" property="startTime"/>
|
<result column="endTime" property="endTime"/>
|
<result column="insertTime" property="insertTime"/>
|
</resultMap>
|
|
|
|
<select id="query" resultType="map">
|
select
|
a.id as id,
|
CONCAT('邀请', if(a.`type` = 1, '司机', '用户'), '注册奖励', a.money, '元') as content,
|
a.money as money
|
from t_driver_activity_registered a
|
left join t_driver_activity b on (a.driverActivityId = b.id)
|
where now() between a.startTime and a.endTime and a.companyId = #{companyId} and a.`type` = #{type} and b.status = 3
|
</select>
|
</mapper>
|