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.

80 lines
2.9 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">
5 years ago
<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
t_compete_company 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
5 years ago
<if test="param.signEndTime!=null">
and t_compete_player_look.`look_time` &lt;= #{param.signEndTime,jdbcType=TIMESTAMP}
</if>
group by company_id
<!-- select company_id,look_time-->
<!-- From (-->
<!-- select * from t_compete_player_look-->
<!-- where `rec_status`=0-->
<!-- <if test="param.signEndTime!=null">-->
<!-- and t_compete_player_look.`look_time` &lt;= #{param.signEndTime,jdbcType=TIMESTAMP}-->
<!-- </if>-->
<!-- ORDER BY look_time desc-->
<!-- ) group by company id-->
) tcpl on tcpl.company_id=tcc.id
where
tct.id= #{param.id}
5 years ago
<if test="param.name!=null and param.name!=''">
5 years ago
and tcc.`name` like concat('%',#{param.name},'%')
</if>
5 years ago
<if test="param.phone!=null and param.phone!=''">
5 years ago
and tcc.`contacts_name` like concat('%',#{param.phone},'%')
</if>
and tcc.`rec_status`=0
and tct.`rec_status`=0
</select>
5 years ago
<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`,
tt.`cr` as `time`
FROM
t_compete_judgment tcj
5 years ago
left join tall.t_pro_member ttpm on tcj.member_id=ttpm.id
left join (
select
max(created_at) as cr,
user_id
From tall.t_sys_log
5 years ago
where `url`='/users/signin' and `rec_status`=0
5 years ago
<if test="param.signEndTime!=null">
and tall.t_sys_log.created_at &lt;= #{param.signEndTime,jdbcType=TIMESTAMP}
</if>
GROUP BY tall.t_sys_log.user_id
5 years ago
) 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}
5 years ago
<if test="param.name!=null and param.name!=''">
5 years ago
and tcj.`name` like CONCAT('%',#{param.name},'%')
</if>
5 years ago
<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>