后台服务
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

132 linhas
3.9 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.WxCouponInjectMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCouponInject">
  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="name" jdbcType="VARCHAR" property="name" />
  9. <result column="m_user_id" jdbcType="BIGINT" property="mUserId" />
  10. <result column="send_type" jdbcType="INTEGER" property="sendType" />
  11. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  12. <result column="coupon_name" jdbcType="VARCHAR" property="couponName" />
  13. <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
  14. <result column="send_amount" jdbcType="INTEGER" property="sendAmount" />
  15. <result column="status" jdbcType="INTEGER" property="status" />
  16. <result column="error_msg" jdbcType="VARCHAR" property="errorMsg" />
  17. <result column="tags" jdbcType="VARCHAR" property="tags" />
  18. <result column="msg_id" jdbcType="BIGINT" property="msgId" />
  19. <result column="model_id" jdbcType="BIGINT" property="modelId" />
  20. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  21. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  22. </resultMap>
  23. <sql id="allColumns">
  24. `id`,`tenant_id`,`parent_tenant_id`,`name`,`m_user_id`,`send_type`,`coupon_id`,`coupon_name`,`send_time`,`send_amount`,`status`,`error_msg`,`tags`,`msg_id`,`create_time`,`update_time`,`model_id`
  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 != name ">
  38. and `name` like concat('%', #{name},'%')
  39. </if>
  40. <if test=" null != mUserId ">
  41. and `m_user_id` like concat('%', #{mUserId},'%')
  42. </if>
  43. <if test=" null != sendType ">
  44. and `send_type` = #{sendType}
  45. </if>
  46. <if test=" null != couponId ">
  47. and `coupon_id` = #{couponId}
  48. </if>
  49. <if test=" null != couponName and couponName!=''">
  50. and `coupon_name` like concat('%', #{couponName},'%')
  51. </if>
  52. <if test=" null != sendTime ">
  53. and `send_time` = #{sendTime}
  54. </if>
  55. <if test=" null != sendTimeStart and null!=sendTimeEnd ">
  56. and `send_time` >= #{sendTimeStart} and `send_time` &lt;= #{sendTimeEnd}
  57. </if>
  58. <if test=" null != sendAmount ">
  59. and `send_amount` = #{sendAmount}
  60. </if>
  61. <if test=" null != status ">
  62. and `status` = #{status}
  63. </if>
  64. <if test=" null != errorMsg ">
  65. and `error_msg` like concat('%', #{errorMsg},'%')
  66. </if>
  67. <if test=" null != tags ">
  68. and `tags` like concat('%', #{tags},'%')
  69. </if>
  70. <if test=" null != createTime ">
  71. and `create_time` = #{createTime}
  72. </if>
  73. <if test=" null != updateTime ">
  74. and `update_time` = #{updateTime}
  75. </if>
  76. <if test=" null != msgId ">
  77. and `msg_id` = #{msgId}
  78. </if>
  79. <if test=" null != ids ">
  80. and id in
  81. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  82. #{idItem}
  83. </foreach>
  84. </if>
  85. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  86. </sql>
  87. <select id="findList" parameterType="com.iformall.domain.po.WxCouponInject" resultMap="BaseResultMap">
  88. select
  89. <include refid="allColumns"/>
  90. from wx_coupon_inject
  91. <include refid="dynamicWhereConditions" />
  92. </select>
  93. </mapper>