|
@@ -20,10 +20,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="registrationNotes" column="registration_notes" />
|
|
|
<result property="competitionState" column="competition_state" />
|
|
|
<result property="viewingTicket" column="viewing_ticket" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createName" column="create_name" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ <result property="updateName" column="update_name" />
|
|
|
+ <result property="publishTime" column="publish_time" />
|
|
|
+ <result property="publishBy" column="publish_by" />
|
|
|
+ <result property="publishName" column="publish_name" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectCompetitionVo">
|
|
|
- select id, competition_title, competition_type, person_max, team_max, competition_place, apply_start_time, apply_end_time, apply_before_time, competition_maximum, competition_expense, viewing_ticket, competition_details, registration_notes, competition_state from competition
|
|
|
+ select id, competition_title, competition_type, person_max, team_max,
|
|
|
+ competition_place, apply_start_time, apply_end_time, apply_before_time,
|
|
|
+ competition_maximum, competition_expense, viewing_ticket,
|
|
|
+ competition_details, registration_notes, competition_state,
|
|
|
+ create_time, create_by, create_name, update_time, update_by, update_name, publish_time, publish_by, publish_name
|
|
|
+ from beilv_competition
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectCompetitionList" parameterType="Competition" resultMap="CompetitionResult">
|
|
@@ -35,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="applyStartTime != null "> and apply_start_time = #{applyStartTime}</if>
|
|
|
<if test="competitionState != null and competitionState != ''"> and competition_state = #{competitionState}</if>
|
|
|
</where>
|
|
|
+ order by create_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCompetitionById" parameterType="Integer" resultMap="CompetitionResult">
|
|
@@ -43,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertCompetition" parameterType="Competition" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into competition
|
|
|
+ insert into beilv_competition
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="competitionTitle != null">competition_title,</if>
|
|
|
<if test="competitionType != null">competition_type,</if>
|
|
@@ -59,6 +74,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="competitionDetails != null">competition_details,</if>
|
|
|
<if test="registrationNotes != null">registration_notes,</if>
|
|
|
<if test="competitionState != null">competition_state,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="publishTime != null">publish_time,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="publishBy != null">publish_by,</if>
|
|
|
+ <if test="createName != null">create_name,</if>
|
|
|
+ <if test="updateName != null">update_name,</if>
|
|
|
+ <if test="publishName != null">publish_name,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="competitionTitle != null">#{competitionTitle},</if>
|
|
@@ -75,11 +99,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="competitionDetails != null">#{competitionDetails},</if>
|
|
|
<if test="registrationNotes != null">#{registrationNotes},</if>
|
|
|
<if test="competitionState != null">#{competitionState},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="publishTime != null">#{publishTime},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="publishBy != null">#{publishBy},</if>
|
|
|
+ <if test="createName != null">#{createName},</if>
|
|
|
+ <if test="updateName != null">#{updateName},</if>
|
|
|
+ <if test="publishName != null">#{publishName},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateCompetition" parameterType="Competition">
|
|
|
- update competition
|
|
|
+ update beilv_competition
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="competitionTitle != null">competition_title = #{competitionTitle},</if>
|
|
|
<if test="competitionType != null">competition_type = #{competitionType},</if>
|
|
@@ -95,28 +128,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="competitionDetails != null">competition_details = #{competitionDetails},</if>
|
|
|
<if test="registrationNotes != null">registration_notes = #{registrationNotes},</if>
|
|
|
<if test="competitionState != null">competition_state = #{competitionState},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateName != null">update_name = #{updateName},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteCompetitionById" parameterType="Integer">
|
|
|
- delete from competition where id = #{id}
|
|
|
+ delete from beilv_competition where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteCompetitionByIds" parameterType="String">
|
|
|
- delete from competition where id in
|
|
|
+ delete from beilv_competition where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
|
|
|
<update id="publishCompetition" parameterType="Competition">
|
|
|
- update competition set competition_state = #{competitionState}
|
|
|
+ update beilv_competition set
|
|
|
+ competition_state = #{competitionState},
|
|
|
+ publish_time = #{publishTime},
|
|
|
+ publish_by = #{publishBy},
|
|
|
+ publish_name = #{publishName}
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
<select id="getCompetitionList" resultMap="CompetitionResult">
|
|
|
- select * from competition where competition_state = 'competiton_state_2'
|
|
|
+ select * from beilv_competition where competition_state = 'competiton_state_2'
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|