Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

99 wiersze
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.simple.mapper.WxMsgMapper">
  4. <resultMap id="BaseResultMap" type="com.simple.domain.po.WxMsg">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="model_id" jdbcType="BIGINT" property="modelId" />
  8. <result column="msg" jdbcType="VARCHAR" property="msg" />
  9. <result column="sendtime" jdbcType="TIMESTAMP" property="sendtime" />
  10. <result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
  11. <result column="expect_send_number" jdbcType="VARCHAR" property="expectSendNumber" />
  12. <result column="success_number" jdbcType="VARCHAR" property="successNumber" />
  13. <result column="error_number" jdbcType="VARCHAR" property="errorNumber" />
  14. <result column="return_result" jdbcType="VARCHAR" property="returnResult" />
  15. <result column="phones" jdbcType="VARCHAR" property="phones" />
  16. </resultMap>
  17. <sql id="allColumns">
  18. `id`,`tenant_id`,`model_id`,`msg`,`sendtime`,`createtime`,`expect_send_number`,`success_number`,`error_number`,`return_result`,`phones`
  19. </sql>
  20. <sql id="dynamicWhereConditions">
  21. where 1 = 1
  22. <if test=" null != id ">
  23. and `id` = #{id}
  24. </if>
  25. <if test=" null != tenantId ">
  26. and `tenant_id` like concat('%', #{tenantId},'%')
  27. </if>
  28. <if test=" null != modelId ">
  29. and `model_id` = #{modelId}
  30. </if>
  31. <if test=" null != msg ">
  32. and `msg` like concat('%', #{msg},'%')
  33. </if>
  34. <if test=" null != sendtime ">
  35. and `sendtime` = #{sendtime}
  36. </if>
  37. <if test=" null != createtime ">
  38. and `createtime` = #{createtime}
  39. </if>
  40. <if test=" null != expectSendNumber ">
  41. and `expect_send_number` like concat('%', #{expectSendNumber},'%')
  42. </if>
  43. <if test=" null != successNumber ">
  44. and `success_number` like concat('%', #{successNumber},'%')
  45. </if>
  46. <if test=" null != errorNumber ">
  47. and `error_number` like concat('%', #{errorNumber},'%')
  48. </if>
  49. <if test=" null != returnResult ">
  50. and `return_result` like concat('%', #{returnResult},'%')
  51. </if>
  52. <if test=" null != phones ">
  53. and `phones` like concat('%', #{phones},'%')
  54. </if>
  55. <if test=" null != ids ">
  56. and id in
  57. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  58. #{idItem}
  59. </foreach>
  60. </if>
  61. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  62. </sql>
  63. <select id="findList" parameterType="com.simple.domain.po.WxMsg" resultMap="BaseResultMap">
  64. select <include refid="allColumns" /> from wx_msg
  65. <include refid="dynamicWhereConditions" />
  66. </select>
  67. </mapper>