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.
 
 
 
 
 

92 lines
2.5 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.WxMsgModelMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMsgModel">
  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="signature" jdbcType="VARCHAR" property="signature" />
  9. <result column="content" jdbcType="VARCHAR" property="content" />
  10. <result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
  11. <result column="status" jdbcType="INTEGER" property="status" />
  12. <result column="model_id" jdbcType="INTEGER" property="modelId" />
  13. </resultMap>
  14. <sql id="allColumns">
  15. `id`,`tenant_id`,`name`,`signature`,`content`,`createtime`,`status`,`model_id`
  16. </sql>
  17. <sql id="dynamicWhereConditions">
  18. where 1 = 1
  19. <if test=" null != id ">
  20. and `id` = #{id}
  21. </if>
  22. <if test=" null != tenantId ">
  23. and `tenant_id`=#{tenantId}
  24. </if>
  25. <if test=" null != name and ''!= name">
  26. and `name` = #{name}
  27. </if>
  28. <if test=" null != signature ">
  29. and `signature` = #{signature}
  30. </if>
  31. <if test=" null != content ">
  32. and `content` = #{content}
  33. </if>
  34. <if test=" null != createtime ">
  35. and `createtime` = #{createtime}
  36. </if>
  37. <if test=" null != status ">
  38. and `status` = #{status}
  39. </if>
  40. <if test=" null != modelId">
  41. and `model_id` = #{modelId}
  42. </if>
  43. <if test=" null != ids ">
  44. and id in
  45. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  46. #{idItem}
  47. </foreach>
  48. </if>
  49. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  50. </sql>
  51. <select id="findList" parameterType="com.iformall.domain.po.WxMsgModel" resultMap="BaseResultMap">
  52. select <include refid="allColumns" /> from wx_msg_model
  53. <include refid="dynamicWhereConditions" />
  54. </select>
  55. <select id="findOneByModelId" parameterType="com.iformall.domain.po.WxMsgModel" resultMap="BaseResultMap">
  56. select <include refid="allColumns" /> from wx_msg_model
  57. where 1=1
  58. <if test=" null != modelId">
  59. and `model_id` = #{modelId}
  60. </if>
  61. <if test=" null != tenantId ">
  62. and `tenant_id`=#{tenantId}
  63. </if>
  64. limit 1
  65. </select>
  66. </mapper>