| | |
| | | cb.status_cd=#{statusCd}, |
| | | cb.finish_time=#{finishTime} |
| | | where cb.b_id in (#{bId}) |
| | | and cb.status_cd not in ('D','E') |
| | | and cb.status_cd not in ('E') |
| | | ]]> |
| | | </update> |
| | | <!-- 当所有业务动作是否都是C,将订单信息改为 C--> |
| | | <update id="completeOrderByBId" parameterType="String" > |
| | | <![CDATA[ |
| | | update c_orders co set co.status_cd = 'C' where co.status='S' |
| | | update c_orders co set co.status_cd = 'C' where co.status_cd='S' |
| | | and not exists( |
| | | select 1 from c_business cb where cb.status_cd <> 'C' |
| | | and cb.o_id = co.o_id |
| | |
| | | and cb.b_id = #{bId} |
| | | ) |
| | | ]]> |
| | | </select> |
| | | <!-- 根据 OID 查询 business --> |
| | | <select id="getBusinessByOId" parameterType="map" resultType="map"> |
| | | SELECT co.`o_id`,co.`app_id`,co.`order_type_cd`,co.`user_id`,cb.`business_type_cd`,cb.`b_id`,cb.`status_cd` |
| | | FROM c_orders co,c_business cb |
| | | WHERE co.`o_id` = cb.`o_id` |
| | | AND cb.`business_type_cd` NOT IN ('DO') |
| | | <if test="statusCd != null and statusCd != ''"> |
| | | AND cb.`status_cd` = #{statusCd} |
| | | </if> |
| | | <if test="oId != null and oId != ''"> |
| | | AND co.`o_id` = #{oId} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getDeleteOrderBusinessByOId" parameterType="String" resultType="Map"> |
| | | <![CDATA[ |
| | | select cb.b_id,cb.o_id,cb.business_type_cd,cb.status_cd from c_orders co,c_business cb where co.o_id = cb.o_id and cb.business_type_cd = 'DO' and cb.status_cd = 'DO' |
| | | and co.o_id = #{oId} |
| | | ]]> |
| | | </select> |
| | | |
| | | <!-- 获取同个订单中已经完成的订单项--> |
| | |
| | | ]]> |
| | | </select> |
| | | |
| | | <select id="judgeAllBusinessCompleted" parameterType="map" resultType="map"> |
| | | SELECT co.* FROM c_orders co WHERE co.`o_id` = #{oId} and not exists ( |
| | | SELECT 1 FROM c_business cb WHERE cb.`o_id` = co.`o_id` |
| | | AND cb.`status_cd` NOT IN (#{statusCd}) |
| | | ) |
| | | AND NOT EXISTS ( |
| | | SELECT 1 FROM c_business cbs WHERE cbs.`o_id` =co.`o_id` |
| | | AND cbs.`business_type_cd` = 'DO' |
| | | ) |
| | | AND co.`status_cd` NOT IN ('D','C','E') |
| | | </select> |
| | | |
| | | <select id="judgeAllBusinessDeleteOrder" parameterType="map" resultType="map"> |
| | | SELECT co.* FROM c_orders co WHERE co.`o_id` = #{oId} and not exists ( |
| | | SELECT 1 FROM c_business cb WHERE cb.`o_id` = co.`o_id` |
| | | AND cb.`status_cd` NOT IN (#{statusCd}) |
| | | ) |
| | | AND EXISTS ( |
| | | SELECT 1 FROM c_business cbs WHERE cbs.`o_id` =co.`o_id` |
| | | AND cbs.`business_type_cd` = 'DO' |
| | | ) |
| | | AND co.`status_cd` NOT IN ('C') |
| | | </select> |
| | | |
| | | </mapper> |