package com.xinyilu.system.service.applogkindergarteninfo.impl;

import com.xinyilu.common.utils.SecurityUtils;
import com.xinyilu.system.domain.applogkindergarteninfo.AppLogKindergartenInfo;
import com.xinyilu.system.mapper.applogkindergarteninfo.AppLogKindergartenInfoMapper;
import com.xinyilu.system.service.applogkindergarteninfo.IAppLogKindergartenInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 幼儿体测小程序登录幼儿园信息记录Service业务层处理
 *
 * @author xinyilu
 * @date 2023-04-14
 */
@Service
public class AppLogKindergartenInfoServiceImpl implements IAppLogKindergartenInfoService {
    @Resource
    private AppLogKindergartenInfoMapper appLogKindergartenInfoMapper;

    /**
     * 查询幼儿体测小程序登录幼儿园信息记录
     *
     * @param id 幼儿体测小程序登录幼儿园信息记录主键
     * @return 幼儿体测小程序登录幼儿园信息记录
     */
    @Override
    public AppLogKindergartenInfo selectAppLogKindergartenInfoById(Long id) {
        return appLogKindergartenInfoMapper.selectAppLogKindergartenInfoById(id);
    }

    /**
     * 查询幼儿体测小程序登录幼儿园信息记录列表
     *
     * @param appLogKindergartenInfo 幼儿体测小程序登录幼儿园信息记录
     * @return 幼儿体测小程序登录幼儿园信息记录
     */
    @Override
    public List<AppLogKindergartenInfo> selectAppLogKindergartenInfoList(AppLogKindergartenInfo appLogKindergartenInfo) {
        return appLogKindergartenInfoMapper.selectAppLogKindergartenInfoList(appLogKindergartenInfo);
    }

    /**
     * 新增幼儿体测小程序登录幼儿园信息记录
     *
     * @param appLogKindergartenInfo 幼儿体测小程序登录幼儿园信息记录
     * @return 结果
     */
    @Override
    public int insertAppLogKindergartenInfo(AppLogKindergartenInfo appLogKindergartenInfo) {
        appLogKindergartenInfo.setCreateTime(LocalDateTime.now());
        appLogKindergartenInfo.setCreateBy(SecurityUtils.getUsername());
        return appLogKindergartenInfoMapper.insertAppLogKindergartenInfo(appLogKindergartenInfo);
    }

    /**
     * 修改幼儿体测小程序登录幼儿园信息记录
     *
     * @param appLogKindergartenInfo 幼儿体测小程序登录幼儿园信息记录
     * @return 结果
     */
    @Override
    public int updateAppLogKindergartenInfo(AppLogKindergartenInfo appLogKindergartenInfo) {
        appLogKindergartenInfo.setUpdateTime(LocalDateTime.now());
        appLogKindergartenInfo.setUpdateBy(SecurityUtils.getUsername());
        return appLogKindergartenInfoMapper.updateAppLogKindergartenInfo(appLogKindergartenInfo);
    }

    /**
     * 批量删除幼儿体测小程序登录幼儿园信息记录
     *
     * @param ids 需要删除的幼儿体测小程序登录幼儿园信息记录主键
     * @return 结果
     */
    @Override
    public int deleteAppLogKindergartenInfoByIds(Long[] ids) {
        return appLogKindergartenInfoMapper.deleteAppLogKindergartenInfoByIds(ids);
    }

    /**
     * 删除幼儿体测小程序登录幼儿园信息记录信息
     *
     * @param id 幼儿体测小程序登录幼儿园信息记录主键
     * @return 结果
     */
    @Override
    public int deleteAppLogKindergartenInfoById(Long id) {
        return appLogKindergartenInfoMapper.deleteAppLogKindergartenInfoById(id);
    }
}
