|
|
@@ -86,4 +86,120 @@
|
|
|
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>
|