后台服务
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.

76 lines
2.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.WxBrandMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBrand">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="name" jdbcType="VARCHAR" property="name" />
  7. <result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
  8. <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
  9. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  10. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  11. <result column="logo" jdbcType="VARCHAR" property="logo"/>
  12. <result column="summary" jdbcType="VARCHAR" property="summary"/>
  13. <result column="createdate" jdbcType="TIMESTAMP" property="createdate"/>
  14. <result column="is_del" property="isDel"/>
  15. </resultMap>
  16. <sql id="allColumns">
  17. `id`,`name`,`createtime`,`updatetime`,`tenant_id`,`parent_tenant_id`,`logo`,`summary`,`createdate`,is_del
  18. </sql>
  19. <sql id="dynamicWhereConditions">
  20. where is_del = 0
  21. <if test=" null != id "> and `id` = #{id} </if>
  22. <if test=" null != name "> and `name` like concat('%',#{name},'%') </if>
  23. <if test=" null != createtime "> and `createtime` = #{createtime} </if>
  24. <if test=" null != updatetime "> and `updatetime` = #{updatetime} </if>
  25. <if test=" null != tenantId and '' != tenantId">
  26. and `tenant_id` = #{tenantId}
  27. </if>
  28. <if test=" null != parentTenantId and '' != parentTenantId">
  29. and `parent_tenant_id` = #{parentTenantId}
  30. </if>
  31. <if test=" null != ids ">
  32. and id in
  33. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  34. #{idItem}
  35. </foreach>
  36. </if>
  37. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  38. </sql>
  39. <select id="findList" parameterType="com.iformall.domain.po.WxBrand" resultMap="BaseResultMap">
  40. select <include refid="allColumns" /> from wx_brand
  41. <include refid="dynamicWhereConditions" />
  42. </select>
  43. <select id="queryBrandByTenant" parameterType="com.iformall.domain.po.WxBrand" resultType="hashmap">
  44. select id,`name` value from wx_brand
  45. where is_del = 0
  46. <if test=" null != tenantId and '' != tenantId">
  47. and `tenant_id` = #{tenantId}
  48. </if>
  49. <if test=" null != parentTenantId and '' != parentTenantId">
  50. and `parent_tenant_id` = #{parentTenantId}
  51. </if>
  52. </select>
  53. <select id="hasBrand" parameterType="com.iformall.domain.po.WxBrand" resultType="Integer">
  54. select count(*) from wx_brand
  55. <where>
  56. <if test=" null != name "> and `name` = #{name} </if>
  57. <if test=" null != tenantId and '' != tenantId">
  58. and `tenant_id` = #{tenantId}
  59. </if>
  60. <if test=" null != parentTenantId and '' != parentTenantId">
  61. and `parent_tenant_id` = #{parentTenantId}
  62. </if>
  63. <if test=" null != id">
  64. and id != #{id}
  65. </if>
  66. </where>
  67. </select>
  68. </mapper>