mp表新增字段:type 是否主账号
This commit is contained in:
@@ -259,6 +259,10 @@ public class MpController extends BaseController {
|
|||||||
@ApiOperation("修改小程序信息")
|
@ApiOperation("修改小程序信息")
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public ApiResult<?> update(@RequestBody Mp mp) {
|
public ApiResult<?> update(@RequestBody Mp mp) {
|
||||||
|
// 只允许一个主账号
|
||||||
|
if (mp.getType().equals(1)) {
|
||||||
|
mpService.update(new LambdaUpdateWrapper<Mp>().eq(Mp::getType,1).set(Mp::getType,0));
|
||||||
|
}
|
||||||
if (mpService.updateById(mp)) {
|
if (mpService.updateById(mp)) {
|
||||||
return success("修改成功");
|
return success("修改成功");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ public class Mp implements Serializable {
|
|||||||
@TableId(value = "mp_id", type = IdType.AUTO)
|
@TableId(value = "mp_id", type = IdType.AUTO)
|
||||||
private Integer mpId;
|
private Integer mpId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否主账号")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty(value = "小程序ID")
|
@ApiModelProperty(value = "小程序ID")
|
||||||
private String appId;
|
private String appId;
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
<if test="param.id != null">
|
<if test="param.id != null">
|
||||||
AND a.id = #{param.id}
|
AND a.id = #{param.id}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.pageId != null">
|
||||||
|
AND a.page_id = #{param.pageId}
|
||||||
|
</if>
|
||||||
<if test="param.type != null">
|
<if test="param.type != null">
|
||||||
AND a.type = #{param.type}
|
AND a.type = #{param.type}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
<if test="param.mpId != null">
|
<if test="param.mpId != null">
|
||||||
AND a.mp_id = #{param.mpId}
|
AND a.mp_id = #{param.mpId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.type != null">
|
||||||
|
AND a.type LIKE CONCAT('%', #{param.type}, '%')
|
||||||
|
</if>
|
||||||
<if test="param.appId != null">
|
<if test="param.appId != null">
|
||||||
AND a.app_id LIKE CONCAT('%', #{param.appId}, '%')
|
AND a.app_id LIKE CONCAT('%', #{param.appId}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ public class MpFieldParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "类型,0文本 1图片 2其他")
|
@ApiModelProperty(value = "类型,0文本 1图片 2其他")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ public class MpParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer mpId;
|
private Integer mpId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否主账号")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty(value = "小程序ID")
|
@ApiModelProperty(value = "小程序ID")
|
||||||
private String appId;
|
private String appId;
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class MpServiceImpl extends ServiceImpl<MpMapper, Mp> implements MpServic
|
|||||||
@Override
|
@Override
|
||||||
public PageResult<Mp> pageRel(MpParam param) {
|
public PageResult<Mp> pageRel(MpParam param) {
|
||||||
PageParam<Mp, MpParam> page = new PageParam<>(param);
|
PageParam<Mp, MpParam> page = new PageParam<>(param);
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
page.setDefaultOrder("type desc, sort_number asc, create_time desc");
|
||||||
List<Mp> list = baseMapper.selectPageRel(page, param);
|
List<Mp> list = baseMapper.selectPageRel(page, param);
|
||||||
return new PageResult<>(list, page.getTotal());
|
return new PageResult<>(list, page.getTotal());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user