| @@ -19,6 +19,7 @@ import com.iformall.domain.po.yqzj.YqzjVideo; | |||||
| import com.iformall.enums.EnumCpsPlanContentType; | import com.iformall.enums.EnumCpsPlanContentType; | ||||
| import com.iformall.enums.EnumCpsPlanStatus; | import com.iformall.enums.EnumCpsPlanStatus; | ||||
| import com.iformall.enums.EnumCpsPlanType; | import com.iformall.enums.EnumCpsPlanType; | ||||
| import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.enums.yqzj.EnumYqzjGuangGaoWeiType; | import com.iformall.enums.yqzj.EnumYqzjGuangGaoWeiType; | ||||
| import com.iformall.enums.yqzj.EnumYqzjHotNewsType; | import com.iformall.enums.yqzj.EnumYqzjHotNewsType; | ||||
| import com.iformall.enums.yqzj.EnumYqzjLunboType; | import com.iformall.enums.yqzj.EnumYqzjLunboType; | ||||
| @@ -78,4 +79,19 @@ public class YqzjNewsController extends YqzjBaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation("置顶") | |||||
| @PostMapping("first") | |||||
| public ResultData first(@RequestBody YqzjNews record) { | |||||
| if (null == record.getId()) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| YqzjNews yn = yqzjService.findNewsById(record.getId()); | |||||
| if (null == yn ) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"新闻未查询到"); | |||||
| } | |||||
| yn.setFirst(EnumYesOrNo.YES.getCode()); | |||||
| this.yqzjService.saveOrUpdateNews(yn); | |||||
| return new ResultData(); | |||||
| } | |||||
| } | } | ||||
| @@ -48,6 +48,8 @@ public class YqzjNews extends TenantEntity { | |||||
| private Date createDate; | private Date createDate; | ||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | ||||
| private Date updateDate; | private Date updateDate; | ||||
| @io.swagger.annotations.ApiModelProperty(value="是否置顶EnumYesOrNo",name="updateDate") | |||||
| private Integer first; | |||||
| } | } | ||||
| @@ -17,11 +17,12 @@ | |||||
| <result column="status" jdbcType="INTEGER" property="status"/> | <result column="status" jdbcType="INTEGER" property="status"/> | ||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | ||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | ||||
| <result column="first" jdbcType="INTEGER" property="first"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`type`,`sub_type`,`tag`,`title`,`sub_title`,`detail`,`image`,`video`,`send_date`,`status`,`create_date`,`update_date` | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`type`,`sub_type`,`tag`,`title`,`sub_title`,`detail`,`image`,`video`,`send_date`,`status`,`create_date`,`update_date`,`first` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -65,6 +66,10 @@ | |||||
| <if test=" videHas == 1"> | <if test=" videHas == 1"> | ||||
| and `video` is not null and `video` != '' | and `video` is not null and `video` != '' | ||||
| </if> | </if> | ||||
| <if test=" null != first"> | |||||
| and `first` = #{first} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||