You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

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