sql 报错 2
This commit is contained in:
@@ -30,43 +30,15 @@
|
||||
</select>
|
||||
|
||||
<select id="sumMoney" resultType="Double">
|
||||
select sum(money) from cash_out where state =1
|
||||
<if test="flag!=null and flag==1">
|
||||
and date_format(create_at,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="flag!=null and flag==2">
|
||||
and date_format(create_at,'%Y-%m')=date_format(#{time},'%Y-%m')
|
||||
</if>
|
||||
<if test="flag!=null and flag==3">
|
||||
and date_format(create_at,'%Y')=date_format(#{time},'%Y')
|
||||
</if>
|
||||
select sum(money) from cash_out where state = 1 and create_at between #{start} and #{end}
|
||||
</select>
|
||||
|
||||
<select id="countMoney" resultType="Integer">
|
||||
select count(*) from cash_out where
|
||||
<if test="flag!=null and flag==1">
|
||||
date_format(create_at,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="flag!=null and flag==2">
|
||||
date_format(create_at,'%Y-%m')=date_format(#{time},'%Y-%m')
|
||||
</if>
|
||||
<if test="flag!=null and flag==3">
|
||||
date_format(create_at,'%Y')=date_format(#{time},'%Y')
|
||||
</if>
|
||||
select count(*) from cash_out where create_at between #{start} and #{end}
|
||||
</select>
|
||||
|
||||
<select id="stayMoney" resultType="Integer">
|
||||
select count(*) from cash_out where
|
||||
<if test="flag!=null and flag==1">
|
||||
date_format(create_at,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
|
||||
</if>
|
||||
<if test="flag!=null and flag==2">
|
||||
date_format(create_at,'%Y-%m')=date_format(#{time},'%Y-%m')
|
||||
</if>
|
||||
<if test="flag!=null and flag==3">
|
||||
date_format(create_at,'%Y')=date_format(#{time},'%Y')
|
||||
</if>
|
||||
and state=0
|
||||
select count(*) from cash_out where create_at between #{start} and #{end} and state=0
|
||||
</select>
|
||||
|
||||
<select id="selectMayMoney" resultType="Double">
|
||||
|
||||
Reference in New Issue
Block a user