|
@@ -40,6 +40,46 @@
|
|
|
, t.update_time_ as "updateTime"
|
|
|
</sql>
|
|
|
|
|
|
+ <select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo">
|
|
|
+ select
|
|
|
+ <include refid="baseColumns"/>,
|
|
|
+ ifnull(u.real_name_,u.username_) as realName,
|
|
|
+ u.id_card_no_ as idCardNo,
|
|
|
+ u.phone_ as phone,
|
|
|
+ u.username_ as username,
|
|
|
+ u.gender_ as gender,
|
|
|
+ (
|
|
|
+ SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
|
|
|
+ ) as subjectName,
|
|
|
+ (
|
|
|
+ SELECT u.username_ FROM sys_user u WHERE u.id_ = t.verify_user_id_
|
|
|
+ ) as verifyUser
|
|
|
+ from teacher_auth_entry_record t
|
|
|
+ left join sys_user u on t.user_id_ = u.id_
|
|
|
+ where u.del_flag_ = 0 and t.id_ = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="lastDetil" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo">
|
|
|
+ select
|
|
|
+ <include refid="baseColumns"/>,
|
|
|
+ ifnull(u.real_name_,u.username_) as realName,
|
|
|
+ u.id_card_no_ as idCardNo,
|
|
|
+ u.phone_ as phone,
|
|
|
+ u.username_ as username,
|
|
|
+ u.gender_ as gender,
|
|
|
+ (
|
|
|
+ SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
|
|
|
+ ) as subjectName,
|
|
|
+ (
|
|
|
+ SELECT u.username_ FROM sys_user u WHERE u.id_ = t.verify_user_id_
|
|
|
+ ) as verifyUser
|
|
|
+ from teacher_auth_entry_record t
|
|
|
+ left join sys_user u on t.user_id_ = u.id_
|
|
|
+ where u.del_flag_ = 0 and t.user_id_ = #{userId}
|
|
|
+ and t.id_ != #{id}
|
|
|
+ order by t.create_time_ desc limit 1
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="selectPage" resultType = "com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo">
|
|
|
SELECT
|
|
@@ -53,52 +93,89 @@
|
|
|
(
|
|
|
SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
|
|
|
) as subjectName
|
|
|
- FROM teacher_auth_entry_record t
|
|
|
+ FROM (
|
|
|
+ select user_id_,max(id_) as id_ from teacher_auth_entry_record group by user_id_
|
|
|
+ ) a
|
|
|
+ left join teacher_auth_entry_record t on a.id_ = t.id_
|
|
|
left join sys_user u on t.user_id_ = u.id_
|
|
|
left join sys_user v on t.verify_user_id_ = v.id_
|
|
|
<where>
|
|
|
u.del_flag_ = 0
|
|
|
<if test="null != param.search and '' != param.search">
|
|
|
AND (
|
|
|
- t.user_id_ LIKE CONCAT('%', #{param.search}, '%') or
|
|
|
- u.real_name_ LIKE CONCAT('%', #{param.search}, '%') or
|
|
|
- u.phone_ LIKE CONCAT('%', #{param.search}, '%')
|
|
|
+ t.user_id_ LIKE CONCAT('%', #{param.search}, '%') or
|
|
|
+ u.real_name_ LIKE CONCAT('%', #{param.search}, '%') or
|
|
|
+ u.phone_ LIKE CONCAT('%', #{param.search}, '%')
|
|
|
)
|
|
|
</if>
|
|
|
+ <if test="null != param.userId">
|
|
|
+ AND t.user_id_ = #{param.userId}
|
|
|
+ </if>
|
|
|
<if test="null != param.verifyUser and '' != param.verifyUser">
|
|
|
AND v.username_ LIKE CONCAT('%', #{param.verifyUser}, '%')
|
|
|
</if>
|
|
|
- <if test="param.startTime !=null">
|
|
|
+ <if test="param.startTime != null">
|
|
|
<![CDATA[AND t.create_time_ >= #{param.startTime} ]]>
|
|
|
</if>
|
|
|
- <if test="param.endTime !=null">
|
|
|
+ <if test="param.endTime != null">
|
|
|
<![CDATA[AND t.create_time_ < #{param.endTime} ]]>
|
|
|
</if>
|
|
|
- <if test="param.authStatus !=null">
|
|
|
+ <if test="param.authStatus != null">
|
|
|
AND t.teacher_auth_status_ = #{param.authStatus}
|
|
|
</if>
|
|
|
+ <if test="param.teacherAuthType != null">
|
|
|
+ AND t.teacher_auth_type_ = #{param.teacherAuthType}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
order by field(t.teacher_auth_status_,'DOING') desc, t.create_time_ desc
|
|
|
</select>
|
|
|
|
|
|
- <select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo">
|
|
|
- select
|
|
|
- <include refid="baseColumns"/>,
|
|
|
+ <select id="historyPage" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo">
|
|
|
+ SELECT
|
|
|
+ <include refid="baseColumns"/>,
|
|
|
ifnull(u.real_name_,u.username_) as realName,
|
|
|
- u.id_card_no_ as idCardNo,
|
|
|
- u.phone_ as phone,
|
|
|
+ u.id_card_no_ as idCardNo,
|
|
|
+ u.phone_ as phone,
|
|
|
u.username_ as username,
|
|
|
- u.gender_ as gender,
|
|
|
- (
|
|
|
- SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
|
|
|
- ) as subjectName,
|
|
|
+ u.gender_ as gender,
|
|
|
+ v.username_ as verifyUser,
|
|
|
(
|
|
|
- SELECT u.username_ FROM sys_user u WHERE u.id_ = t.verify_user_id_
|
|
|
- ) as verifyUser
|
|
|
- from teacher_auth_entry_record t
|
|
|
+ SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
|
|
|
+ ) as subjectName
|
|
|
+ FROM teacher_auth_entry_record t
|
|
|
left join sys_user u on t.user_id_ = u.id_
|
|
|
- where u.del_flag_ = 0 and t.id_ = #{id}
|
|
|
+ left join sys_user v on t.verify_user_id_ = v.id_
|
|
|
+ <where>
|
|
|
+ u.del_flag_ = 0
|
|
|
+ <if test="null != param.search and '' != param.search">
|
|
|
+ AND (
|
|
|
+ t.user_id_ LIKE CONCAT('%', #{param.search}, '%') or
|
|
|
+ u.real_name_ LIKE CONCAT('%', #{param.search}, '%') or
|
|
|
+ u.phone_ LIKE CONCAT('%', #{param.search}, '%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="null != param.userId">
|
|
|
+ AND t.user_id_ = #{param.userId}
|
|
|
+ </if>
|
|
|
+ <if test="null != param.verifyUser and '' != param.verifyUser">
|
|
|
+ AND v.username_ LIKE CONCAT('%', #{param.verifyUser}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="param.startTime != null">
|
|
|
+ <![CDATA[AND t.create_time_ >= #{param.startTime} ]]>
|
|
|
+ </if>
|
|
|
+ <if test="param.endTime != null">
|
|
|
+ <![CDATA[AND t.create_time_ < #{param.endTime} ]]>
|
|
|
+ </if>
|
|
|
+ <if test="param.authStatus != null">
|
|
|
+ AND t.teacher_auth_status_ = #{param.authStatus}
|
|
|
+ </if>
|
|
|
+ <if test="param.teacherAuthType != null">
|
|
|
+ AND t.teacher_auth_type_ = #{param.teacherAuthType}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by field(t.teacher_auth_status_,'DOING') desc, t.create_time_ desc
|
|
|
</select>
|
|
|
+
|
|
|
<select id="getLastRecordByUserId" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo">
|
|
|
select
|
|
|
<include refid="baseColumns"/>,
|