国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

三個(gè)常用查詢:根據(jù)用戶名 / token查詢用戶信息+鏈表分頁條件查詢

這篇具有很好參考價(jià)值的文章主要介紹了三個(gè)常用查詢:根據(jù)用戶名 / token查詢用戶信息+鏈表分頁條件查詢。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

目錄

1.根據(jù)用戶名或者token查詢用戶信息

會(huì)員信息實(shí)體類

統(tǒng)一狀態(tài)Result類

?controller層

service層及實(shí)現(xiàn)類

dao層

測試:

2.鏈表分頁條件查詢

會(huì)員等級(jí)實(shí)體類

封裝條件類PageVo?

controller層

service層及實(shí)現(xiàn)類

dao層

Mapper.xml層

測試

vue前端參考



1.根據(jù)用戶名或者token查詢用戶信息

mybatisplus...

微服務(wù)項(xiàng)目前期環(huán)境:項(xiàng)目搭建,依賴注入...

會(huì)員表數(shù)據(jù)庫


SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for mbs_member
-- ----------------------------
DROP TABLE IF EXISTS `mbs_member`;
CREATE TABLE `mbs_member` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '會(huì)員客戶ID',
  `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '賬號(hào)',
  `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '密碼',
  `pw_salt` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '鹽值列',
  `status` int DEFAULT NULL COMMENT '賬號(hào)狀態(tài)(帳號(hào)啟用狀態(tài):0->啟用;1->禁用)',
  `id_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '(身份證,護(hù)照,軍官證,臺(tái)胞證,港澳臺(tái)來往內(nèi)地通行證)',
  `path_front` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '正面',
  `path_reverse` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '反面',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '客戶名字',
  `contact_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '聯(lián)系人',
  `contact_phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '聯(lián)系電話',
  `contact_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '聯(lián)系地址',
  `license_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '駕照號(hào)',
  `sex` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '性別',
  `phone_num` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '電話',
  `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '地址',
  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '郵箱',
  `member_level_id` int DEFAULT NULL COMMENT '會(huì)員級(jí)別(普通,金卡,白金,鉆石)',
  `Account_Balance` double DEFAULT '0' COMMENT '賬戶余額',
  `integration` int DEFAULT '0' COMMENT '積分',
  `growth` double DEFAULT NULL COMMENT '成長值',
  `history_integration` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '歷史積分?jǐn)?shù)量(只加不減)',
  `open_id` int DEFAULT NULL COMMENT '微信返回ID',
  `token` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '登錄驗(yàn)證token',
  `id_card` varchar(18) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '證件編號(hào)',
  `head_pic` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '頭像',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=89 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of mbs_member
-- ----------------------------
INSERT INTO `mbs_member` VALUES ('71', 'zhanghaojie', 'f5455390512559851fdffdc9dc71e1debe7261c41509579a3cb8d8085b86bee95d3808d9345e79790a2b2a153effe2615b1b4302694018d0d369f13a4a6e5005', '8efbe27a-4', '0', '1', null, null, '小浩杰', null, null, null, '410100123457', null, '15136204889', null, '222222@qq.com', '1', '11240', '5610', '3760', '2260', null, null, null, 'https://wangzherongyao.oss-cn-beijing.aliyuncs.com/upload/files/1605770604552-7c5b7014-09cb-4d0a.jpg');
INSERT INTO `mbs_member` VALUES ('78', 'test111', '111591072d3b1a693158b77a16df045daf87fca20ea7fc00c32411b6ace2d2c7ac0a70777619883fac37417ca9a09593465c51e7ab56cfb2b1debc174e2ffb3a', 'fcba1cda-2ce7-4d49-9658-976ff2b5aa9d', '0', '1', null, null, 'test111', null, null, null, '511621200011011212', null, '18398591677', null, '1111@11.cc', '3', '94620.96000000002', '1000', '65790.4', '0', null, null, '51162******212', 'https://qy002-bookstore.oss-cn-hangzhou.aliyuncs.com/staff_headicon/9ddb6b4b-8332-47a6-84ae-d5b9234e5065bg5.jpg');
INSERT INTO `mbs_member` VALUES ('88', 'cjj', '836bac861900ae9df5bf390ede7c2a45c1287f346139d3d3576300be822e1f17746c95d622955cc292427748dc12959447a28ba46ce13eb3c41fdcab09956161', 'c5546504-f2a1-4494-a738-8297e786acee', '0', '1', null, null, '成JJ', null, null, null, null, null, '13645678922', null, null, '1', '200', '50', '10500', '500', null, null, null, 'https://qy002-bookstore.oss-cn-hangzhou.aliyuncs.com/staff_headicon/29727801-0855-484d-bf5d-c6f69e8a72ad111.jpg');

會(huì)員信息實(shí)體類


@TableName("mbs_member")
@Data
@ApiModel("會(huì)員信息實(shí)體類")
public class Member implements Serializable {

    /**
    * 會(huì)員客戶ID
    */
    @ApiModelProperty("會(huì)員客戶ID")
    @TableId
    private Integer id;
    /**
    * 賬號(hào)
    */
    @ApiModelProperty("賬號(hào)")
    private String username;
    /**
    * 密碼
    */
    @ApiModelProperty("密碼")
    private String password;
    /**
    * 鹽值列
    */
    @ApiModelProperty("鹽值列")
    private String pwSalt;
    /**
    * 賬號(hào)狀態(tài)(帳號(hào)啟用狀態(tài):0->啟用;1->禁用)
    */
    @ApiModelProperty("賬號(hào)狀態(tài)(帳號(hào)啟用狀態(tài):0->啟用;1->禁用)")
    private Integer status;
    /**
    * (身份證,護(hù)照,軍官證,臺(tái)胞證,港澳臺(tái)來往內(nèi)地通行證)
    */
    @ApiModelProperty("(身份證,護(hù)照,軍官證,臺(tái)胞證,港澳臺(tái)來往內(nèi)地通行證)")
    private String idType;
    /**
    * 正面
    */
    @ApiModelProperty("正面")
    private String pathFront;
    /**
    * 反面
    */
    @ApiModelProperty("反面")
    private String pathReverse;
    /**
    * 客戶名字
    */
    @ApiModelProperty("客戶名字")
    private String name;
    /**
    * 聯(lián)系人
    */
    @ApiModelProperty("聯(lián)系人")
    private String contactName;
    /**
    * 聯(lián)系電話
    */
    @ApiModelProperty("聯(lián)系電話")
    private String contactPhone;
    /**
    * 聯(lián)系地址
    */
    @ApiModelProperty("聯(lián)系地址")
    private String contactAddress;
    /**
    * 駕照號(hào)
    */
    @ApiModelProperty("駕照號(hào)")
    private String licenseNo;
    /**
    * 性別
    */
    @ApiModelProperty("性別")
    private String sex;
    /**
    * 電話
    */
    @ApiModelProperty("電話")
    private String phoneNum;
    /**
    * 地址
    */
    @ApiModelProperty("地址")
    private String address;
    /**
    * 郵箱
    */
    @ApiModelProperty("郵箱")
    private String email;
    /**
    * 會(huì)員級(jí)別(普通,金卡,白金,鉆石)
    */
    @ApiModelProperty("會(huì)員級(jí)別(普通,金卡,白金,鉆石)")
    private Integer memberLevelId;
    /**
    * 賬戶余額
    */
    @ApiModelProperty("賬戶余額")
    private Double accountBalance;
    /**
    * 積分
    */
    @ApiModelProperty("積分")
    private Integer integration;
    /**
    * 成長值
    */
    @ApiModelProperty("成長值")
    private Double growth;
    /**
    * 歷史積分?jǐn)?shù)量(只加不減)
    */
    @ApiModelProperty("歷史積分?jǐn)?shù)量(只加不減)")
    private String historyIntegration;
    /**
    * 微信返回ID
    */
    @ApiModelProperty("微信返回ID")
    private Integer openId;
    /**
    * 登錄驗(yàn)證token
    */
    @ApiModelProperty("登錄驗(yàn)證token")
    private String token;
    /**
    * 證件編號(hào)
    */
    @ApiModelProperty("證件編號(hào)")
    private String idCard;
    /**
    * 頭像
    */
    @ApiModelProperty("頭像")
    private String headPic;
//---------------------------------------------------------------------
//    @ApiModelProperty("對(duì)應(yīng)會(huì)員級(jí)別,一對(duì)一")
    @TableField(exist = false)
    private MemberLevel memberLevel;//會(huì)員等級(jí)名


}

統(tǒng)一狀態(tài)Result類

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("統(tǒng)一的json對(duì)象")
public class Result<T> {
    @ApiModelProperty("狀態(tài)碼")
    private Integer code;
    @ApiModelProperty("提示消息")
    private String msg;
    @ApiModelProperty("響應(yīng)data數(shù)據(jù)")
    private T data;

}

?controller層


@RestController
@RequestMapping("member")
@Api(tags = "客戶管理--會(huì)員管理")
public class MemberController {

    @Autowired
    private MemberService memberService;

    @GetMapping("/getByUsername")
    @ApiOperation("根據(jù)會(huì)員名稱查詢會(huì)員信息")
    public Member getByUsername(@RequestParam String username){
        return memberService.getByUsername(username);
    }

    @GetMapping("/getMember")
    @ApiOperation("根據(jù)token查詢會(huì)員基礎(chǔ)信息")
    public Result<Member> getMember(@RequestParam String token){
        return memberService.getMember(token);
    }
}

service層及實(shí)現(xiàn)類

public interface MemberService  {
    Member getByUsername(String username);

   Result<Member> getMember(String token);
}


//-------------------------------------------------------------


@Service
public class MemberServiceImpl implements MemberService {
    @Autowired
    private MemberDao memberDao;


    @Override
    public Member getByUsername(String username) {
        QueryWrapper wrapper = new QueryWrapper();
        //會(huì)員名稱
        wrapper.eq("username",username);
        //賬號(hào)狀態(tài)(帳號(hào)啟用狀態(tài):0->啟用;1->禁用)
        wrapper.eq("status",0);
        Member member = memberDao.selectOne(wrapper);
        return member;
    }


  @Autowired
    private StringRedisTemplate redisTemplate;


  @Override
    public Result<Member> getMember(String token) {
        ValueOperations<String, String> ops = redisTemplate.opsForValue();
        String memberCache = ops.get("sso:member:" + token);
        Member member = JSON.parseObject(memberCache, Member.class);
        return new Result<>(200,"成功",member);
    }

}

dao層

@Mapper
public interface MemberDao extends BaseMapper<Member> {
}
 

測試:

三個(gè)常用查詢:根據(jù)用戶名 / token查詢用戶信息+鏈表分頁條件查詢,鏈表,數(shù)據(jù)庫,oracle,vue.js

2.鏈表分頁條件查詢

等級(jí)表數(shù)據(jù)庫



SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for mbs_member_level
-- ----------------------------
DROP TABLE IF EXISTS `mbs_member_level`;
CREATE TABLE `mbs_member_level` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `growth_point` int DEFAULT NULL COMMENT '成長值',
  `default_status` int DEFAULT NULL COMMENT '是否為默認(rèn)等級(jí):0->不是;1->是',
  `free_freight_point` decimal(10,2) DEFAULT NULL COMMENT '免運(yùn)費(fèi)標(biāo)準(zhǔn)',
  `priviledge_comment` int DEFAULT NULL COMMENT '是否有評(píng)論獲獎(jiǎng)勵(lì)特權(quán)',
  `priviledge_promotion` int DEFAULT NULL COMMENT '是否有專享活動(dòng)特權(quán)',
  `priviledge_member_price` int DEFAULT NULL COMMENT '是否有會(huì)員價(jià)格特權(quán)',
  `priviledge_birthday` int DEFAULT NULL COMMENT '是否有生日特權(quán)',
  `note` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '說明',
  `ratio` double DEFAULT NULL COMMENT '積分 普通1 白銀1.2 黃金1.5....',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1684561963877740550 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of mbs_member_level
-- ----------------------------
INSERT INTO `mbs_member_level` VALUES ('1', '普通', '10000', '1', '200.00', '1', '0', '1', '0', '等級(jí)1', '1');
INSERT INTO `mbs_member_level` VALUES ('2', '白銀', '20000', '0', '100.00', '1', '1', '1', '1', '等級(jí)2', '1.2');
INSERT INTO `mbs_member_level` VALUES ('3', '黃金', '50000', '0', '50.00', '1', '1', '1', '1', '等級(jí)3', '1.5');
INSERT INTO `mbs_member_level` VALUES ('4', '鉆石', '90000', '0', '0.00', '1', '0', '1', '1', '等級(jí)4', '1.8');
INSERT INTO `mbs_member_level` VALUES ('10', '星耀', '140000', '0', '800.00', '1', '1', '1', '11', '最高級(jí)', '2');

當(dāng)前需要鏈表查詢會(huì)員等級(jí)

三個(gè)常用查詢:根據(jù)用戶名 / token查詢用戶信息+鏈表分頁條件查詢,鏈表,數(shù)據(jù)庫,oracle,vue.js

會(huì)員等級(jí)實(shí)體類


@TableName("mbs_member_level")
@Data
@ApiModel("客戶管理--會(huì)員等級(jí)-實(shí)體類")
public class MemberLevel implements Serializable {

    /**
    * 
    */
    @ApiModelProperty("")
    @TableId(type = IdType.AUTO)
    private String id;
    /**
    * 
    */
    @ApiModelProperty("等級(jí)名")
//    @TableField(value = "name")
    private String name;
    /**
    * 成長值
    */
    @ApiModelProperty("成長值")
    private Integer growthPoint;
    /**
    * 是否為默認(rèn)等級(jí):0->不是;1->是
    */
    @ApiModelProperty("是否為默認(rèn)等級(jí):0->不是;1->是")
    private Integer defaultStatus;
    /**
    * 免運(yùn)費(fèi)標(biāo)準(zhǔn)
    */
    @ApiModelProperty("免運(yùn)費(fèi)標(biāo)準(zhǔn)")
    private BigDecimal freeFreightPoint;
    /**
    * 是否有評(píng)論獲獎(jiǎng)勵(lì)特權(quán)
    */
    @ApiModelProperty("是否有評(píng)論獲獎(jiǎng)勵(lì)特權(quán)")
    private Integer priviledgeComment;
    /**
    * 是否有專享活動(dòng)特權(quán)
    */
    @ApiModelProperty("是否有專享活動(dòng)特權(quán)")
    private Integer priviledgePromotion;
    /**
    * 是否有會(huì)員價(jià)格特權(quán)
    */
    @ApiModelProperty("是否有會(huì)員價(jià)格特權(quán)")
    private Integer priviledgeMemberPrice;
    /**
    * 是否有生日特權(quán)
    */
    @ApiModelProperty("是否有生日特權(quán)")
    private Integer priviledgeBirthday;
    /**
    * 說明
    */
    @ApiModelProperty("說明")
    private String note;
    /**
    * 積分 普通1 白銀1.2 黃金1.5....
    */
    @ApiModelProperty("積分 普通1 白銀1.2 黃金1.5....")
    private Double ratio;


}

封裝條件類PageVo?

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "分頁條件查詢--用戶管理")
public class PageVo {

    Integer pageNo;
    Integer pageSize;

    CouponVo Data;

}

//---------------------------------------

@Data
public class CouponVo {
    String name;

    String phoneNum;

    String email;

    String userName;
    String orderSn;


}

controller層


@RestController
@RequestMapping("member")
@Api(tags = "客戶管理--會(huì)員管理")
public class MemberController {

    @Autowired
    private MemberService memberService;
    //分頁條件查詢
    @PostMapping("queryByPage222")
    public Result<Map<String,Object>> pageResult(@RequestBody PageVo pageVo){
        return memberService.selectAllPage(pageVo);
    }
}

service層及實(shí)現(xiàn)類

public interface MemberService  {


    //分頁條件查詢
    Result<Map<String,Object>> selectAllPage(PageVo pageVo);


}


//-------------------------------------------------------------


@Service
public class MemberServiceImpl implements MemberService {
    @Autowired
    private MemberDao memberDao;


    //分頁條件查詢
    @Override
    public Result<Map<String,Object>> selectAllPage(PageVo pageVo) {
        Page<Member> page = new Page<>(pageVo.getPageNo(), pageVo.getPageSize());
        List<Member> members = memberDao.selectByMyPage(page,pageVo);
       // page.setRecords(members);
        //page.setTotal(members.size());
        //獲取分頁總條數(shù)
        long total = page.getTotal();
        Map<String,Object> data = new HashMap<>();
        data.put("records",members);
        data.put("total",total);
        return new Result<>(200,"查詢成功",data);
    }
}

dao層

@Mapper
public interface MemberDao extends BaseMapper<Member> {

    //分頁查詢
    List<Member> selectByMyPage(Page<Member> page, PageVo pageVo);
}

Mapper.xml層

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fifth.member.dao.MemberDao">


    <!--鏈表查詢條件查詢-一對(duì)一-->
    <resultMap id="selectAll110" type="com.fifth.entity.Member" autoMapping="true">
        <id property="id" column="id"/>
        <association property="memberLevel" javaType="com.fifth.entity.MemberLevel" autoMapping="true">
            <id property="id" column="id"/>
            <result property="name" column="memberLevelName"/>
        </association>
    </resultMap>
    <select id="selectByMyPage" resultMap="selectAll110">
        SELECT m.*,ml.name memberLevelName
        FROM mbs_member m JOIN mbs_member_level ml ON m.member_level_id = ml.id
        <where>
            <if test="pageVo.data.phoneNum != null and pageVo.data.phoneNum != ''">
                AND m.phone_num LIKE CONCAT('%', #{pageVo.data.phoneNum}, '%')
            </if>
            <if test="pageVo.data.email != null and pageVo.data.email != ''">
                AND m.email LIKE CONCAT('%', #{pageVo.data.email}, '%')
            </if>
            <if test="pageVo.data.userName != null and pageVo.data.userName != ''">
                AND m.username LIKE CONCAT('%', #{pageVo.data.userName}, '%')
            </if>
            <if test="pageVo.data.name != null and pageVo.data.name != ''">
                AND m.name LIKE CONCAT('%', #{pageVo.data.name}, '%')
            </if>
        </where>
    </select>

</mapper>

測試

三個(gè)常用查詢:根據(jù)用戶名 / token查詢用戶信息+鏈表分頁條件查詢,鏈表,數(shù)據(jù)庫,oracle,vue.js

vue前端參考

<template>
  <div>
    <!--搜索查詢-->
    <el-row>
      <el-col :span="3"
        ><el-input
          v-model="searchForm.name"
          size="mini"
          clearable
          placeholder="請(qǐng)輸姓名"
        ></el-input
      ></el-col>
      <el-col :span="3"
        ><el-input
          v-model="searchForm.userName"
          size="mini"
          clearable
          placeholder="請(qǐng)輸用戶名"
        ></el-input
      ></el-col>
      <el-col :span="3"
        ><el-input
          v-model="searchForm.email"
          size="mini"
          clearable
          placeholder="郵箱"
        ></el-input
      ></el-col>
      <el-col :span="3"
        ><el-input
          v-model="searchForm.phoneNum"
          size="mini"
          clearable
          placeholder="電話"
        ></el-input
      ></el-col>
      <el-col :span="3"
        ><el-button
          type="primary"
          size="mini"
          @click="search()"
          icon="el-icon-search"
          v-has="'member:search'"
          >搜索</el-button
        ></el-col>
      <el-col :span="3"
        ><el-button
          type="primary"
          size="mini"
          v-has="'member:flush'"
          @click="flush()"
          icon="el-icon-refresh"
          >刷新</el-button></el-col>
    </el-row>

    <el-row>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column label="用戶頭像">
          <template slot-scope="scope">
            <el-image
              style="width: 60px; height: 60px"
              :src="scope.row.headPic"
            ></el-image>
          </template>
        </el-table-column>
        <el-table-column
          prop="name"
          label="客戶姓名"
          align="center"
          width="100"
        >
        </el-table-column>
        <el-table-column
          prop="username"
          align="center"
          label="用戶名"
          width="100"
        >
        </el-table-column>
        <el-table-column prop="memberLevel.name" width="150" align="center" label="會(huì)員級(jí)別">
        </el-table-column>
        <el-table-column prop="accountBalance" width="150" align="center" label="賬戶余額">
        </el-table-column>
        <el-table-column prop="integration" width="150" align="center" label="積分">
        </el-table-column>
        <el-table-column prop="licenseNo" width="180" align="center" label="駕照號(hào)">
        </el-table-column>
        <el-table-column prop="email" width="180" align="center" label="郵箱">
        </el-table-column>
        <el-table-column prop="phoneNum" width="180" align="center" label="電話">
        </el-table-column>
        <el-table-column prop="idType" width="180" align="center" :formatter="zjFormat" label="證件類型">
        </el-table-column>
        <el-table-column prop="idCard" width="180" align="center" label="身份證號(hào)">
          <template slot-scope="scope">{{scope.row.idCard? scope.row.idCard.replace(/^(.{6})(?:\w+)(.{4})$/, "\$1********\$2"):""}}</template>
        </el-table-column>
        <el-table-column prop="address" width="180" align="center" label="地址">
        </el-table-column>
        <el-table-column prop="contactName" width="180" align="center" label="聯(lián)系人">
        </el-table-column>
        <el-table-column prop="contactAddress" width="280" align="center" label="聯(lián)系地址">
        </el-table-column>
        <el-table-column
          prop="contactPhone"
          label="聯(lián)系人電話"
          align="center"
          width="180"
        >
        </el-table-column>
        <el-table-column prop="sex" :formatter="sexFormat" label="性別">
        </el-table-column>
        <el-table-column prop="status" :formatter="zhFormat" label="賬號(hào)狀態(tài)">
        </el-table-column>
        <el-table-column width="150" label="用戶狀態(tài)">
          <template slot-scope="scope">
            <el-switch
              v-model="scope.row.status"
              active-color="#13ce66"
              inactive-color="#ff4949"
              :active-value=0
              :inactive-value=1
              active-text="啟用"
              inactive-text="禁用"
              @change="handleChangeStatus(scope.$index, scope.row)"
            >
            </el-switch>
          </template>
        </el-table-column>
      </el-table>
    </el-row>
    <el-row>
      <!--分頁插件-->
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[2, 3, 5, 10, 20]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      >
      </el-pagination>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: true,
      optionsA: [],
      tableData: [],
      imgUrl: "",
      currentPage: 1, //頁碼 第幾頁
      pageSize: 5, //每頁顯示數(shù)量
      total: 100, //總條數(shù)
      searchForm: { name: "", phoneNum: "", email: "", userName: "" }, //搜索form表單
      dialogFormVisible: false, //是否顯示對(duì)話框  默認(rèn)是不顯示
      form: { passold: "", pass: "", checkPass: "" },
      formLabelWidth: "120px",
      condition: "",
    };
  },
  created() {
    //初始化方法 類似于jquery ?$({})
    this.loadData();
    var _this = this;
    _this.$http
      .post("/member/memberLevel/queryByPage", {
        pageNo: this.currentPage,
        pageSize: 100,
        data: {},
      })
      .then(function (response) {
        console.log(JSON.stringify(response));
        if (response.data.code == 200) {
          _this.optionsA = response.data.data.records;
          //_this.total = response.data.data.total;
        }
      })
      .catch(function (error) {
        //錯(cuò)誤的處理
        // handle error
        console.log(error);
      })
      .then(function () {
        //總執(zhí)行 最終處理 ? ? ?類似java ?異常處理的finally
        // always executed
      });

  },
  //所有函數(shù)
  methods: {
    //加載數(shù)據(jù)
    loadData() {
      var _this = this;
      //復(fù)制 $http官網(wǎng)代碼
      // var token  = localStorage.getItem("token");
      _this.$http
        .post("/member/queryByPage222", {
          pageNo: this.currentPage,
          pageSize: this.pageSize,
          data: {
            name: this.searchForm.name,
            phoneNum: this.searchForm.phoneNum,
            email: this.searchForm.email,
            userName: this.searchForm.userName,
          },
        })
        .then(function (response) {
          console.log(JSON.stringify(response.data.data))
          if (response.data.code == 200) {
            _this.tableData = response.data.data.records;
            _this.total = response.data.data.total;
          }
        })
        .catch(function (error) {
          console.log(error);
          _this.$message.error("你錯(cuò)了。。。");
        });
    },
    zjFormat(row, column, cellValue, index){
      return cellValue == "1" ? "身份證" : cellValue == "2" ? "護(hù)照" : cellValue == "3" ? "軍官證" : cellValue == "4" ? "臺(tái)胞證" : "港澳臺(tái)來往內(nèi)地通行證";
    },
    //格式化性別方法
    sexFormat(row, column, cellValue, index) {
      //row當(dāng)前行數(shù)據(jù)
      //column 列名稱
      //cellValue 列的值
      //index 下標(biāo)
      //alert(cellValue);
      return cellValue == 0 ? "男" : cellValue == 1 ? "女" : "未知";

    },
    zhFormat(row, column, cellValue, index) {
      //row當(dāng)前行數(shù)據(jù)
      //column 列名稱
      //cellValue 列的值
      //index 下標(biāo)
      //alert(cellValue);
      return cellValue == 0 ? "正常" : "異常";
    },
    //處理每頁數(shù)量發(fā)生變化
    handleSizeChange(val) {
      console.log(`每頁 ${val} 條`);
      //讓每頁數(shù)量發(fā)生變化
      this.pageSize = val;
      //重載數(shù)據(jù)
      this.loadData();
    },
    //處理當(dāng)前頁變化
    handleCurrentChange(val) {
      console.log(`當(dāng)前頁: ${val}`);
      //讓每頁數(shù)量發(fā)生變化
      this.currentPage = val;
      //重載數(shù)據(jù)
      this.loadData();
    },
    //查詢
    search() {
      this.loadData();
    },
    //刷新
    flush() {
      location.reload();
    }, //修改用戶狀態(tài)(禁用/啟用)
    handleChangeStatus(index, row) {
  //     //確認(rèn)框提示
  //     this.$confirm("此操作將永久刪除該數(shù)據(jù), 是否繼續(xù)?", "提示", {
  //       confirmButtonText: "確定",
  //       cancelButtonText: "取消",
  //       type: "warning",
  //     })
  //       .then(() => {
  //     var _this = this; //復(fù)制 $http官網(wǎng)代碼 // var token ?= localStorage.getItem("token");
  //     //alert(JSON.stringify(row));
  //     _this.$http
  //       .post("/member/edit", row)
  //       .then(function (response) {
  //         if (response.data.code == 200) {
  //           //alert("操作成功");
  //           _this.loadData;
  //         }
  //       })
  //       .catch(function (error) {
  //         console.log(error);
  //         _this.$message.error("你錯(cuò)了。。。");
  //       });
      console.log(index, row);
      //確認(rèn)框提示
      this.$confirm("此操作將關(guān)乎賬號(hào)的啟用禁用, 是否繼續(xù)?", "提示", {
        confirmButtonText: "確定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          //讓_this等于當(dāng)前vue對(duì)象
          var _this = this;
          // alert(111);
          //賦值 $http官網(wǎng)代碼  this.form =form:{deptName:'',description:'',status:1}
          _this.$http
            .post("/member/edit", row) //指定請(qǐng)求的url及參數(shù)  get
            .then(function (response) {
              //正確返回對(duì)象的處理
              // handle success
              console.log(response);
              //JSON.stringify   把json轉(zhuǎn)換為json字符串,方便查看
              console.log(JSON.stringify(response));
              //直接使用this 會(huì)指 $http對(duì)象  錯(cuò)誤
              // this.tableData
              //判斷返回值是否正確
              if (response.data.code == 200) {
                //提示添加成功
                _this.$message({
                  message: "恭喜你,這是一條成功消息",
                  type: "success",
                });
                //重新加載數(shù)據(jù)
                _this.loadData();
              } else {
                //錯(cuò)誤提示信息
                _this.$message.error("錯(cuò)了哦,這是一條錯(cuò)誤消息");
              }
            })
            .catch(function (error) {
              //錯(cuò)誤的處理
              // handle error
              console.log(error);
            });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消",
          });
        });
    },
  },
};
</script>
<style>
</style>

鏈表前端拿數(shù)據(jù)

三個(gè)常用查詢:根據(jù)用戶名 / token查詢用戶信息+鏈表分頁條件查詢,鏈表,數(shù)據(jù)庫,oracle,vue.js文章來源地址http://www.zghlxwxcb.cn/news/detail-616293.html

到了這里,關(guān)于三個(gè)常用查詢:根據(jù)用戶名 / token查詢用戶信息+鏈表分頁條件查詢的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Git項(xiàng)目遷移、修改Git倉庫地址、修改Git用戶名等Git常用命令

    1.1 拉取代碼 所有分支都完整拉取,用以下命令 1.2?修改倉庫地址 cd oldProject,進(jìn)入項(xiàng)目中,查看現(xiàn)在的倉庫地址 git remote -v 將倉庫地址改為新的地址 修改后查看倉庫地址是否修改成功 git remote -v 1.3 推送到新倉庫 倉庫地址修改成功后,將代碼推送到新倉庫即可 到此,Git項(xiàng)目

    2024年02月05日
    瀏覽(23)
  • Mac之SSH連接常用設(shè)置-延長連接的超時(shí)時(shí)間、給‘ssh 用戶名@IP地址‘指令起別名等

    Mac之SSH連接常用設(shè)置-延長連接的超時(shí)時(shí)間、給‘ssh 用戶名@IP地址‘指令起別名等

    Mac 的終端可以直接使用 SSH命令連接遠(yuǎn)程服務(wù)器 ,但是默認(rèn)情況下連接保持會(huì)話的時(shí)間很短,需要不斷地重新登陸,麻煩;下面可以通過增加 SSH 連接的會(huì)話超時(shí)時(shí)間來解決此問題。相關(guān)配置如下: Mac 下使用 SSH命令連接遠(yuǎn)程服務(wù)器 時(shí),每次需要輸入 ssh 用戶名@IP地址 ;可以針

    2024年02月05日
    瀏覽(24)
  • 【Ubuntu用戶名】更改當(dāng)前用戶名

    更改Ubuntu 上當(dāng)前用戶的用戶名通常需要執(zhí)行一系列步驟,包括創(chuàng)建一個(gè)新用戶、將文件從舊用戶傳輸?shù)叫掠脩?、并刪除舊用戶。以下是一個(gè)詳細(xì)的步驟: 注意:在執(zhí)行以下步驟之前,請(qǐng)確保有管理員權(quán)限。 創(chuàng)建新用戶 :首先,需要?jiǎng)?chuàng)建一個(gè)新用戶。假設(shè)要將當(dāng)前用戶名從

    2024年02月04日
    瀏覽(19)
  • win11電腦中文用戶名修改成英文用戶名

    win11電腦中文用戶名修改成英文用戶名

    ?電腦的用戶名是中文,在某些軟件中會(huì)產(chǎn)生亂碼問題,甚至無法使用的問題,比如rabbitmq就會(huì)無法使用。這個(gè)問題可真是頭疼啊。下面我就來介紹一下,win11怎么修改用戶名。 以管理員身份打開cmd窗口 ?在命令行輸入: net user administrator /active:yes(這是激活管理員賬號(hào)) ?切

    2023年04月24日
    瀏覽(25)
  • ElasticSearch添加用戶名及密碼 在RestHighLevelClient中增加用戶名密碼驗(yàn)證

    ????????漏洞描述:ElasticSearch是一個(gè)基于Lucene的搜索服務(wù)器。它提供了一個(gè)分布式多用戶能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java開發(fā)的,并作為Apache許可條款下的開放源碼發(fā)布,是當(dāng)前流行的企業(yè)級(jí)搜索引擎。Elasticsearch的增刪改查操作全部由http接口

    2024年02月07日
    瀏覽(24)
  • GB28181/GB35114視頻匯聚平臺(tái)LiveGBS中如果修改默認(rèn)admin用戶的用戶名以及其他用戶的用戶名

    GB28181/GB35114流媒體服務(wù)搭建 搭建入口,解壓啟動(dòng)即用:https://www.liveqing.com/docs/download/LiveGBS.html 一、功能說明 提供用戶管理及 Web 可視化頁面管理,開源的前端頁面源碼; 提供設(shè)備狀態(tài)管理,可實(shí)時(shí)查看設(shè)備是否掉線等信息; 提供實(shí)時(shí)流媒體處理,PS(TS)轉(zhuǎn)ES; 提供 RTSP、RTMP、

    2024年02月11日
    瀏覽(24)
  • 如何安全的修改win11用戶名(微軟賬號(hào)登錄,用戶名會(huì)變成純數(shù)字,好丑)

    如何安全的修改win11用戶名(微軟賬號(hào)登錄,用戶名會(huì)變成純數(shù)字,好丑)

    過河拆橋法 , (下面有圖示) 1 設(shè)置win11使用本地賬戶, 2 新建另一個(gè)管理員賬戶GGG, 3 登錄GGG, 4 刪除目標(biāo)用戶名AAA, 5 重新新建AAA,并設(shè)置為管理員, 6 登錄AAA, 7 刪除GGG, 8 ok ? ? ? ? ? ? ? ? ? ? ? ?ok ? 1、按 Win 鍵,或點(diǎn)擊任務(wù)欄上的開始圖標(biāo),然后在已固定的應(yīng)

    2024年02月11日
    瀏覽(93)
  • ubuntu修改用戶名和用戶密碼

    ubuntu修改用戶名和用戶密碼

    1.修改passwd文件 2.修改shadow文件 3.修改home目錄下文件夾名 4.修改sudo權(quán)限(修改group用戶組) 5.修改用戶密碼 sudo passwd username #修改用戶密碼 //username是用戶設(shè)置用戶名,記得替換 sudo passwd root #修改root密碼

    2024年02月09日
    瀏覽(31)
  • Linux 用戶賬號(hào)管理 - 查看當(dāng)前用戶名

    在 Linux 系統(tǒng)中,有多種方式可以查看當(dāng)前用戶名。本文將介紹以下三種常用的查找當(dāng)前用戶名的方法:使用 id 命令、使用 whoami 命令和使用 who am i 命令。 id 命令用于顯示用戶的ID和所屬群組的ID。若只指定用戶名稱,則顯示目前用戶的ID。要打印當(dāng)前用戶名的信息,可以執(zhí)行

    2024年02月15日
    瀏覽(27)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包