6.10

package com.example.spring2.mapper;
import com.example.spring2.entity.User;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper {

@Select("SELECT COUNT(*) FROM policy WHERE name LIKE CONCAT('%', #{name}, '%')")
Map<String, User> getCountByName(@Param("name") String name);

@Select("SELECT COUNT(*) FROM policy WHERE document LIKE CONCAT('%', #{document}, '%')")
Map<String, User> getCountByDocument(@Param("document") String document);

@Select("SELECT COUNT(*) FROM policy WHERE organ LIKE CONCAT('%', #{organ}, '%')")
Map<String, User> getCountByOrgan(@Param("organ") String organ);

@Select("SELECT COUNT(*) FROM policy WHERE text LIKE CONCAT('%', #{text}, '%')")
Map<String, User> getCountByText(@Param("text") String text);

@Select("SELECT COUNT(*) FROM policy")
Map<String, User> getTotalCount();

@Select("SELECT name FROM policy")
List<User> getAllPolicies();

@Select("SELECT text FROM policy WHERE name LIKE CONCAT('%',#{name},'%')")
List<String> getAllPolicies2(String name);

@Select("SELECT name FROM policy WHERE name LIKE CONCAT('%',#{name},'%')")
List<User> getAllPolicies3(String name);

}
posted @ 2024-06-13 19:12  kxzzow  阅读(11)  评论(0)    收藏  举报