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

WxMsgModelMapper.xml 4.0 KiB

2 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  8. <result column="name" jdbcType="VARCHAR" property="name"/>
  9. <result column="signature" jdbcType="VARCHAR" property="signature"/>
  10. <result column="content" jdbcType="VARCHAR" property="content"/>
  11. <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
  12. <result column="status" jdbcType="INTEGER" property="status"/>
  13. <result column="reason" jdbcType="INTEGER" property="reason"/>
  14. <result column="model_id" jdbcType="INTEGER" property="modelId"/>
  15. <result column="template_type" jdbcType="INTEGER" property="templateType"/>
  16. <result column="model_code" jdbcType="VARCHAR" property="modelCode"/>
  17. </resultMap>
  18. <sql id="allColumns">
  19. `id`,`tenant_id`,`parent_tenant_id`,`name`,`signature`,`content`,`createtime`,`status`,`reason`,`model_id`,`template_type`,`model_code`
  20. </sql>
  21. <sql id="dynamicWhereConditions">
  22. where 1 = 1
  23. <if test=" null != id ">
  24. and `id` = #{id}
  25. </if>
  26. <if test=" null != tenantId and '' != tenantId">
  27. and `tenant_id` = #{tenantId}
  28. </if>
  29. <if test=" null != parentTenantId and '' != parentTenantId">
  30. and `parent_tenant_id` = #{parentTenantId}
  31. </if>
  32. <if test=" null != name and ''!= name">
  33. and `name` = #{name}
  34. </if>
  35. <if test=" null != signature ">
  36. and `signature` = #{signature}
  37. </if>
  38. <if test=" null != content ">
  39. and `content` = #{content}
  40. </if>
  41. <if test=" null != createtime ">
  42. and `createtime` = #{createtime}
  43. </if>
  44. <if test=" null != status ">
  45. and `status` = #{status}
  46. </if>
  47. <if test=" null != modelId">
  48. and `model_id` = #{modelId}
  49. </if>
  50. <if test=" null != templateType">
  51. and `template_type` = #{templateType}
  52. </if>
  53. <if test=" null != modelCode">
  54. and `model_code` = #{modelCode}
  55. </if>
  56. <if test=" null != ids ">
  57. and id in
  58. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  59. #{idItem}
  60. </foreach>
  61. </if>
  62. <if test=" null != sortColumns">order by ${sortColumns}</if>
  63. </sql>
  64. <select id="findList" parameterType="com.iformall.domain.po.WxMsgModel" resultMap="BaseResultMap">
  65. select
  66. <include refid="allColumns"/>
  67. from wx_msg_model
  68. <include refid="dynamicWhereConditions"/>
  69. </select>
  70. <select id="findAliYunList" parameterType="com.iformall.domain.po.WxMsgModel" resultMap="BaseResultMap">
  71. select
  72. <include refid="allColumns"/>
  73. from wx_msg_model
  74. where ifnull(model_code,'') != ''
  75. and `status` = #{status}
  76. </select>
  77. <select id="findOneByModelId" parameterType="com.iformall.domain.po.WxMsgModel" resultMap="BaseResultMap">
  78. select
  79. <include refid="allColumns"/>
  80. from wx_msg_model
  81. where 1=1
  82. <if test=" null != modelId">
  83. and `model_id` = #{modelId}
  84. </if>
  85. <if test=" null != tenantId and '' != tenantId">
  86. and `tenant_id` = #{tenantId}
  87. </if>
  88. <if test=" null != parentTenantId and '' != parentTenantId">
  89. and `parent_tenant_id` = #{parentTenantId}
  90. </if>
  91. limit 1
  92. </select>
  93. <update id="updateByCode" parameterType="com.iformall.domain.po.WxMsgModel">
  94. update wx_msg_model set status=#{status},reason=#{reason} where `model_code` = #{modelCode}
  95. </update>
  96. </mapper>