无关风月
2024-12-31 bf765893039bc7968b8160a70bda778526dca98c
manage/src/main/resources/mapping/TOrderAftersalesMapper.xml
@@ -22,5 +22,33 @@
    <sql id="Base_Column_List">
        id, code, sysId, optometristId, orderId, reason, handleResult, createTime, updateTime, createBy, updateBy, isDelete
    </sql>
    <select id="pageList" resultType="com.jilongda.manage.vo.TOrderAftersalesVO">
        select toa.id, toa.code, toa.sysId, toa.optometristId, toa.orderId, toa.reason, toa.handleResult, toa.createTime, toa.updateTime,
               toa.createBy, toa.updateBy, toa.isDelete, ts.name as storeName, o.orderMoney,tau.`name` as `name`,
               o.realName
        from t_order_aftersales toa
        left join t_order o on toa.orderId = o.id
        left join t_store ts on o.storeId = ts.id
        left join t_app_user tau on o.userId = tau.id
        <where>
            <if test="query.phone != null and query.phone != ''">
                and o.phone like concat('%',#{query.phone},'%')
            </if>
            <if test="query.userIds != null and query.userIds.size()>0">
                AND o.userId IN
                <foreach collection="query.userIds" close=")" open="(" item="id" separator=",">
                    #{id}
                </foreach>
            </if>
            <if test="query.storeId != null">
                and o.storeId = #{query.storeId}
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                and toa.createTime between #{query.startTime} and #{query.endTime}
            </if>
            and toa.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY toa.createTime DESC
    </select>
</mapper>