提交 70f428a2 作者: 张小凤

GambitDao(add)

上级 ea42576a
...@@ -37,7 +37,7 @@ public class ForumGambitVO { ...@@ -37,7 +37,7 @@ public class ForumGambitVO {
@NotBlank(message = "话题封面不能为空",groups = {Create.class,Update.class}) @NotBlank(message = "话题封面不能为空",groups = {Create.class,Update.class})
private String gambitCover; private String gambitCover;
@ApiModelProperty(value = "话题属性",example = "话题属性 1普通 2热门 3推荐 ") @ApiModelProperty(value = "话题属性 话题属性 1普通 2热门 3推荐",example = "1")
@NotNull(message = "话题属性不能为空") @NotNull(message = "话题属性不能为空")
private Integer gambitProperty; private Integer gambitProperty;
......
...@@ -17,7 +17,7 @@ import java.util.List; ...@@ -17,7 +17,7 @@ import java.util.List;
@Mapper @Mapper
public interface GambitDao { public interface GambitDao {
ForumGambitDO insertGambit(ForumGambitDO forumGambitDO); void insertGambit(ForumGambitDO forumGambitDO);
int selectGambit(String gambitName); int selectGambit(String gambitName);
......
...@@ -59,6 +59,7 @@ public class ForumGambitDO { ...@@ -59,6 +59,7 @@ public class ForumGambitDO {
this.gambitCover= forumGambitVO.getGambitCover(); this.gambitCover= forumGambitVO.getGambitCover();
this.gambitProperty= forumGambitVO.getGambitProperty(); this.gambitProperty= forumGambitVO.getGambitProperty();
this.userAccountId= forumGambitVO.getUserAccountId(); this.userAccountId= forumGambitVO.getUserAccountId();
this.id=forumGambitVO.getId();
} }
public ForumGambitDO(ForumDynamicDO forumDynamicDO){ public ForumGambitDO(ForumDynamicDO forumDynamicDO){
......
...@@ -173,6 +173,9 @@ ...@@ -173,6 +173,9 @@
<if test="gambitName!='' and gambitName!=null"> <if test="gambitName!='' and gambitName!=null">
and gambit_name like concat ('%',#{gambitName},'%') and gambit_name like concat ('%',#{gambitName},'%')
</if> </if>
<if test="gambitProperty!=null">
and gambit_property=#{gambitProperty}
</if>
ORDER BY gambit_property,create_time DESC ORDER BY gambit_property,create_time DESC
limit #{pageNo}, #{pageSize} limit #{pageNo}, #{pageSize}
</select> </select>
...@@ -180,8 +183,12 @@ ...@@ -180,8 +183,12 @@
<select id="appGambitListCount" resultType="java.lang.Integer"> <select id="appGambitListCount" resultType="java.lang.Integer">
select count(*) from forum_gambit where check_status=1 select count(*) from forum_gambit where check_status=1
<if test="gambitName!='' and gambitName!=null"> <if test="gambitName!='' and gambitName!=null">
gambit_name like concat ('%',#{gambitName},'%') and gambit_name like concat ('%',#{gambitName},'%')
</if>
<if test="gambitProperty!=null">
and gambit_property=#{gambitProperty}
</if> </if>
ORDER BY gambit_property,create_time DESC ORDER BY gambit_property,create_time DESC
</select> </select>
......
...@@ -152,9 +152,9 @@ ...@@ -152,9 +152,9 @@
<insert id="insertGambit" parameterType="com.mmc.csf.release.entity.gambit.ForumGambitDO" keyProperty="id" useGeneratedKeys="true"> <insert id="insertGambit" parameterType="com.mmc.csf.release.entity.gambit.ForumGambitDO" keyProperty="id" useGeneratedKeys="true">
insert into forum_gambit(gambit_name,gambit_icon,gambit_cover,gambit_property, insert into forum_gambit(gambit_name,gambit_icon,gambit_cover,gambit_property,
user_account_id,create_time,update_time) user_account_id,create_time,update_time,check_status)
values (#{gambitName},#{gambitIcon},#{gambitCover},#{gambitProperty}, values (#{gambitName},#{gambitIcon},#{gambitCover},#{gambitProperty},
#{userAccountId},NOW(),NOW()) #{userAccountId},NOW(),NOW(),1)
</insert> </insert>
<select id="selectGambit" resultType="java.lang.Integer"> <select id="selectGambit" resultType="java.lang.Integer">
select count(*) from forum_gambit where gambit_name=#{gambitName} select count(*) from forum_gambit where gambit_name=#{gambitName}
...@@ -175,15 +175,15 @@ ...@@ -175,15 +175,15 @@
gambit_name=#{gambitName}, gambit_name=#{gambitName},
</if> </if>
<if test="gambitIcon!='' and gambitIcon !=null "> <if test="gambitIcon!='' and gambitIcon !=null ">
gambit_icon=#{gambit_icon}, gambit_icon=#{gambitIcon},
</if> </if>
<if test="gambitCover!='' and gambitCover!=null "> <if test="gambitCover!='' and gambitCover!=null ">
gambit_cover=#{gambitCover}, gambit_cover=#{gambitCover},
</if> </if>
<if test="gambitProperty!=null "> <if test="gambitProperty!=null ">
gambit_property=#{gambitProperty} gambit_property=#{gambitProperty},
</if> </if>
<if test="user_account_id!=null"> <if test="userAccountId!=null">
user_account_id=#{userAccountId}, user_account_id=#{userAccountId},
</if> </if>
create_time=NOW(), create_time=NOW(),
...@@ -226,8 +226,8 @@ ...@@ -226,8 +226,8 @@
<select id="listGambit" resultType="com.mmc.csf.release.entity.gambit.ForumGambitDO" <select id="listGambit" resultType="com.mmc.csf.release.entity.gambit.ForumGambitDO"
parameterType="com.mmc.csf.release.gambit.qo.ForumGambitQO"> parameterType="com.mmc.csf.release.gambit.qo.ForumGambitQO">
select gambit_name,gambit_icon,gambit_cover,gambit_property,post_count, select id,gambit_name,gambit_icon,gambit_cover,gambit_property,post_count,
user_account_id,create_time,update_time from forum_gambit where 1=1 and check_status=1 user_account_id,create_time,update_time,discussion_count from forum_gambit where 1=1 and check_status=1
<if test="gambitName!='' and gambitName!=null "> <if test="gambitName!='' and gambitName!=null ">
and gambit_name like concat ('%',#{gambitName},'%') and gambit_name like concat ('%',#{gambitName},'%')
</if> </if>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论