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.
64 lines
2.3 KiB
64 lines
2.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.CompeteProjectDao">
|
|
|
|
<select id="getProjectByProjectName" resultType="com.ccsens.mt.bean.po.CompeteProject" parameterType="java.util.Map">
|
|
select * from t_compete_project
|
|
where name = #{projectName}
|
|
and rec_status = 0
|
|
</select>
|
|
|
|
|
|
<select id="getPlayerForSingle" resultType="com.ccsens.mt.bean.vo.TableVo$CompeteJoin" parameterType="java.util.Map">
|
|
select
|
|
tcpro.`name` as competeProject,
|
|
tcg.group_name as competeGroup,
|
|
tcc.`name` as joinTeam,
|
|
tcp.`name` as name,
|
|
tcp.gender as gender,
|
|
tcp.id_card as idCard,
|
|
(2020 - SUBSTR(tcp.id_card FROM 7 FOR 4)) as age
|
|
from t_compete_project tcpro
|
|
LEFT JOIN t_compete_project_player tcpp on tcpro.id = tcpp.project_id
|
|
LEFT JOIN t_compete_player tcp on tcp.id = tcpp.player_id
|
|
LEFT JOIN t_compete_company tcc on tcc.id= tcp.company_id
|
|
LEFT JOIN t_compete_group tcg on tcg.id =tcp.compete_group_id
|
|
WHERE tcpro.`level`=#{level}
|
|
and tcpro.type = #{type}
|
|
and tcpro.team = 0
|
|
and tcpro.rec_status=0
|
|
and tcpp.rec_status =0
|
|
and tcp.rec_status=0
|
|
and tcc.rec_status=0
|
|
and tcg.rec_status=0
|
|
</select>
|
|
|
|
<select id="getPlayerForTeam" resultType="com.ccsens.mt.bean.vo.TableVo$CompeteJoin" parameterType="java.util.Map">
|
|
SELECT
|
|
c.id,
|
|
p.`name` as competeProject,
|
|
g.`group_name` as competeGroup,
|
|
c.`name` as joinTeam,
|
|
pl.`name` as name ,
|
|
pl.id_card as idCard,
|
|
if(pl.gender = 1,'男','女') as gender,
|
|
(2020 - SUBSTR(pl.id_card FROM 7 FOR 4)) as age
|
|
FROM
|
|
t_compete_project p
|
|
LEFT JOIN t_compete_team t on p.id = t.project_id
|
|
LEFT JOIN t_compete_team_member m on t.id = m.compete_team_id
|
|
LEFT JOIN t_compete_company c on t.company_id = c.id
|
|
LEFT JOIN t_compete_player pl on m.player_id = pl.id
|
|
LEFT JOIN t_compete_group g on t.gender_group = g.sex and t.group_remark = g.group_remark
|
|
WHERE
|
|
p.type = #{type}
|
|
and p.`level` = #{level}
|
|
and p.team = 1
|
|
and p.rec_status = 0
|
|
and m.rec_status = 0
|
|
and t.rec_status = 0
|
|
and pl.rec_status = 0
|
|
and g.rec_status = 0
|
|
and c.rec_status = 0
|
|
</select>
|
|
</mapper>
|