错误日志(关于vue前端三元运算,对话框格式,中间表查询展示)

三元运算将后台的数字转换为需要的文字
<el-table-column prop="status" label="状态">
<template slot-scope="scope">
{{scope.row.status==1 ? "启用" : "未启用"}}
</template>
</el-table-column>
三元运算三种情况判断
<el-table-column prop="state" label="评论状态" align="center" width="145">
      <template slot-scope="scope">
	  {{scope.row.state==2?"审核不通过":scope.row.state==1?"审核通过":"未审核"}}
	  </template>
</el-table-column>
对话框按钮居右
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible=false">取消</el-button>
<el-button type="primary" @click="add">确定</el-button>
</div>
通过中间表查询
/**
 * @author 庭前云落
 * @date 2019/11/16 8:23
 * @description
 */
@org.apache.ibatis.annotations.Mapper
public interface AdminMapper extends Mapper<Admin> {

    @Select("select * from tb_admin")
    @Results({
            @Result(property = "id",column = "id"),
            @Result(property = "rlist",column = "id",many = @Many(select = "com.czxy.dao.RoleMapper.findAllRole"))
    })
    List<Admin> findAll();
    
}
/**
 * @author 庭前云落
 * @date 2019/11/16 9:14
 * @description
 */
@org.apache.ibatis.annotations.Mapper
public interface RoleMapper extends Mapper<Role> {
    //SELECT * FROM  tb_admin_role ar,tb_role tr WHERE tr.`id`=ar.`role_id` AND ar.`admin_id`=1;
    @Select("select * from  tb_admin_role ar,tb_role tr where tr.id=ar.role_id and ar.admin_id=#{id}")
    List<Role> findAllRole(@Param("id") Integer id);
}
使用@Column,手写SQL查所有,没有填充进去名字
@Column(name = "login_name")
private String loginName;

@Result(property = "loginName",column = "login_name"),
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值