admin
2020-02-18 ddf5db7d31af51fcf697eac0cee7dd46ff73bcc1
fanli/src/main/java/com/yeshi/fanli/mapping/ExtractAuditRecordMapper.xml
@@ -296,124 +296,20 @@
   <select id="countAuditTotal" resultMap="ChartMap">
      SELECT COALESCE(COUNT(tr.id),0) AS 'showValue',
      <if test="type == 1">
         FROM_UNIXTIME(tr.`auditTime`/1000,'%Y-%m-%d') AS
         'showDate'
      </if>
      <if test="type == 2">
         FROM_UNIXTIME(tr.`auditTime`/1000,'%m') AS 'showDate'
      </if>
      <if test="type == 3">
         FROM_UNIXTIME(tr.`auditTime`/1000,'%Y') AS 'showDate'
      </if>
      FROM `yeshi_ec_extract_audit_record` tr
      <if test="state != null and state != 0">
         LEFT JOIN `yeshi_ec_extract` t ON t.`id` = tr.`extractId`
      </if>
      WHERE tr.`auditTime` IS NOT NULL
      <if test="startTime != null and startTime != '' ">
         AND FROM_UNIXTIME(tr.`auditTime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
      </if>
      <if test="endTime != null and endTime != '' ">
         AND FROM_UNIXTIME(tr.`auditTime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
         '${endTime}'
      </if>
      <if test="years != null and years != '' ">
         AND FROM_UNIXTIME(tr.`auditTime`/1000,'%Y') = '${years}'
      </if>
      <if test="state != null and state != 3">
         AND t.`state` = ${state}
      </if>
      <if test="type == 1">
         GROUP BY FROM_UNIXTIME(tr.`auditTime`/1000,'%Y-%m-%d')
      </if>
      <if test="type == 2">
         GROUP BY FROM_UNIXTIME(tr.`auditTime`/1000,'%Y-%m')
      </if>
      <if test="type == 3">
         GROUP BY FROM_UNIXTIME(tr.`auditTime`/1000,'%Y')
      </if>
      ORDER BY tr.`auditTime`
   <select id="countAuditTotal" resultType="Integer">
      SELECT IFNULL(COUNT(tr.id),0) FROM `yeshi_ec_extract_audit_record` tr
      LEFT JOIN `yeshi_ec_extract` t ON t.`id` = tr.`extractId`
      WHERE t.`state` = #{state} AND FROM_UNIXTIME(tr.`auditTime`/1000,'%Y-%m-%d') = #{preDay}
   </select>
   <select id="countExtractMoney" resultMap="ChartMap">
      SELECT CAST(SUM(t.`money`)AS DECIMAL(19,2)) AS showValue,
      <if test="type == 1">
         FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') AS
         'showDate'
      </if>
      <if test="type == 2">
         FROM_UNIXTIME(t.`extractTime`/1000,'%m') AS 'showDate'
      </if>
      <if test="type == 3">
         FROM_UNIXTIME(t.`extractTime`/1000,'%Y') AS 'showDate'
      </if>
      FROM `yeshi_ec_extract` t
      WHERE t.`extractTime` IS NOT NULL
      <if test="startTime != null and startTime != '' ">
         AND FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
      </if>
      <if test="endTime != null and endTime != '' ">
         AND FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
         '${endTime}'
      </if>
      <if test="years != null and years != '' ">
         AND FROM_UNIXTIME(t.`extractTime`/1000,'%Y') = '${years}'
      </if>
      <if test="state != null">
         AND t.`state` = ${state}
      </if>
      <if test="type == 1">
         GROUP BY FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d')
      </if>
      <if test="type == 2">
         GROUP BY FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m')
      </if>
      <if test="type == 3">
         GROUP BY FROM_UNIXTIME(t.`extractTime`/1000,'%Y')
      </if>
      ORDER BY t.`extractTime`
   <select id="countApplyExtractMoney" resultType="BigDecimal">
      SELECT SUM(t.`money`) FROM `yeshi_ec_extract` t
      WHERE FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') = #{preDay}
   </select>
   <select id="countExtractApplyNumber" resultMap="ChartMap">
      SELECT COUNT(t.id) AS showValue,
      <if test="type == 1">
         FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') AS
         'showDate'
      </if>
      <if test="type == 2">
         FROM_UNIXTIME(t.`extractTime`/1000,'%m') AS 'showDate'
      </if>
      <if test="type == 3">
         FROM_UNIXTIME(t.`extractTime`/1000,'%Y') AS 'showDate'
      </if>
      FROM `yeshi_ec_extract` t
      WHERE t.`extractTime` IS NOT NULL
      <if test="startTime != null and startTime != '' ">
         AND FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
      </if>
      <if test="endTime != null and endTime != '' ">
         AND FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
         '${endTime}'
      </if>
      <if test="years != null and years != '' ">
         AND FROM_UNIXTIME(t.`extractTime`/1000,'%Y') = '${years}'
      </if>
      <if test="state != null">
         AND t.`state` = ${state}
      </if>
      <if test="type == 1">
         GROUP BY FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d')
      </if>
      <if test="type == 2">
         GROUP BY FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m')
      </if>
      <if test="type == 3">
         GROUP BY FROM_UNIXTIME(t.`extractTime`/1000,'%Y')
      </if>
      ORDER BY t.`extractTime`
   <select id="countApplyNumberByDay" resultType="Integer">
      SELECT IFNULL(COUNT(t.id),0) FROM `yeshi_ec_extract` t
      WHERE FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') = #{preDay}
   </select>
</mapper>