| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- <?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.goafanti.common.dao.ActivityUserMapper" >
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.ActivityUser" >
- <id column="aid" property="aid" jdbcType="BIGINT" />
- <id column="uid" property="uid" jdbcType="VARCHAR" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="last_update_time" property="lastUpdateTime" jdbcType="TIMESTAMP" />
- </resultMap>
- <sql id="Base_Column_List" >
- aid, uid, create_time, last_update_time
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.goafanti.common.model.ActivityUserKey" >
- select
- <include refid="Base_Column_List" />
- from activity_user
- where aid = #{aid,jdbcType=BIGINT}
- and uid = #{uid,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="com.goafanti.common.model.ActivityUserKey" >
- delete from activity_user
- where aid = #{aid,jdbcType=BIGINT}
- and uid = #{uid,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.ActivityUser" >
- insert into activity_user (aid, uid, create_time,
- last_update_time)
- values (#{aid,jdbcType=BIGINT}, #{uid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
- #{lastUpdateTime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.ActivityUser" >
- insert into activity_user
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="aid != null" >
- aid,
- </if>
- <if test="uid != null" >
- uid,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- <if test="lastUpdateTime != null" >
- last_update_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="aid != null" >
- #{aid,jdbcType=BIGINT},
- </if>
- <if test="uid != null" >
- #{uid,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="lastUpdateTime != null" >
- #{lastUpdateTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ActivityUser" >
- update activity_user
- <set >
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="lastUpdateTime != null" >
- last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where aid = #{aid,jdbcType=BIGINT}
- and uid = #{uid,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ActivityUser" >
- update activity_user
- set create_time = #{createTime,jdbcType=TIMESTAMP},
- last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP}
- where aid = #{aid,jdbcType=BIGINT}
- and uid = #{uid,jdbcType=VARCHAR}
- </update>
-
- <select id="selectByUid" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from activity_user
- where uid = #{uid,jdbcType=VARCHAR}
- </select>
-
- <select id="findActivityUserListByPage" parameterType="String" resultType="com.goafanti.activityUser.bo.ActivityUserListBo">
- select
- au.aid,
- au.uid,
- au.create_time as createTime,
- au.last_update_time as lastUpdateTime,
- a.name as activityName,
- u.number,
- u.mobile,
- ui.username,
- a.start_time as startTime,
- a.end_time as endTime,
- a.enroll_deadline as enrollDeadline
- from activity_user au
- left join user u on u.id = au.uid
- left join user_identity ui on ui.uid = au.uid
- left join activity a on a.id = au.aid
- where u.type = 0
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="activityName != null">
- and a.name like CONCAT('%',#{activityName,jdbcType=VARCHAR},'%')
- </if>
- <if test="username != null">
- and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
- </if>
- order by au.last_update_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findActivityUserCount" parameterType="String" resultType="java.lang.Integer">
- select
- count(1)
- from activity_user au
- left join user u on u.id = au.uid
- left join user_identity ui on ui.uid = au.uid
- left join activity a on a.id = au.aid
- where u.type = 0
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="activityName != null">
- and a.name like CONCAT('%',#{activityName,jdbcType=VARCHAR},'%')
- </if>
- <if test="username != null">
- and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
- </if>
- </select>
-
- <select id="findActivityOrgListByPage" parameterType="String" resultType="com.goafanti.activityUser.bo.ActivityUserListBo">
- select
- au.aid,
- au.uid,
- au.create_time as createTime,
- au.last_update_time as lastUpdateTime,
- a.name as activityName,
- u.number,
- u.mobile,
- oi.unit_name as unitName,
- a.start_time as startTime,
- a.end_time as endTime,
- a.enroll_deadline as enrollDeadline
- from activity_user au
- left join user u on u.id = au.uid
- left join organization_identity oi on oi.uid = au.uid
- left join activity a on a.id = au.aid
- where u.type = 1
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="activityName != null">
- and a.name like CONCAT('%',#{activityName,jdbcType=VARCHAR},'%')
- </if>
- <if test="unitName != null">
- and ui.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
- </if>
- order by au.last_update_time desc
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
-
- <select id="findActivityOrgCount" parameterType="String" resultType="java.lang.Integer">
- select
- count(1)
- from activity_user au
- left join user u on u.id = au.uid
- left join organization_identity oi on oi.uid = au.uid
- left join activity a on a.id = au.aid
- where u.type = 1
- <if test="mobile != null">
- and u.mobile = #{mobile,jdbcType=VARCHAR}
- </if>
- <if test="number != null">
- and u.number = #{number,jdbcType=INTEGER}
- </if>
- <if test="activityName != null">
- and a.name like CONCAT('%',#{activityName,jdbcType=VARCHAR},'%')
- </if>
- <if test="unitName != null">
- and ui.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
- </if>
- </select>
- </mapper>
|