package com.goafanti.cognizance.service.impl; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.goafanti.cognizance.bo.OrgIntellectualPropertyDetailBo; import com.goafanti.cognizance.service.OrgIntellectualPropertyService; import com.goafanti.common.dao.OrgIntellectualPropertyMapper; import com.goafanti.common.model.OrgIntellectualProperty; import com.goafanti.core.mybatis.BaseMybatisDao; import com.goafanti.core.mybatis.page.Pagination; @Service public class OrgIntellectualPropertyServiceImpl extends BaseMybatisDao implements OrgIntellectualPropertyService { @Autowired private OrgIntellectualPropertyMapper orgIntellectualPropertyMapper; @Override public OrgIntellectualProperty insert(OrgIntellectualProperty orgIntellectualProperty) { orgIntellectualPropertyMapper.insert(orgIntellectualProperty); return orgIntellectualProperty; } @SuppressWarnings("unchecked") @Override public Pagination listIntellectual(Integer pageNo, Integer pageSize, String uid) { Map params = new HashMap<>(); if (!StringUtils.isBlank(uid)){ params.put("uid", uid); } if (pageNo == null || pageNo < 0) { pageNo = 1; } if (pageSize == null || pageSize < 0) { pageSize = 10; } return (Pagination) findPage("findOrgIntellectualPropertyListByPage", "findOrgIntellectualPropertyCount", params, pageNo, pageSize); } @Override public int delete(String id) { return orgIntellectualPropertyMapper.deleteByPrimaryKey(id); } @Override public int deleteByPrimaryKey(List id) { return orgIntellectualPropertyMapper.batchDeleteByPrimaryKey(id); } @Override public int updateByPrimaryKeySelective(OrgIntellectualProperty orgIntellectualProperty) { return orgIntellectualPropertyMapper.updateByPrimaryKeySelective(orgIntellectualProperty); } @Override public OrgIntellectualProperty selectOrgIntellectualPropertyByPid(String pid) { return orgIntellectualPropertyMapper.selectOrgIntellectualPropertyByPid(pid); } @Override public OrgIntellectualProperty selectByPrimaryKey(String id) { return orgIntellectualPropertyMapper.selectByPrimaryKey(id); } @Override public OrgIntellectualPropertyDetailBo selectPatentTypeDetail(String id) { return orgIntellectualPropertyMapper.selectPatentTypeDetail(id); } @Override public OrgIntellectualPropertyDetailBo selectCopyrightTypeDetail(String id) { return orgIntellectualPropertyMapper.selectCopyrightTypeDetail(id); } }