package com.engine.salary.biz;

import com.engine.salary.entity.salarysob.po.SalarySobItemHidePO;
import com.engine.salary.mapper.salarysob.SalarySobItemHideMapper;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;

import java.util.Collection;
import java.util.List;

public class SalarySobItemHideBiz {

    public List<Long> listHideItemIds(SalarySobItemHidePO salarySobPO) {
        SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
        try {
            SalarySobItemHideMapper mapper = sqlSession.getMapper(SalarySobItemHideMapper.class);
            return mapper.listHideItemIds(salarySobPO);
        } finally {
            sqlSession.close();
        }
    }

    public void deleteBySalarySobIds(Collection<Long> ids) {
        SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
        try {
            SalarySobItemHideMapper mapper = sqlSession.getMapper(SalarySobItemHideMapper.class);
            mapper.deleteBySalarySobIds(ids);
            sqlSession.commit();
        } finally {
            sqlSession.close();
        }
    }

    public void update(SalarySobItemHidePO salarySobGroupItemHidePO) {
        SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
        try {
            SalarySobItemHideMapper mapper = sqlSession.getMapper(SalarySobItemHideMapper.class);
            mapper.update(salarySobGroupItemHidePO);
            sqlSession.commit();
        } finally {
            sqlSession.close();
        }

    }

    public void updateByItemId(SalarySobItemHidePO salarySobGroupItemHidePO) {
        SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
        try {
            SalarySobItemHideMapper mapper = sqlSession.getMapper(SalarySobItemHideMapper.class);
            mapper.updateByItemId(salarySobGroupItemHidePO);
            sqlSession.commit();
        } finally {
            sqlSession.close();
        }
    }

    public List<SalarySobItemHidePO> listSome(SalarySobItemHidePO po) {
        SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
        try {
            SalarySobItemHideMapper mapper = sqlSession.getMapper(SalarySobItemHideMapper.class);
            return mapper.listSome(po);
        } finally {
            sqlSession.close();
        }
    }
}
