1. Parameter injection
1.1 uses the form of #{0}, #{1}, 0 represents the first parameter, 1 represents the second parameter
public List
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
2.2 Return the object directly
3. Execute native sql
3.1sql parameters: //getter setter omitted
}
3.2 interface:
/**
* @Function description: Create
* @return
*/
/**
* @Function description: Query
* @param vo
* @return
*/
public List
> excuteSelectSql(ParamVo vo);
3.3xml:
${sql}
${}Do not compile sql and execute it directly. If you use #{sql}, an error may be reported
4.2 Quote
SELECT COUNT(1)
SELECT ID id, WORKER_ID workerId, UPDATE_DATE updateDate,...