You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
3.3 KiB
99 lines
3.3 KiB
<?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.ccsens.mt.persist.dao.CompeteVideoDao">
|
|
|
|
<select id="selectCompanySignStatus" parameterType="com.ccsens.mt.bean.dto.VideoDto$GetSignStatus" resultType="com.ccsens.mt.bean.vo.VideoProjectVo$PeoSignStatu">
|
|
select
|
|
tcc.name as name,
|
|
tcc.`contacts_phone` as phone,
|
|
tcpl.`look_time` as `time`
|
|
from
|
|
(
|
|
SELECT
|
|
*
|
|
FROM
|
|
(
|
|
SELECT
|
|
tcc.*,
|
|
(
|
|
IF
|
|
(
|
|
(
|
|
( tcp.id IN ( SELECT t_compete_project_player.player_id FROM t_compete_project_player WHERE t_compete_project_player.rec_status = 0 ) )
|
|
OR ( tcp.id IN ( SELECT t_compete_team_member.player_id FROM t_compete_team_member WHERE t_compete_team_member.rec_status = 0 ) )
|
|
),
|
|
1,
|
|
0
|
|
)
|
|
) AS `after`
|
|
FROM
|
|
t_compete_company tcc
|
|
LEFT JOIN t_compete_player tcp ON tcp.company_id = tcc.id
|
|
WHERE
|
|
tcc.rec_status = 0
|
|
AND tcp.rec_status = 0
|
|
AND tcc.compete_time_id = 1
|
|
) t
|
|
WHERE
|
|
`after` != 0
|
|
GROUP BY
|
|
t.id
|
|
) tcc
|
|
LEFT JOIN t_compete_time tct on tct.id=tcc.compete_time_id
|
|
LEFT JOIN (
|
|
select company_id,max(look_time) as `look_time`
|
|
FROM t_compete_player_look
|
|
where `rec_status`=0
|
|
<if test="param.signEndTime!=null">
|
|
and t_compete_player_look.`look_time` <= #{param.signEndTime,jdbcType=TIMESTAMP}
|
|
</if>
|
|
group by company_id
|
|
) tcpl on tcpl.company_id=tcc.id
|
|
where
|
|
tct.id= #{param.id}
|
|
<if test="param.name!=null and param.name!=''">
|
|
and tcc.`name` like concat('%',#{param.name},'%')
|
|
</if>
|
|
<if test="param.phone!=null and param.phone!=''">
|
|
and tcc.`contacts_name` like concat('%',#{param.phone},'%')
|
|
</if>
|
|
and tcc.`rec_status`=0
|
|
and tct.`rec_status`=0
|
|
</select>
|
|
<select id="selectCoachSignStatus" parameterType="com.ccsens.mt.bean.dto.VideoDto$GetSignStatus" resultType="com.ccsens.mt.bean.vo.VideoProjectVo$CoachSignStatu" >
|
|
select
|
|
tcj.`name` as `name`,
|
|
tcj.`phone` as `phone`,
|
|
tcj.`chief_judgment` as `chiefJudgment`,
|
|
(UNIX_TIMESTAMP(tt.`cr`) * 1000) as `time`,
|
|
tt.`cr` as dateTime
|
|
FROM
|
|
t_compete_judgment tcj
|
|
left join tall.t_pro_member ttpm on tcj.member_id=ttpm.id and ttpm.user_id != 0
|
|
|
|
left join (
|
|
select
|
|
max(created_at) as cr,
|
|
user_id
|
|
From tall.t_sys_log
|
|
|
|
where `url`='/users/signin' and `rec_status`=0 and user_id != 0
|
|
<if test="param.signEndTime!=null">
|
|
and tall.t_sys_log.created_at <= #{param.signEndTime,jdbcType=TIMESTAMP}
|
|
</if>
|
|
GROUP BY tall.t_sys_log.user_id
|
|
) tt on tt.`user_id`=ttpm.`user_id`
|
|
LEFT JOIN t_compete_time tct on tct.id =tcj.`compete_time_id`
|
|
WHERE
|
|
tct.id=#{param.id}
|
|
<if test="param.name!=null and param.name!=''">
|
|
and tcj.`name` like CONCAT('%',#{param.name},'%')
|
|
</if>
|
|
<if test="param.phone!=null and param.phone!=''">
|
|
and tcj.`phone`like concat('%',#{param.phone},'%')
|
|
</if>
|
|
and tcj.`rec_status`=0
|
|
and tct.`rec_status`=0
|
|
|
|
</select>
|
|
</mapper>
|