7 changed files with 191 additions and 10 deletions
@ -0,0 +1,29 @@ |
|||
package com.ccsens.mt.persist.dao; |
|||
|
|||
import com.ccsens.mt.bean.vo.CompeteVo; |
|||
import com.ccsens.mt.persist.mapper.CompeteTimeMapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Repository |
|||
public interface CompeteTimeDao extends CompeteTimeMapper { |
|||
/** |
|||
* 通过类型查找第几届和时间 |
|||
* @param type 类型 |
|||
* @param time 当前时间 |
|||
* @return 返回当前这一届的信息 |
|||
*/ |
|||
CompeteVo.CompeteTime getCompeteTimeByType(@Param("type") int type, @Param("time") long time); |
|||
|
|||
/** |
|||
* 根据类型查看所有的组别 |
|||
* @param type 类型 |
|||
* @return 返回类型下的所有组别 |
|||
*/ |
|||
List<CompeteVo.CompeteGroup> queryCompeteGroupByType(@Param("type") int type); |
|||
} |
@ -0,0 +1,41 @@ |
|||
<?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.CompeteTimeDao"> |
|||
|
|||
<select id="getCompeteTimeByType" parameterType="java.util.Map" resultType="com.ccsens.mt.bean.vo.CompeteVo$CompeteTime"> |
|||
SELECT |
|||
id, |
|||
`name`, |
|||
type, |
|||
start_time as startTime, |
|||
end_time as endTime, |
|||
sign_up_start_time as signUpStartTime, |
|||
sign_up_end_time as signUpEndTime, |
|||
compete_status as competeStatus |
|||
FROM |
|||
`t_compete_time` |
|||
WHERE |
|||
rec_status = 0 |
|||
and |
|||
`type` = #{type} |
|||
and |
|||
start_time <= #{time} |
|||
and |
|||
end_time > #{time} |
|||
</select> |
|||
|
|||
<select id="queryCompeteGroupByType" parameterType="java.util.Map" resultType="com.ccsens.mt.bean.vo.CompeteVo$CompeteGroup"> |
|||
SELECT |
|||
id as groupId, |
|||
group_name as groupName, |
|||
description as groupDescription |
|||
FROM |
|||
t_compete_group |
|||
WHERE |
|||
rec_status = #{type} |
|||
and |
|||
type = 0 |
|||
ORDER BY sequence |
|||
</select> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue