后台服务
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

92 wiersze
3.2 KiB

  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.iformall.mapper.WxCUserBasicSignMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCUserBasicSign">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  8. <result column="user_id" jdbcType="BIGINT" property="userId" />
  9. <result column="type" jdbcType="INTEGER" property="type" />
  10. <result column="signin_date" jdbcType="TIMESTAMP" property="signinDate"/>
  11. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  12. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  13. <result column="continue_month_sign" jdbcType="INTEGER" property="continueMonthSign" />
  14. <result column="count_month_sign" jdbcType="INTEGER" property="countMonthSign" />
  15. <result column="continue_year_sign" jdbcType="INTEGER" property="continueYearSign" />
  16. <result column="count_year_sign" jdbcType="INTEGER" property="countYearSign" />
  17. <result column="continue_sign" jdbcType="INTEGER" property="continueSign" />
  18. <result column="count_sign" jdbcType="INTEGER" property="countSign" />
  19. <result column="mark" jdbcType="VARCHAR" property="mark" />
  20. </resultMap>
  21. <sql id="allColumns">
  22. `id`,`tenant_id`,`parent_tenant_id`,`user_id`,`type`,`signin_date`,`create_date`,`update_date`,
  23. `continue_month_sign`,`count_month_sign`,`continue_year_sign`,`count_year_sign`,
  24. `continue_sign`,`count_sign`,`mark`
  25. </sql>
  26. <sql id="dynamicWhereConditions">
  27. where 1 = 1
  28. <if test=" null != id ">
  29. and `id` = #{id}
  30. </if>
  31. <if test=" null != tenantId and '' != tenantId">
  32. and `tenant_id` = #{tenantId}
  33. </if>
  34. <if test=" null != parentTenantId and '' != parentTenantId">
  35. and `parent_tenant_id` = #{parentTenantId}
  36. </if>
  37. <if test=" null != userId ">
  38. and `user_id` = #{userId}
  39. </if>
  40. <if test=" null != type ">
  41. and `type` = #{type}
  42. </if>
  43. <if test=" null != startDate ">
  44. and `signin_date` &gt;= #{startDate}
  45. </if>
  46. <if test=" null != endDate">
  47. and `signin_date` &lt;= #{endDate}
  48. </if>
  49. <if test=" null != ids ">
  50. and id in
  51. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  52. #{idItem}
  53. </foreach>
  54. </if>
  55. order by `signin_date` desc
  56. </sql>
  57. <select id="findList" parameterType="com.iformall.domain.po.WxCUserBasicSign" resultMap="BaseResultMap">
  58. select <include refid="allColumns" />
  59. from wx_c_user_basic_sign
  60. <include refid="dynamicWhereConditions" />
  61. </select>
  62. <select id="getLastSignIn" parameterType="com.iformall.domain.po.WxCUserBasicSign" resultMap="BaseResultMap">
  63. select <include refid="allColumns" /> from wx_c_user_basic_sign
  64. where 1 = 1
  65. <if test=" null != tenantId and '' != tenantId">
  66. and `tenant_id` = #{tenantId}
  67. </if>
  68. <if test=" null != parentTenantId and '' != parentTenantId">
  69. and `parent_tenant_id` = #{parentTenantId}
  70. </if>
  71. <if test=" null != userId ">
  72. and `user_id` = #{userId}
  73. </if>
  74. order by `signin_date` desc limit 1
  75. </select>
  76. </mapper>