選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 

111 行
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.WxMallMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMall">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="name" jdbcType="VARCHAR" property="name"/>
  8. <result column="group" jdbcType="VARCHAR" property="group"/>
  9. <result column="country" jdbcType="VARCHAR" property="country"/>
  10. <result column="province" jdbcType="VARCHAR" property="province"/>
  11. <result column="city" jdbcType="VARCHAR" property="city"/>
  12. <result column="addr" jdbcType="VARCHAR" property="addr"/>
  13. <result column="total_area" jdbcType="DECIMAL" property="totalArea"/>
  14. <result column="operating_area" jdbcType="DECIMAL" property="operatingArea"/>
  15. <result column="park_area" jdbcType="DECIMAL" property="parkArea"/>
  16. <result column="park_place_number" jdbcType="INTEGER" property="parkPlaceNumber"/>
  17. <result column="service_phone" jdbcType="VARCHAR" property="servicePhone"/>
  18. <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
  19. <result column="img_url_h" jdbcType="VARCHAR" property="imgUrlH"/>
  20. <result column="weap_note" jdbcType="VARCHAR" property="weapNote"/>
  21. </resultMap>
  22. <sql id="allColumns">
  23. `id`,`tenant_id`,`name`,`group`,`country`,`province`,`city`,`addr`,
  24. `total_area`,`operating_area`,`park_area`,`park_place_number`,`service_phone`,
  25. `img_url`,`img_url_h`, `weap_note`
  26. </sql>
  27. <sql id="dynamicWhereConditions">
  28. where 1 = 1
  29. <if test=" null != id ">
  30. and `id` = #{id}
  31. </if>
  32. <if test=" null != tenantId ">
  33. and `tenant_id` = #{tenantId}
  34. </if>
  35. <if test=" null != name ">
  36. and `name` like concat('%', #{name},'%')
  37. </if>
  38. <if test=" null != group ">
  39. and `group` like concat('%', #{group},'%')
  40. </if>
  41. <if test=" null != country ">
  42. and `country` like concat('%', #{country},'%')
  43. </if>
  44. <if test=" null != province ">
  45. and `province` like concat('%', #{province},'%')
  46. </if>
  47. <if test=" null != city ">
  48. and `city` like concat('%', #{city},'%')
  49. </if>
  50. <if test=" null != addr ">
  51. and `addr` like concat('%', #{addr},'%')
  52. </if>
  53. <if test=" null != totalArea ">
  54. and `total_area` = #{totalArea}
  55. </if>
  56. <if test=" null != operatingArea ">
  57. and `operating_area` = #{operatingArea}
  58. </if>
  59. <if test=" null != parkArea ">
  60. and `park_area` = #{parkArea}
  61. </if>
  62. <if test=" null != parkPlaceNumber ">
  63. and `park_place_number` = #{parkPlaceNumber}
  64. </if>
  65. <if test=" null != servicePhone ">
  66. and `service_phone` = #{servicePhone}
  67. </if>
  68. <if test=" null != imgUrl ">
  69. and `img_url` = #{imgUrl}
  70. </if>
  71. <if test=" null != imgUrlH ">
  72. and `img_ur_h` = #{imgUrlH}
  73. </if>
  74. <if test=" null != ids ">
  75. and id in
  76. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  77. #{idItem}
  78. </foreach>
  79. </if>
  80. <if test=" null != sortColumns">order by ${sortColumns}</if>
  81. </sql>
  82. <select id="findList" parameterType="com.iformall.domain.po.WxMall" resultMap="BaseResultMap">
  83. select
  84. <include refid="allColumns"/>
  85. from wx_mall
  86. <include refid="dynamicWhereConditions"/>
  87. </select>
  88. <update id="updateToken" parameterType="com.iformall.domain.po.WxMall">
  89. update wx_mall set token=#{token},expired_time=#{expiredTime} where id=#{id}
  90. </update>
  91. </mapper>