<?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.qs.mp.admin.mapper.TicketBoxMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.qs.mp.admin.domain.TicketBox">
        <id column="box_id" property="boxId" />
        <result column="box_no" property="boxNo" />
        <result column="title" property="title" />
        <result column="pic_url" property="picUrl" />
        <result column="category_id" property="categoryId" />
        <result column="description" property="description" />
        <result column="sale_point" property="salePoint" />
        <result column="type" property="type" />
        <result column="quantity" property="quantity" />
        <result column="sale_qty" property="saleQty" />
        <result column="pkg_sale_price" property="pkgSalePrice" />
        <result column="pkg_unit" property="pkgUnit" />
        <result column="pkg_qty" property="pkgQty" />
        <result column="sale_pkg_qty" property="salePkgQty" />
        <result column="face_price" property="facePrice" />
        <result column="sale_price" property="salePrice" />
        <result column="sale_comm_rate" property="saleCommRate" />
        <result column="properties" property="properties" />
        <result column="sort_weight" property="sortWeight" />
        <result column="on_time" property="onTime" />
        <result column="off_time" property="offTime" />
        <result column="manual_off" property="manualOff" />
        <result column="status" property="status" />
        <result column="is_deleted" property="isDeleted" />
        <result column="created_time" property="createdTime" />
        <result column="updated_time" property="updatedTime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        box_id, box_no, title, pic_url, category_id, description, sale_point, type, quantity, sale_qty, pkg_sale_price, pkg_unit, pkg_qty, sale_pkg_qty, face_price, sale_price, sale_comm_rate, properties, sort_weight, on_time, off_time, manual_off, status, is_deleted, created_time, updated_time
    </sql>

    <select id="listBySaleChannel" resultType="com.qs.mp.admin.domain.TicketBox">
        select t1.*
        from mp_ticket_box t1
        left join mp_ticket_box_channel t2 on t1.box_id = t2.box_id
        ${ew.customSqlSegment}
    </select>
</mapper>
