1. Parameter injection 1.1 uses the form of #{0}, #{1}, 0 represents the first parameter, 1 represents the second parameter public List queryList(String workerId, Integer topNum);
1.2Map or encapsulated object, workerId is the key in the map; if it is an object, workerId For attributes in objects, this method is very commonly used public Integer queryCountByWorkerId(Map queryParam); public Integer queryCountByWorkerId(@param(“workerId”)String workerId);
2. Return 2.1 mapping
select ID,CREATE_DATE,WORKERID from tableName This way the query statement queries the fields directly It’s just a field in the database, just define the mapped column 2.2 Return the object directly
The field alias returned by the query here must correspond to the attributes in the returned object
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn