后台服务
Você não pode selecionar mais de 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.

WxMallBuildingMapper.xml 2.7 KiB

2 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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.WxMallBuildingMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMallBuilding">
  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="mall_id" jdbcType="BIGINT" property="mallId" />
  9. <!--<result column="building_name" jdbcType="VARCHAR" property="name" />-->
  10. <result column="building_name" jdbcType="VARCHAR" property="buildingName" />
  11. <result column="floor_number" jdbcType="INTEGER" property="floorNumber" />
  12. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  13. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  14. </resultMap>
  15. <sql id="allColumns">
  16. `id`,`tenant_id`,`parent_tenant_id`,`mall_id`,`building_name`,`floor_number`,`create_date`,`update_date`
  17. </sql>
  18. <sql id="dynamicWhereConditions">
  19. where 1 = 1
  20. <if test=" null != id ">
  21. and `id` = #{id}
  22. </if>
  23. <if test=" null != tenantId and '' != tenantId">
  24. and `tenant_id` = #{tenantId}
  25. </if>
  26. <if test=" null != parentTenantId and '' != parentTenantId">
  27. and `parent_tenant_id` = #{parentTenantId}
  28. </if>
  29. <if test=" null != mallId ">
  30. and `mall_id` = #{mallId}
  31. </if>
  32. <if test=" null != name ">
  33. and `building_name` like concat('%', #{name},'%')
  34. </if>
  35. <if test=" null != floorNumber ">
  36. and `floor_number` = #{floorNumber}
  37. </if>
  38. <if test=" null != createDate ">
  39. and `create_date` = #{createDate}
  40. </if>
  41. <if test=" null != updateDate ">
  42. and `update_date` = #{updateDate}
  43. </if>
  44. <if test=" null != ids ">
  45. and id in
  46. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  47. #{idItem}
  48. </foreach>
  49. </if>
  50. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  51. </sql>
  52. <select id="findList" parameterType="com.iformall.domain.po.WxMallBuilding" resultMap="BaseResultMap">
  53. select
  54. <include refid="allColumns"/>
  55. from wx_mall_building
  56. <include refid="dynamicWhereConditions" />
  57. </select>
  58. <delete id="deleteByTenantId">
  59. delete from wx_mall_building where `tenant_id` = #{tenantId}
  60. </delete>
  61. <select id="findIdAndName" resultMap="BaseResultMap">
  62. select
  63. `id`,`building_name`
  64. from wx_mall_building
  65. where `tenant_id` = #{tenantId}
  66. </select>
  67. </mapper>