yujian
2019-09-02 9eeda0d3049b71877c373c04d65533939b5582ef
fanli/src/main/java/com/yeshi/fanli/mapping/integral/IntegralTaskRecordMapper.xml
@@ -146,9 +146,17 @@
      AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) <![CDATA[<=]]>
      DATE(d.ir_create_time)
      ORDER BY d.ir_create_time desc
      ORDER BY d.ir_create_time desc
   </select>
   <select id="listSignRecordByDateTime" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_integral_task_record d
      WHERE d.`ir_uid` = #{uid}
      and d.ir_cid=#{cid}
      AND d.ir_create_time <![CDATA[<=]]>
      #{dateTime}
      ORDER BY d.ir_create_time desc
   </select>
   <select id="countTotalGoldCoin" resultType="Integer">
      SELECT
@@ -177,9 +185,50 @@
   </select>
   <select id="countByTaskIdTodayNum" resultType="Integer">
      SELECT IFNULL(COUNT(tr.`ir_id`),0) FROM yeshi_ec_integral_task_record tr
      WHERE tr.ir_uid = #{uid} AND tr.`ir_task_id`= #{tid}
           AND TO_DAYS(tr.ir_create_time) = TO_DAYS(${date}) AND tr.ir_create_time <![CDATA[<=]]>${date}
      SELECT IFNULL(COUNT(tr.`ir_id`),0) FROM yeshi_ec_integral_task_record
      tr
      WHERE tr.ir_uid = #{uid} AND tr.`ir_task_id`= #{tid}
      AND TO_DAYS(tr.ir_create_time) = TO_DAYS('${date}') AND tr.ir_create_time <![CDATA[<=]]>'${date}'
   </select>
   <select id="listByCidAndUidAndCreateTime" resultMap="BaseResultMap">
      select * from yeshi_ec_integral_task_record where ir_cid=#{cid}
      <if test="uid!=null">
         and ir_uid=#{uid}
      </if>
      <if test="minTime!=null">
         and ir_create_time>=#{minTime}
      </if>
      <if test="maxTime!=null">
         and #{maxTime}>ir_create_time
      </if>
      limit #{start},#{count}
   </select>
   
</mapper>
   <select id="listByUidAndTaskId" resultMap="BaseResultMap">
      select * from yeshi_ec_integral_task_record where ir_task_id=#{taskId}
      <if test="uid!=null">
         and ir_uid=#{uid}
      </if>
      order by ir_id desc
      limit #{start},#{count}
   </select>
   <select id="countByCidAndUidAndCreateTime" resultType="java.lang.Long">
      select count(ir_id) from yeshi_ec_integral_task_record where
      ir_cid=#{cid}
      <if test="uid!=null">
         and ir_uid=#{uid}
      </if>
      <if test="minTime!=null">
         and ir_create_time>=#{minTime}
      </if>
      <if test="maxTime!=null">
         and #{maxTime}>ir_create_time
      </if>
   </select>
</mapper>