后台服务
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.7 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.PosMallConfigMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.PosMallConfig">
  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="discount" jdbcType="INTEGER" property="discount" />
  9. <result column="coupon" jdbcType="INTEGER" property="coupon" />
  10. <result column="card" jdbcType="INTEGER" property="card" />
  11. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  12. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  13. </resultMap>
  14. <sql id="allColumns">
  15. `id`,`tenant_id`,`parent_tenant_id`,`discount`,`coupon`,`card`,`create_date`,`update_date`
  16. </sql>
  17. <sql id="dynamicWhereConditions">
  18. where 1 = 1
  19. <if test=" null != id ">
  20. and `id` = #{id}
  21. </if>
  22. <if test=" null != tenantId and '' != tenantId">
  23. and `tenant_id` = #{tenantId}
  24. </if>
  25. <if test=" null != parentTenantId and '' != parentTenantId">
  26. and `parent_tenant_id` = #{parentTenantId}
  27. </if>
  28. <if test=" null != discount ">
  29. and `discount` = #{discount}
  30. </if>
  31. <if test=" null != coupon ">
  32. and `coupon` = #{coupon}
  33. </if>
  34. <if test=" null != card ">
  35. and `card` = #{card}
  36. </if>
  37. <if test=" null != createDate ">
  38. and `create_date` = #{createDate}
  39. </if>
  40. <if test=" null != updateDate ">
  41. and `update_date` = #{updateDate}
  42. </if>
  43. <if test=" null != ids ">
  44. and id in
  45. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  46. #{idItem}
  47. </foreach>
  48. </if>
  49. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  50. </sql>
  51. <select id="findList" parameterType="com.iformall.domain.po.PosMallConfig" resultMap="BaseResultMap">
  52. select <include refid="allColumns" /> from pos_mall_config
  53. <include refid="dynamicWhereConditions" />
  54. </select>
  55. <select id="getByTenantId" parameterType="string" resultMap="BaseResultMap">
  56. select
  57. <include refid="allColumns"/>
  58. from pos_mall_config
  59. where 1=1 and `tenant_id` = #{value}
  60. </select>
  61. <select id="getByTenantInfo" resultMap="BaseResultMap">
  62. select
  63. <include refid="allColumns"/>
  64. from pos_mall_config
  65. where 1=1
  66. <if test=" null != tenantId and '' != tenantId">
  67. and `tenant_id` = #{tenantId}
  68. </if>
  69. <if test=" null != parentTenantId and '' != parentTenantId">
  70. and `parent_tenant_id` = #{parentTenantId}
  71. </if>
  72. </select>
  73. </mapper>