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

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

@Repository
public class TBaseUserprojectDao extends BaseDao<TBaseUserproject, String> {
   public void removeUserprojectByProId(String proid) {
      Criterion cproid = Restrictions.eq("proid", proid);
      this.remove(new Criterion[]{cproid});
   }

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

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

   public void removeUserprojectByProjectid(String proid) {
      Criterion cproid = Restrictions.eq("proid", proid);
      this.remove(new Criterion[]{cproid});
   }
}
