<?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.fzm.mall.server.admin.opration.mapper.IntegralReturnMerchantMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.fzm.mall.server.admin.opration.model.IntegralReturnMerchant">
        <id column="id" property="id" />
        <result column="return_id" property="returnId" />
        <result column="merchant_id" property="merchantId" />
        <result column="name" property="name" />
        <result column="num" property="num" />
        <result column="return_condition" property="returnCondition" />
        <result column="condition_val" property="conditionVal" />
        <result column="effective_start_time" property="effectiveStartTime" />
        <result column="effective_end_time" property="effectiveEndTime" />
        <result column="remarks" property="remarks" />
        <result column="goods_range" property="goodsRange" />
        <result column="status" property="status" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
    </resultMap>

    <select id="page" resultType="com.fzm.mall.server.admin.opration.entity.vo.IntegralReturnMerchantVO">
        SELECT return_id,name,num,return_condition,condition_val,effective_start_time,effective_end_time,status
        FROM opration_integral_return_merchant
        <where>
            <if test="returnId!=null and returnId!=''">
                return_id = #{returnId}
            </if>
            <if test="name!=null and name!=''">
                AND name = #{name}
            </if>
            <if test="status!=null">
                AND status = #{status}
            </if>
            AND status != 0
        </where>
        ORDER BY create_time DESC
    </select>

</mapper>
