提交 70f428a2 作者: 张小凤

GambitDao(add)

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