| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.yc.ship.module.product.dal.mysql.pricevoyage.PriceVoyageMapper">
- <!--
- 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
- 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
- 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
- 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
- -->
- <select id="selectListCalendarPrice"
- resultType="com.yc.ship.module.product.controller.app.voyage.vo.AppVoyageCalendarPriceRespVO">
- SELECT
- DATE_FORMAT( t1.start_time, '%Y-%m-%d' ) date,
- t1.id voyage_id,
- min( t3.price ) price
- FROM
- product_voyage t1
- LEFT JOIN product_price_voyage t2 ON t1.id = t2.voyage_id
- LEFT JOIN product_price_room_model t3 ON t2.id = t3.object_id
- WHERE
- t1.deleted = 0
- AND t2.deleted = 0
- AND t3.deleted = 0
- and t1.ship_id = #{reqVO.shipId}
- AND t1.route_id = #{reqVO.routeId}
- and t1.channel like '%2%'
- <if test="reqVO.startDate != null and reqVO.startDate != ''">
- AND t1.start_time >= #{reqVO.startDate}
- </if>
- <if test="reqVO.endDate != null and reqVO.endDate != ''">
- AND t1.start_time <= CONCAT(#{reqVO.endDate},' 23:59:59')
- </if>
- </select>
- <select id="selectRoomModelListByVoyageId"
- resultType="com.yc.ship.module.product.controller.app.voyage.vo.AppRoomModelPriceRespVO">
- SELECT
- t1.price,
- t1.room_model_id,
- t2.`name` room_model_name
- FROM
- product_price_room_model t1
- LEFT JOIN resource_room_model t2 ON t1.room_model_id = t2.id
- WHERE
- EXISTS (SELECT id FROM product_price_voyage WHERE voyage_id = #{voyageId} and t1.object_id= id AND deleted = 0 )
- AND t1.deleted = 0
- AND t2.deleted = 0
- ORDER BY
- t1.price ASC
- </select>
- </mapper>
|