[AppleScript] 纯文本查看 复制代码
<!‐‐根据日期统计预约数‐‐>
<select id="findOrderCountByDate" parameterType="string"
resultType="int">
select count(id) from t_order where orderDate = #{value}
</select>
<!‐‐根据日期统计预约数,统计指定日期之后的预约数‐‐>
<select id="findOrderCountAfterDate" parameterType="string"
resultType="int">
select count(id) from t_order where orderDate >= #{value}
</select>
<!‐‐根据日期统计到诊数‐‐>
<select id="findVisitsCountByDate" parameterType="string"
resultType="int">
select count(id) from t_order where orderDate = #{value} and
orderStatus = '已到诊'
</select>
<!‐‐根据日期统计到诊数,统计指定日期之后的到诊数‐‐>
<select id="findVisitsCountAfterDate" parameterType="string"
resultType="int">
select count(id) from t_order where orderDate >= #{value} and
orderStatus = '已到诊'
</select>
<!‐‐热门套餐,查询前4条‐‐>
<select id="findHotSetmeal" resultType="map">
select
s.name,
count(o.id) setmeal_count ,
count(o.id)/(select count(id) from t_order) proportion
from t_order o inner join t_setmeal s on s.id = o.setmeal_id
group by o.setmeal_id
order by setmeal_count desc
limit 0,4
</select>