| | |
| | | <result column="ctime" jdbcType="TIMESTAMP" property="ctime"/> |
| | | <result column="status" jdbcType="VARCHAR" property="status"/> |
| | | <result column="menu_ids" jdbcType="VARCHAR" property="menuIds"/> |
| | | <result column="start_time" jdbcType="TIMESTAMP" property="startTime"/> |
| | | <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id |
| | | , name, paper_type, suggest_time, title_name, ctime, status, menu_ids |
| | | , name, paper_type, suggest_time, title_name, ctime, status, menu_ids,start_time,end_time |
| | | </sql> |
| | | |
| | | <insert id="add" parameterType="com.mindskip.xzs.domain.ExamTemplates" useGeneratedKeys="true" keyProperty="id"> |
| | | insert into t_exam_templates (name, paper_type, suggest_time, title_name, ctime, status, menu_ids) |
| | | values (#{name}, #{paperType}, #{suggestTime}, #{titleName}, #{ctime}, #{status}, #{menuIds}) |
| | | insert into t_exam_templates (name, paper_type, suggest_time, title_name, ctime, status, menu_ids,start_time,end_time) |
| | | values (#{name}, #{paperType}, #{suggestTime}, #{titleName}, #{ctime}, #{status}, #{menuIds},#{startTime},#{endTime}) |
| | | </insert> |
| | | |
| | | <select id="getTime" resultMap="BaseResultMap"> |
| | |
| | | from t_exam_templates e |
| | | inner join t_exam_templates_user u on e.id = u.templates_id |
| | | <where> |
| | | paper_type != 7 |
| | | <if test="status != null"> |
| | | and e.status = 0 |
| | | </if> |
| | |
| | | and u.user_id = #{userId} |
| | | </if> |
| | | </where> |
| | | union all |
| | | select |
| | | e.* |
| | | from t_exam_templates e |
| | | inner join t_exam_templates_user u on e.id = u.templates_id |
| | | <where> |
| | | paper_type = 7 |
| | | <if test="status != null"> |
| | | and e.status = 0 |
| | | </if> |
| | | <if test="status == null"> |
| | | and e.status is null |
| | | </if> |
| | | <if test="userId != null"> |
| | | and u.user_id = #{userId} |
| | | </if> |
| | | <if test="now !=null"> |
| | | and #{now} between e.start_time and e.end_time |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |