举个例子,现在有这么一个类前端
/**
* @author fanzejie
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class JsonItem {
private int id;
private String batchNum;
private String product;
private String checkItem;
private String hostName;
private String name;
private int status;
private String msg;
private String doc;
private Date datetime;
private float expend_time;
private String uuid;
private String func;
private String lab;
}
前端传入两个参数product,checkItem,找出所有product,checkItem符合条件的JsonItem
dao层:
/**
* 根据产品和检查项进行查询
* @param product
* @param checkItem
* @return 查询出的集合
*/
List<JsonItem> getExecutionLog(@Param("product") String product,@Param("checkItem") String checkItem);
mapper层:
<select id="getExecutionLog" resultType="com.pig4cloud.tianxun.entity.JsonItem">
select * from jsonItem where product = #{product} and checkItem = #{checkItem}
</select>