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.
 
 
 
 
 

131 rivejä
3.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. <result column="signature" jdbcType="VARCHAR" property="signature" />
  17. <result column="isright" jdbcType="INTEGER" property="isright" />
  18. <result column="name" jdbcType="VARCHAR" property="name" />
  19. <result column="sendstatus" jdbcType="INTEGER" property="sendstatus" />
  20. <result column="excelpath" jdbcType="VARCHAR" property="excelpath" />
  21. <result column="label" jdbcType="VARCHAR" property="label" />
  22. <result column="status" jdbcType="INTEGER" property="status" />
  23. </resultMap>
  24. <sql id="allColumns">
  25. `id`,`tenant_id`,`model_id`,`msg`,`sendtime`,`createtime`,`expect_send_number`,`success_number`,`error_number`,`return_result`,`phones`,`signature`,`isright`,`name`,`sendstatus`,`excelpath`,`label`,`status`
  26. </sql>
  27. <sql id="dynamicWhereConditions">
  28. where 1 = 1
  29. <if test=" null != id ">
  30. and `id` = #{id}
  31. </if>
  32. <if test=" null != tenantId ">
  33. and `tenant_id` = #{tenantId}
  34. </if>
  35. <if test=" null != modelId ">
  36. and `model_id` = #{modelId}
  37. </if>
  38. <if test=" null != msg ">
  39. and `msg` like concat('%', #{msg},'%')
  40. </if>
  41. <if test=" null != sendtime ">
  42. and `sendtime` = #{sendtime}
  43. </if>
  44. <if test=" null != createtime ">
  45. and `createtime` = #{createtime}
  46. </if>
  47. <if test=" null != expectSendNumber ">
  48. and `expect_send_number` like concat('%', #{expectSendNumber},'%')
  49. </if>
  50. <if test=" null != successNumber ">
  51. and `success_number` like concat('%', #{successNumber},'%')
  52. </if>
  53. <if test=" null != errorNumber ">
  54. and `error_number` like concat('%', #{errorNumber},'%')
  55. </if>
  56. <if test=" null != returnResult ">
  57. and `return_result` like concat('%', #{returnResult},'%')
  58. </if>
  59. <if test=" null != phones ">
  60. and `phones` like concat('%', #{phones},'%')
  61. </if>
  62. <if test=" null != signature ">
  63. and `signature` like concat('%', #{signature},'%')
  64. </if>
  65. <if test=" null != isright ">
  66. and `isright` = #{isright}
  67. </if>
  68. <if test=" null != name ">
  69. and `name` like concat('%', #{name},'%')
  70. </if>
  71. <if test=" null != sendstatus ">
  72. and `sendstatus` = #{sendstatus}
  73. </if>
  74. <if test=" null != status ">
  75. and `status` = #{status}
  76. </if>
  77. <if test=" null != ids ">
  78. and id in
  79. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  80. #{idItem}
  81. </foreach>
  82. </if>
  83. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  84. </sql>
  85. <select id="findList" parameterType="com.simple.domain.po.WxMsg" resultMap="BaseResultMap">
  86. select <include refid="allColumns" /> from wx_msg
  87. <include refid="dynamicWhereConditions" />
  88. </select>
  89. </mapper>