效果图
mapper
<select id="selectListMapHyMap" parameterType="map" resultType="map">
SELECT s.username ,
s.ext3 ,
s.tel,
s.email,
s.id,
u.`name`,
a.ordercltime,
SUM(a.ordermoney)as jine
FROM dlz_order a
LEFT JOIN dlz_scuser s ON a.userid = s.id
LEFT JOIN sys_user u ON s.binduserid = u.id
<where>
<if test="condition !=null and condition !=''"> <bind name="tName" value="'%'+condition+'%'"/>
and u.`name` like #{tName}
</if>
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
and ( ordercltime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
</if>
<if test="userList !=null and userList.size()!=0">
and a.userid in (
<foreach collection="userList" item="item" index="index">
<if test="index != userList.size()-1">
#{item},
</if>
<if test="index == userList.size()-1">
#{item}
</if>
</foreach>)
</if>
</where>
GROUP BY s.binduserid
</select>
dao层
List<Map<String,Object>> selectListMapHyMap(Map<String,Object> map);
service
List<Map<String,Object>> selectListMapHyMap(Map<String,Object> map);
serviceimpl
//根据条件查询统计服务商的销售额
public List<Map<String, Object>> selectListMapHyMap(Map<String, Object> map) {
return this.baseMapper.selectReportListByMap(map);
}
controller:判断用户权限进行筛选
/**
* 对账控制器
*
* @author fengshuonan
* @Date 2019-08-28 16:17:46
*/
@Controller
@RequestMapping("/mill")
public class MillController extends