|
|
@ -3,16 +3,17 @@ |
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
|
<mapper namespace="com.example.demo.mapper.ConsumeMapper"> |
|
|
|
<select id="getSumConsume" resultMap="com.example.demo.domain.vo.SumConsume"> |
|
|
|
<select id="getSumConsume" resultType="com.example.demo.domain.vo.SumConsume"> |
|
|
|
SELECT |
|
|
|
sum(free_coin) as SumFcion, |
|
|
|
sum(task_coin) as SumTcion, |
|
|
|
sum(recharge_coin) as SumRcion, |
|
|
|
sum(recharge_coin+free_coin+task_coin) as Sumcion |
|
|
|
from detail_y |
|
|
|
left join product on detail_y.product_id= product.product_id |
|
|
|
<where> |
|
|
|
// `detail_flag`=1 AND update_type = '1' |
|
|
|
update_type=1 |
|
|
|
<if test='jwcode!=null'>and detail_y.jwcode =#{jwcode}</if> |
|
|
|
update_type = '1' |
|
|
|
<if test='jwcode!=null and jwcode.length>0'>and detail_y.jwcode =#{jwcode}</if> |
|
|
|
<if test='productName!=null and productName.length>0'>and product.name = #{productName}</if> |
|
|
|
<if test='consumePlatform!=null and consumePlatform.length>0'>and detail_y.consume_platform=#{consumePlatform}</if> |
|
|
|
<if test='consumeType!=null and consumeType.length>0'>and detail_y.consume_type= #{consumeType}</if> |
|
|
|