<?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="cc.mrbird.febs.dapp.mapper.IgtOnHookPlanOrderDao">
|
|
<select id="selectByState" resultType="cc.mrbird.febs.dapp.entity.IgtOnHookPlanOrder">
|
SELECT
|
a.*
|
FROM igt_on_hook_plan_order a
|
where a.state = #{state}
|
</select>
|
|
<update id="updateAvaAmountById">
|
update igt_on_hook_plan_order
|
set
|
ava_amount = ava_amount - #{amount},
|
where
|
id = #{id}
|
and ava_amount - #{amount} <![CDATA[ >= ]]> 0
|
</update>
|
|
<select id="selectByMemberId" resultType="cc.mrbird.febs.dapp.entity.IgtOnHookPlanOrder">
|
SELECT
|
a.*
|
FROM igt_on_hook_plan_order a
|
where a.member_id = #{memberId}
|
and a.state = 1
|
order by id desc
|
limit 1
|
</select>
|
|
<update id="AddProfitById">
|
update igt_on_hook_plan_order
|
set
|
profit = profit + #{profit}
|
where
|
id = #{id}
|
</update>
|
|
<select id="selectSumProfitByMemberId" resultType="java.math.BigDecimal">
|
SELECT
|
ifnull(sum(a.profit),0)
|
FROM igt_on_hook_plan_order a
|
where a.member_id = #{memberId}
|
</select>
|
|
<select id="selectByCreateTime" resultType="cc.mrbird.febs.dapp.entity.IgtOnHookPlanOrder">
|
SELECT
|
a.*
|
FROM igt_on_hook_plan_order a
|
where and date_format(a.create_time, '%Y-%m-%d') = #{createTime}
|
</select>
|
|
</mapper>
|