yujian
2019-01-22 88b54772dbcf5ecab1e2316e4e4626ac901b8908
fanli/src/main/java/com/yeshi/fanli/mapping/ExtractAuditRecordMapper.xml
@@ -243,4 +243,120 @@
       WHERE ex.uid = ${uid} <![CDATA[and ar.auditTime > 0 and ar.auditTime is not null ]]>
   </select>
    
   <select id="countAuditTotal" resultType="java.util.HashMap">
      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>
   <select id="countExtractMoney" resultType="java.util.HashMap">
      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>
   <select id="countExtractApplyNumber" resultType="java.util.HashMap">
      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>
</mapper>