/*
 * @Author: YKH
 * @Date: 2021-12-08 10:26:27
 * @LastEditTime: 2022-09-02 22:40:49
 * @Description: 
 * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\service\rent_computer_shop.ts
 */
import { Provide } from '@midwayjs/decorator';
import { BaseService } from 'midwayjs-cool-core';
import { InjectEntityModel } from '@midwayjs/orm';
import { Repository } from 'typeorm';
import * as _ from 'lodash';
import { ShuyouRentComputerShopEntity } from '../entity/rent_computer_shop';

/**
 * 租机
 */
@Provide()
export class ShuyouRentComputerShopService extends BaseService {

  @InjectEntityModel(ShuyouRentComputerShopEntity)
  ShuyouRentComputerShopEntity: Repository<ShuyouRentComputerShopEntity>;


  /**
  * 重写分页查询
  * @param query
  */
  async page(query) {
    const { name } = query;
    const sql = `
          SELECT
            *
          FROM
            shuyou_rent_computer_shop
          WHERE 1 = 1
            ${this.setSql(name, 'and name LIKE ?', [`%${name}%`])}
        `;
    return this.sqlRenderPage(sql, query);
  }

  

}
