|
- <?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.iformall.mapper.WxCAuthorMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCAuthor">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="user_id" jdbcType="BIGINT" property="userId"/>
- <result column="user_name" jdbcType="VARCHAR" property="userName"/>
- <result column="type" jdbcType="INTEGER" property="type"/>
- <result column="resource_id" jdbcType="BIGINT" property="resourceId"/>
- <result column="expire_time" jdbcType="TIMESTAMP" property="expireTime"/>
- </resultMap>
-
- <sql id="allColumns">
- id,user_id,user_name,type,resource_id,expire_time
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1=1
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != userId ">
- and `user_id` = #{userId}
- </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.iformall.domain.po.WxCAuthor" resultMap="BaseResultMap">
- select <include refid="allColumns"/>
- from wx_c_author
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <delete id="deleteByUserId" parameterType="java.util.HashMap">
- delete from wx_c_author where user_id = #{userId}
- </delete>
-
-
- </mapper>
|