package com.chenyang.nse.bussiness.dao.table.base;

import com.chenyang.nse.bussiness.dao.BaseDao;
import com.chenyang.nse.bussiness.entity.orm.table.base.TBaseUsersys;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

@Repository
public class TBaseUsersysDao extends BaseDao<TBaseUsersys, String> {
   public void removeUsersysBySysId(String sysid) {
      Criterion csysid = Restrictions.eq("sysid", sysid);
      Criterion csysid1 = Restrictions.ne("userid", "1");
      this.remove(new Criterion[]{csysid, csysid1});
   }

   public void removeUsersysByUserId(String userid) {
      Criterion cuserid = Restrictions.eq("userid", userid);
      this.remove(new Criterion[]{cuserid});
   }

   public void removeUsersysByUpdateuserid(String sysid, String updateuserid) {
      Criterion cproid = Restrictions.eq("sysid", sysid);
      Criterion cupdateuserid = Restrictions.eq("updateuserid", updateuserid);
      this.remove(new Criterion[]{cproid, cupdateuserid});
   }
}
