Commit 4d1f3fd6 authored by 雍欢's avatar 雍欢

多数据库支持

parent ae10b2b7
...@@ -7,25 +7,24 @@ import org.springframework.data.repository.query.Param; ...@@ -7,25 +7,24 @@ import org.springframework.data.repository.query.Param;
import com.huigou.uasp.log.domain.model.ApplicationSystem; import com.huigou.uasp.log.domain.model.ApplicationSystem;
public interface ApplicationSystemRepository extends JpaRepository<ApplicationSystem, String> { public interface ApplicationSystemRepository extends JpaRepository<ApplicationSystem, String> {
ApplicationSystem findByCode(String code); ApplicationSystem findByCode(String code);
@Query(countName="applicationSystem.countByCode",value="select count(*) from sa_applicationsystem t where t.code = ?1 and t.id != ?2",nativeQuery=true) @Query(countName = "applicationSystem.countByCode", value = "select count(t) from ApplicationSystem t where t.code=?1 and t.id !=?2")
Long countByCodeAndId(String code,String id); Long countByCodeAndId(String code, String id);
@Query(countName="applicationSystem.countByName",value="select count(*) from sa_applicationsystem t where t.code = ?1 and t.id != ?2",nativeQuery=true) @Query(countName = "applicationSystem.countByName", value = "select count(t) from ApplicationSystem t where t.code=?1 and t.id !=?2")
Long countByNameAndId(String name,String id); Long countByNameAndId(String name, String id);
@Query(countName="applicationSystem.countByName",value="select count(*) from sa_applicationsystem t where t.class_prefix = ?1 and t.id != ?2",nativeQuery=true) @Query(countName = "applicationSystem.countByName", value = "select count(t) from ApplicationSystem t where t.classPrefix = ?1 and t.id != ?2")
Long countByClassPrefixAndId(String ClassPrefix,String id); Long countByClassPrefixAndId(String ClassPrefix, String id);
@Query(name = "applicationSystem.findByClassPrefix", nativeQuery = true, value = "select * from SA_ApplicationSystem where :classPrefix like class_prefix || '%'") @Query(name = "applicationSystem.findByClassPrefix", value = "from ApplicationSystem where :classPrefix like concat(classPrefix,'%')")
ApplicationSystem findByClassPrefix(@Param("classPrefix") String classPrefix); ApplicationSystem findByClassPrefix(@Param("classPrefix") String classPrefix);
Long countByCode(String code); Long countByCode(String code);
Long countByName(String name); Long countByName(String name);
Long countByClassPrefix(String ClassPrefix); Long countByClassPrefix(String ClassPrefix);
} }
...@@ -22,11 +22,6 @@ ...@@ -22,11 +22,6 @@
<property name="queryXmlManager" ref="queryXmlManager" /> <property name="queryXmlManager" ref="queryXmlManager" />
</bean> </bean>
<bean id="mapperScannerConfigurer" class="com.topsunit.query.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.huigou.**.mapper"/>
<property name="sqlExecutorBeanName" value="sqlExecutorDao" />
</bean>
<bean id="generalRepository" class="com.huigou.data.repository.GeneralRepository"> <bean id="generalRepository" class="com.huigou.data.repository.GeneralRepository">
</bean> </bean>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment