1, problem, map accept parameter for hashmap<string,object>; how to query according to him?
SQL statement: Select result as Orderrsult,ifnull (sum (amount), 0) as Orderamount,count (1) as OrderCount from User_order WHERE app_i D in (?) Group BY result
The corresponding mapper:
Public list<map<string,object>> Merorderview (MAP<STRING,OBJECT>PARAMETERSMAP);
Where map is structured:
{app_ids=[4110,4111], begaindate=2017-07-08, enddate=2017-07-09}
Mapper.xml for
<resultmap id= "Merorderviewresult" type= "HashMap" > <result column= "orderrsult" property= "Ord Errsult "/> <result column=" OrderAmount "property=" OrderAmount "/> <result Colu Mn= "OrderCount" property= "OrderCount"/> </resultMap> <select id= "Merorderview" Parametert Ype= "Map" resultmap= "Merorderviewresult" > select result as orderrsult,ifnull (sum (amount), 0) as Orderamo Unt,count (1) as OrderCount from User_order <where> <!--<if test= "Null! = A
pp_id and '! = app_id ' > and app_id=#{app_id} </if>--> <if test= "App_ids!=null" > and app_id in <foreach collection= "app_id S "item=" AppID "open=" ("separator=", "close=") "> #{appid} </foreach&
Gt </if> <if test= "Null! = Begaindate" > and Insert_date >=#{begaindate} </if> <if test= "Null! = EndDate" > and Insert_date <=#{enddate} </if> </where> GROUP by result &L T;/select>