第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

【九月打卡】第11天 多端全棧項目實(shí)戰(zhàn)

標(biāo)簽:
SpringBoot

课程名称:多端全栈项目实战:商业级代驾全流程落地


课程章节:  华夏代驾全栈小程序实战


课程讲师: 神思者


课程内容: 


    创建代驾订单,保存到mysql


课程收获:

    

    https://img2.sycdn.imooc.com/6322e01b00014d2508040385.jpg


前两天写好了预估里程,时间,费用的获取接下来需要把订单保存到数据库,除了订单还有账单。


bff-customer 发起远程fegin 调用到orderController 调用 service 进行 insert 数据库 如果是订单则需要通过searchOrderIdByUUID对刚才插入的数据的uuid进行查询 因为uuid是雪花生成的(随机且唯一)。


插入成功后 返回 并封装R对象

需要传入的值分别有


uuid  订单号

customer_id 客户ID

start_place 起始地点

start_place_location 起始坐标

expects_mileage 预估里程

expects_fee 预估订单金额

favour_fee 好处费

charge_rule_id 费用规则id

car_plate 车牌号

car_type 车型

date 订单日期

<insert id="insert" parameterType="com.example.hxds.odr.db.pojo.OrderEntity">
    INSERT INTO tb_order
    SET uuid = #{uuid},
        customer_id = #{customerId},
        start_place = #{startPlace},
        start_place_location = #{startPlaceLocation},
        end_place = #{endPlace},
        end_place_location = #{endPlaceLocation},
        expects_mileage = #{expectsMileage},
        expects_fee = #{expectsFee},
        favour_fee = #{favourFee},
        charge_rule_id=#{chargeRuleId},
        car_plate=#{carPlate},
        car_type=#{carType},
        date = #{date}
</insert>

然后是通过uuid 查 id

<select id="searchOrderIdByUUID" parameterType="String" resultType="String">
    SELECT CAST(id AS CHAR) AS id
    FROM tb_order
    WHERE uuid = #{uuid}
</select>

order_id = 订单id

base_mileage = 基础公里

base_mileage_price = 里程价格

exceed_mileage_price = 超出基础里程价格

base_minute = 基础分种

exceed_minute_price = 超出基础分钟价格

base_return_mileage = 基础返程里程

exceed_return_price = 超出基础返程里程的价格

<insert id="insert" parameterType="com.example.hxds.odr.db.pojo.OrderBillEntity">
    INSERT INTO tb_order_bill
    SET order_id = #{orderId},
        base_mileage = #{baseMileage},
        base_mileage_price = #{baseMileagePrice},
        exceed_mileage_price = #{exceedMileagePrice},
        base_minute = #{baseMinute},
        exceed_minute_price = #{exceedMinutePrice},
        base_return_mileage = #{baseReturnMileage},
        exceed_return_price = #{exceedReturnPrice}
</insert>



至此就写完了 这一章需要的三个sql 明天继续~~


https://img2.sycdn.imooc.com/6322df510001a65a07830598.jpg

點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評論
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊有機(jī)會得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消