|
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.simple.mapper.WxMsgMapper">
- <resultMap id="BaseResultMap" type="com.simple.domain.po.WxMsg">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
- <result column="model_id" jdbcType="BIGINT" property="modelId" />
- <result column="msg" jdbcType="VARCHAR" property="msg" />
- <result column="sendtime" jdbcType="TIMESTAMP" property="sendtime" />
- <result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
- <result column="expect_send_number" jdbcType="VARCHAR" property="expectSendNumber" />
- <result column="success_number" jdbcType="VARCHAR" property="successNumber" />
- <result column="error_number" jdbcType="VARCHAR" property="errorNumber" />
- <result column="return_result" jdbcType="VARCHAR" property="returnResult" />
- <result column="phones" jdbcType="VARCHAR" property="phones" />
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`model_id`,`msg`,`sendtime`,`createtime`,`expect_send_number`,`success_number`,`error_number`,`return_result`,`phones`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
-
- <if test=" null != id ">
- and `id` = #{id}
-
- </if>
-
- <if test=" null != tenantId ">
- and `tenant_id` like concat('%', #{tenantId},'%')
-
- </if>
-
- <if test=" null != modelId ">
- and `model_id` = #{modelId}
-
- </if>
-
- <if test=" null != msg ">
- and `msg` like concat('%', #{msg},'%')
-
- </if>
-
- <if test=" null != sendtime ">
- and `sendtime` = #{sendtime}
-
- </if>
-
- <if test=" null != createtime ">
- and `createtime` = #{createtime}
-
- </if>
-
- <if test=" null != expectSendNumber ">
- and `expect_send_number` like concat('%', #{expectSendNumber},'%')
-
- </if>
-
- <if test=" null != successNumber ">
- and `success_number` like concat('%', #{successNumber},'%')
-
- </if>
-
- <if test=" null != errorNumber ">
- and `error_number` like concat('%', #{errorNumber},'%')
-
- </if>
-
- <if test=" null != returnResult ">
- and `return_result` like concat('%', #{returnResult},'%')
-
- </if>
-
- <if test=" null != phones ">
- and `phones` like concat('%', #{phones},'%')
-
- </if>
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns"> order by ${sortColumns} </if>
- </sql>
-
- <select id="findList" parameterType="com.simple.domain.po.WxMsg" resultMap="BaseResultMap">
- select <include refid="allColumns" /> from wx_msg
- <include refid="dynamicWhereConditions" />
- </select>
-
-
-
-
-
-
- </mapper>
|