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.
 
 
 
 
 

57 lines
2.0 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.TtMallImMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.TtMallIm">
  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="im_id" jdbcType="VARCHAR" property="imId"/>
  9. <result column="name" jdbcType="VARCHAR" property="name"/>
  10. <result column="status" jdbcType="INTEGER" property="status" />
  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`,`im_id`,`name`,`status`,`create_date`,`update_date`
  16. </sql>
  17. <sql id="dynamicWhereConditions">
  18. where `is_del` = 0
  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 != imId and '' != imId">
  29. and `im_id` = #{imId}
  30. </if>
  31. <if test=" null != name and '' != name">
  32. and `name` like concat('%', #{name},'%')
  33. </if>
  34. <if test=" null != ids ">
  35. and `id` in
  36. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  37. #{idItem}
  38. </foreach>
  39. </if>
  40. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  41. </sql>
  42. <select id="findList" parameterType="com.iformall.domain.po.TtMallIm" resultMap="BaseResultMap">
  43. select <include refid="allColumns" /> from tt_mall_im
  44. <include refid="dynamicWhereConditions" />
  45. </select>
  46. <delete id="deleteById" parameterType="Long">
  47. update tt_mall_im set is_del = 1,update_date=now() where id = #{id}
  48. </delete>
  49. </mapper>