<?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.DriverActivityEachReturnMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.DriverActivityEachReturn">
|
<id column="id" property="id" />
|
<result column="name" property="name" />
|
<result column="companyId" property="companyId" />
|
<result column="start" property="start" />
|
<result column="end" property="end" />
|
<result column="money" property="money" />
|
<result column="startTime" property="startTime" />
|
<result column="endTime" property="endTime" />
|
<result column="insertTime" property="insertTime" />
|
<result column="state" property="state" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, name, companyId, start, end, money, startTime, endTime, insertTime, state
|
</sql>
|
<sql id="Base_Column_page">
|
a.id, a.name, a.companyId, a.start, a.end, a.money, a.startTime, a.endTime, a.insertTime, a.state,
|
b.name as companyName
|
</sql>
|
|
<select id="findPage" parameterType="com.baomidou.mybatisplus.plugins.Page" resultType="map">
|
select
|
<include refid="Base_Column_page" />
|
from t_driver_activity_each_return a
|
left join t_company b on a.companyId=b.id
|
</select>
|
|
<select id="updateStateById">
|
update
|
t_driver_activity_each_return
|
set state=#{state}
|
where id=#{driverActivityEachReturnId}
|
</select>
|
|
<select id="selectSettlementActivity" resultType="com.stylefeng.guns.modular.system.model.DriverActivityEachReturn">
|
select
|
<include refid="Base_Column_List" />
|
from t_driver_activity_each_return
|
where state=1
|
and to_days(now()) <![CDATA[ >= ]]> to_days(startTime)
|
and to_days(now())-to_days(endTime) <![CDATA[ <= ]]> 1
|
</select>
|
|
</mapper>
|