package com.xzx.gc.user.service; import com.xzx.gc.common.constant.Constants; import com.xzx.gc.entity.SysItemUser; import com.xzx.gc.user.mapper.SysItemUserMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import tk.mybatis.mapper.entity.Example; import java.util.List; @Service @Transactional public class SysItemUserService { @Autowired private SysItemUserMapper sysItemUserMapper; public List findByUserId(String userId){ SysItemUser sysItemUser=new SysItemUser(); sysItemUser.setUserId(userId); sysItemUser.setDelFlag(Constants.DEL_NOT_FLAG); return sysItemUserMapper.select(sysItemUser); } public void deleteByUserId(String userId){ Example example=new Example(SysItemUser.class); Example.Criteria criteria = example.createCriteria(); criteria.andEqualTo("userId",userId); SysItemUser sysItemUser=new SysItemUser(); sysItemUser.setDelFlag(Constants.DEL_FLAG); sysItemUserMapper.updateByExampleSelective(sysItemUser,example); } }