CommitMapper.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package cn.seecoder.web.dao.project;
  2. import cn.seecoder.web.model.enums.CommitRelatedEnum;
  3. import org.apache.ibatis.annotations.*;
  4. import org.springframework.stereotype.Repository;
  5. import cn.seecoder.web.dao.provider.GeneralInsertUpdateSqlProvider;
  6. import cn.seecoder.web.model.po.project.CommitPO;
  7. import java.util.List;
  8. /**
  9. * @author PuHong Weng
  10. * @date 2021/3/23
  11. * @description:
  12. */
  13. @Repository
  14. public interface CommitMapper {
  15. @InsertProvider(type = GeneralInsertUpdateSqlProvider.class, method = "insert")
  16. int insert(CommitPO commitPO, String... ignoredCols);
  17. @UpdateProvider(type= GeneralInsertUpdateSqlProvider.class, method="updateById")
  18. int update(CommitPO commitPO);
  19. @Select("select * from commit where project_id = #{projectId} and related_type = #{type}")
  20. List<CommitPO> selectByProjectIdAndType(@Param("projectId") int projectId,@Param("type") CommitRelatedEnum type);
  21. @Select("select count(*) from commit where id = #{id}")
  22. int isExist(String id);
  23. @Select("select * from commit where related_id = #{id} and related_type = #{type}")
  24. List<CommitPO> selectByRelatedIdAndType(@Param("id") int id,@Param("type") CommitRelatedEnum type);
  25. @Select("select * from commit where project_id = #{projectId}")
  26. List<CommitPO> selectByProjectId(Integer projectId);
  27. @Select("select * from commit where id = #{id}")
  28. CommitPO selectByCommitId(@Param("id") String id);
  29. }