UserFaceInfoServiceImpl.java 1.32 KB
package com.itboyst.facedemo.service.impl;

import com.itboyst.facedemo.mapper.MybatisUserFaceInfoMapper;
import com.itboyst.facedemo.domain.UserFaceInfo;
import com.itboyst.facedemo.service.UserFaceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserFaceInfoServiceImpl implements UserFaceInfoService {


    @Autowired
    private MybatisUserFaceInfoMapper userFaceInfoMapper;

    @Override
    public void insertSelective(UserFaceInfo userFaceInfo) {
        userFaceInfoMapper.insertUserFaceInfo(userFaceInfo);
    }


    @Override
    public UserFaceInfo getUserFaceByName(String name) {
        UserFaceInfo mUserFaceInfo = null;
        List<UserFaceInfo> userFaceInfoList = userFaceInfoMapper.findUserFaceInfoList();
        if(userFaceInfoList != null && userFaceInfoList.size() > 0) {
            for (UserFaceInfo userFaceInfo : userFaceInfoList) {
                if(userFaceInfo.getName().equals(name)) {
                    mUserFaceInfo = userFaceInfo;
                    break;
                }
            }
        }
        return mUserFaceInfo;
    }

    @Override
    public boolean updateUserFaceInfo(UserFaceInfo userFaceInfo) {
        return userFaceInfoMapper.updateUserFaceInfo(userFaceInfo);
    }
}