| | |
| | | <mapper namespace="centerServiceDAOImpl"> |
| | | |
| | | <!--保存订单信息 c_orders 中 --> |
| | | <insert id="saveOrder" parameterType="map"> |
| | | <insert id="saveOrder" parameterType="Map"> |
| | | <![CDATA[ |
| | | insert into c_orders(o_id,app_id,ext_transaction_id,user_id,request_time,order_type_cd,remark,status_cd) |
| | | values(#{oId},#{appId},#{extTransactionId},#{userId},#{requestTime},#{orderTypeCd},#{remark},#{statusCd}) |
| | | ]]> |
| | | </insert> |
| | | <!-- 保存属性信息c_orders_attrs 中--> |
| | | <insert id="saveOrderAttrs" parameterType="map"> |
| | | <insert id="saveOrderAttrs" parameterType="Map"> |
| | | <![CDATA[ |
| | | insert into c_orders_attrs(o_id,attr_id,spec_cd,value) |
| | | values(#{oId},#{attrId},#{specCd},#{value}) |
| | | ]]> |
| | | </insert> |
| | | <!-- 保存订单项信息 c_business --> |
| | | <insert id="saveBusiness" parameterType="map"> |
| | | <insert id="saveBusiness" parameterType="Map"> |
| | | <![CDATA[ |
| | | insert into c_business(b_id,o_id,business_type_cd,remark,status_cd) |
| | | values(#{bId},#{oId},#{businessTypeCd},#{remark},#{statusCd}) |
| | | ]]> |
| | | </insert> |
| | | <!-- 保存属性信息 c_business_attrs --> |
| | | <insert id="saveBusinessAttrs" parameterType="map"> |
| | | <insert id="saveBusinessAttrs" parameterType="Map"> |
| | | <![CDATA[ |
| | | insert into c_business_attrs(b_id,attr_id,spec_cd,value) |
| | | values(#{bId},#{attrId},#{specCd},#{value}) |
| | | ]]> |
| | | </insert> |
| | | <!-- 更新订单信息(一般就更新订单状态) --> |
| | | <update id="updateOrder" parameterType="map" > |
| | | <update id="updateOrder" parameterType="Map" > |
| | | <![CDATA[ |
| | | update c_orders co set |
| | | co.status_cd=#{statusCd}, |
| | |
| | | ]]> |
| | | </update> |
| | | <!-- 更新订单项信息(一般就更新订单项状态)--> |
| | | <update id="updateBusiness" parameterType="map"> |
| | | <update id="updateBusiness" parameterType="Map"> |
| | | <![CDATA[ |
| | | update c_business cb set |
| | | cb.status_cd=#{statusCd}, |
| | |
| | | where cb.o_id=#{oId} |
| | | ]]> |
| | | </update> |
| | | <!--根据bId 修改业务项信息--> |
| | | <update id="updateBusinessByBId" parameterType="Map"> |
| | | <![CDATA[ |
| | | update c_business cb set |
| | | cb.status_cd=#{statusCd}, |
| | | cb.finish_time=#{finishTime} |
| | | where cb.b_id in (#{bId}) |
| | | and cb.status_cd not in ('D','E') |
| | | ]]> |
| | | </update> |
| | | <!-- 当所有业务动作是否都是C,将订单信息改为 C--> |
| | | <update id="completeOrderByBId" parameterType="String" > |
| | | <![CDATA[ |
| | | update c_orders co set co.status_cd = 'C' where co.status='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 in (#{bId}) |
| | | ) |
| | | ]]> |
| | | </update> |
| | | |
| | | <select id="getOrderInfoByBId" parameterType="String" resultType="Map"> |
| | | <![CDATA[ |
| | | select co.* from c_orders co where 1 = 1 and exists |
| | | ( |
| | | select 1 from c_business cb where cb.o_id = co.o_id |
| | | and cb.b_id = #{bId} |
| | | ) |
| | | ]]> |
| | | </select> |
| | | |
| | | <!-- 获取同个订单中已经完成的订单项--> |
| | | <select id="getCommonOrderCompledBusinessByBId" parameterType="String" resultType="Map"> |
| | | <![CDATA[ |
| | | select * from c_business cb where cb.finish_time is not null |
| | | and cb.o_id in ( |
| | | select cb1.o_id from c_business cb1 where cb1.b_id = #{bId} |
| | | ) |
| | | ]]> |
| | | </select> |
| | | <!--查询 所有有效 app信息--> |
| | | <select id="getAppRouteAndServiceInfoAll" resultType="Map"> |
| | | <![CDATA[ |
| | | SELECT ca.app_id,ca.name,ca.security_code,ca.while_list_ip,ca.black_list_ip,cr.invoke_limit_times, |
| | | cr.order_type_cd,cs.service_id,cs.business_type_cd,cs.invoke_model, |
| | | cs.messageQueueName,cs.method,cs.name,cs.provide_app_id,cs.retry_count,cs.seq,cs.service_code, |
| | | cs.timeout,cs.url FROM c_app ca,c_route cr,c_service cs |
| | | WHERE ca.status_cd = '0' |
| | | AND ca.app_id = cr.app_id |
| | | AND cr.status_cd = '0' |
| | | AND cr.service_id = cs.service_id |
| | | AND cs.status_cd = '0' |
| | | ]]> |
| | | |
| | | </select> |
| | | |
| | | <select id="getMappingInfoAll" resultType="com.java110.entity.mapping.Mapping"> |
| | | <![CDATA[ |
| | | SELECT cm.domain,cm.name,cm.key,cm.value,cm.remark from c_mapping cm where cm.status_cd = '0' |
| | | ]]> |
| | | </select> |
| | | |
| | | </mapper> |