<?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="org.springblade.modules.pl.product.mapper.ProductMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="productResultMap" type="org.springblade.modules.pl.product.entity.ProductEntity">
        <result column="id" property="id"/>
        <result column="tenant_id" property="tenantId"/>
        <result column="factory_id" property="factoryId"/>
        <result column="client_id" property="clientId"/>
        <result column="batch_id" property="batchId"/>
        <result column="batch_no" property="batchNo"/>
        <result column="product_model_id" property="productModelId"/>
        <result column="product_name" property="productName"/>
        <result column="product_model" property="productModel"/>
        <result column="front_img" property="frontImg"/>
        <result column="back_img" property="backImg"/>
        <result column="scan_date" property="scanDate"/>
        <result column="qr_code" property="qrCode"/>
        <result column="water_cooling" property="waterCooling"/>
        <result column="airtight" property="airtight"/>
        <result column="order_no" property="orderNo"/>
        <result column="shipment_batch" property="shipmentBatch"/>
        <result column="cold_qr_code" property="coldQrCode"/>
        <result column="check_result" property="checkResult"/>
        <result column="in_stock_date" property="inStockDate"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>


    <select id="selectProductPage" resultMap="productResultMap">
        select * from pl_product where is_deleted = 0
    </select>


    <select id="exportProduct" resultType="org.springblade.modules.pl.product.excel.ProductExcel">
        SELECT * FROM pl_product ${ew.customSqlSegment}
    </select>

</mapper>
