UserIntegralDetailsMapper.xml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.sqx.modules.integral.dao.UserIntegralDetailsDao">
  4. <select id="isSignIn" resultType="com.sqx.modules.integral.entity.UserIntegralDetails">
  5. select * from user_integral_details where user_id = #{userId} and classify = 1
  6. and date_format(create_time,'%Y-%m-%d')=date_format(#{format},'%Y-%m-%d')
  7. </select>
  8. <select id="selectIntegraldetailsList" resultType="com.sqx.modules.integral.entity.UserIntegralDetails">
  9. select * from user_integral_details where user_id = #{userId}
  10. <if test="classify!=null ">
  11. and classify = #{classify}
  12. </if>
  13. order by create_time desc
  14. </select>
  15. <select id="selectSignIn" resultType="com.sqx.modules.integral.entity.UserIntegralDetails">
  16. select * from user_integral_details where user_id = #{userId} order by create_time desc
  17. </select>
  18. <select id="selectUserIntegralDetails" resultType="com.sqx.modules.integral.entity.UserIntegralDetails">
  19. select * from user_integral_details where user_id = #{userId} and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d') and classify = 1 limit 1
  20. </select>
  21. <select id="queryIntegralList" resultType="com.sqx.modules.integral.entity.UserIntegralDetails">
  22. select uid.*,tu.phone as phone ,tu.user_name as userName
  23. from user_integral_details uid left join tb_user tu on uid.user_id =tu.user_id
  24. where 1=1
  25. <if test="classify!=null and classify!=''">
  26. and uid.classify = #{classify}
  27. </if>
  28. <if test="phone!=null and phone!=''">
  29. and tu.phone like CONCAT('%',#{phone},'%')
  30. </if>
  31. <if test="orderNumber!=null and orderNumber!=''" >
  32. and uid.order_number like CONCAT('%',#{orderNumber},'%')
  33. </if>
  34. order by create_time desc
  35. </select>
  36. <select id="selectUserIntegralDetailsByExp" resultType="com.sqx.modules.integral.entity.UserIntegralDetails">
  37. select * from user_integral_details where date_format(exp_time,'%Y-%m-%d') &lt;=date_format(#{date},'%Y-%m-%d') and classify = 4
  38. </select>
  39. </mapper>