package com.xzx.gc.system.service; import com.xzx.gc.common.constant.Constants; import com.xzx.gc.entity.OtherUserInfo; import com.xzx.gc.system.mapper.OtherUserMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service @Transactional public class OtherUserService { @Autowired private OtherUserMapper otherUserMapper; public List findByUserType(String userType) { OtherUserInfo otherUserInfo=new OtherUserInfo(); otherUserInfo.setDelFlag(0); otherUserInfo.setIsProhibit(false); otherUserInfo.setUserType(userType); List select = otherUserMapper.select(otherUserInfo); return select; } public List findByMobile(String mobile) { OtherUserInfo otherUserInfo=new OtherUserInfo(); otherUserInfo.setDelFlag(Constants.DEL_NOT_FLAG); otherUserInfo.setIsProhibit(false); otherUserInfo.setMobilePhone(mobile); List select = otherUserMapper.select(otherUserInfo); return select; } public OtherUserInfo findByMobileAndUserType(String mobile, String userType) { OtherUserInfo otherUserInfo=new OtherUserInfo(); otherUserInfo.setDelFlag(0); otherUserInfo.setIsProhibit(false); otherUserInfo.setUserType(userType); otherUserInfo.setMobilePhone(mobile); OtherUserInfo select = otherUserMapper.selectOne(otherUserInfo); return select; } public void add(OtherUserInfo otherUserInfo) { otherUserMapper.insertSelective(otherUserInfo); } public OtherUserInfo findById(String userId) { OtherUserInfo otherUserInfo=new OtherUserInfo(); otherUserInfo.setUserId(userId); OtherUserInfo otherUserInfo1 = otherUserMapper.selectOne(otherUserInfo); return otherUserInfo1; } public List find(){ OtherUserInfo otherUserInfo = new OtherUserInfo(); otherUserInfo.setDelFlag(Constants.DEL_NOT_FLAG); otherUserInfo.setIsProhibit(false); return otherUserMapper.select(otherUserInfo); } }