| | |
| | | group by a.id |
| | | order by a.receiving_time desc, a.id desc |
| | | </select> |
| | | |
| | | <select id="selectOrderStatusCount" resultType="com.xzx.gc.order.vo.JhyStatusCountVo"> |
| | | select |
| | | status, |
| | | count(1) cnt |
| | | from xzx_jhy_order |
| | | <where> |
| | | status=1 |
| | | <if test="type == 2"> |
| | | and user_id=#{userId} |
| | | </if> |
| | | </where> |
| | | group by status |
| | | union all |
| | | select |
| | | status, |
| | | count(1) cnt |
| | | from xzx_jhy_order |
| | | <where> |
| | | <if test="type == 1"> |
| | | and jhy_id=#{userId} |
| | | </if> |
| | | <if test="type == 2" > |
| | | and user_id=#{userId} |
| | | </if> |
| | | </where> |
| | | group by status |
| | | </select> |
| | | |
| | | <select id="selectJhyOrderListByStatus" resultType="com.xzx.gc.entity.JhyOrder"> |
| | | select * from xzx_jhy_order |
| | | where user_id=#{userId} and status in |
| | | <foreach collection="list" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="selectJhyOrderNoWaitAndCancel" resultType="com.xzx.gc.entity.JhyOrder"> |
| | | select * from xzx_jhy_order |
| | | where status not in (1, 5) |
| | | </select> |
| | | </mapper> |