Commit b4575e29 by jianan

导出运营报表2-经纪人日程管理,销售目标,活动量

parent 4c6c9779
...@@ -147,15 +147,27 @@ ...@@ -147,15 +147,27 @@
t.created_at createdAt t.created_at createdAt
FROM ag_mkt_leads_goals t,ag_acl_practitioner p FROM ag_mkt_leads_goals t,ag_acl_practitioner p
WHERE t.practitioner_id = p.id WHERE t.practitioner_id = p.id
<if test="date != null"> <choose>
AND t.created_at &gt;= DATE #{date,jdbcType=VARCHAR} AND t.created_at &lt;= DATE #{date,jdbcType=VARCHAR} <when test="type != null and date != null">
</if> <if test="type == 1">
AND t.created_at = year(#{date,jdbcType=VARCHAR})
</if>
<if test="type == 3">
AND t.created_at = DATE_FORMAT(#{date,jdbcType=VARCHAR}, '%Y%m' )
</if>
</when>
<when test="type != null and date == null">
AND t.statistic_time_unit = #{type,jdbcType=BIGINT}
</when>
<otherwise>
<if test="date != null">
AND t.created_at &gt;= DATE #{date,jdbcType=VARCHAR} AND t.created_at &lt;= DATE #{date,jdbcType=VARCHAR}
</if>
</otherwise>
</choose>
<if test="practitionerId != null"> <if test="practitionerId != null">
AND t.practitioner_id = #{practitionerId,jdbcType=BIGINT} AND t.practitioner_id = #{practitionerId,jdbcType=BIGINT}
</if> </if>
<if test="type != null">
AND t.statistic_time_unit = #{type,jdbcType=BIGINT}
</if>
AND t.is_active = 1 AND t.is_active = 1
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment