|
|
@@ -25,6 +25,26 @@
|
|
|
left join department_management dm on dm.id = a.department_id
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectPersonalByPage" resultType="com.goafanti.report.bo.PersonalSalesReportBO">
|
|
|
+ SELECT a.id, a.name, dm.name as departmentName, a.position, a.create_time as enrollTime
|
|
|
+ FROM admin a
|
|
|
+ left join department_management dm on dm.id = a.department_id
|
|
|
+ where 1=1
|
|
|
+ <if test="depName != null">
|
|
|
+ and dm.name like concat(#{depName,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ and a.name like concat(#{name,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="position != null">
|
|
|
+ and a.position like concat(#{position,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ order by a.name asc
|
|
|
+ <if test="pageNo != null and pageSize != null">
|
|
|
+ limit #{pageNo,jdbcType=INTEGER}, #{pageSize,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectDailySalesReports" resultMap="BaseResultMap">
|
|
|
SELECT o.salesman_id as admin_id, a.department_id as dep_id,
|
|
|
count(o.order_no) as order_count, sum(o.sign_total_amount) as order_amount
|
|
|
@@ -77,11 +97,16 @@
|
|
|
<select id="selectSalesPersonalReportsCount" resultType="java.lang.Long">
|
|
|
SELECT count(distinct(a.id))
|
|
|
FROM admin a
|
|
|
+ <if test="startTime != null and endTime != null">
|
|
|
left join daily_sales_report dsr on dsr.admin_id = a.id
|
|
|
+ </if>
|
|
|
<if test="depName != null">
|
|
|
left join department_management dm on dm.id = a.department_id
|
|
|
</if>
|
|
|
- where dsr.create_time >= #{startTime,jdbcType=TIMESTAMP} and dsr.create_time < #{endTime,jdbcType=TIMESTAMP}
|
|
|
+ where 1=1
|
|
|
+ <if test="startTime != null and endTime != null">
|
|
|
+ and dsr.create_time >= #{startTime,jdbcType=TIMESTAMP} and dsr.create_time < #{endTime,jdbcType=TIMESTAMP}
|
|
|
+ </if>
|
|
|
<if test="depName != null">
|
|
|
and dm.name like concat(#{depName,jdbcType=VARCHAR},'%')
|
|
|
</if>
|