whyclxw
2021-04-15 e378f3ffd7ec94674048454a12e8047aa69e43ae
提交
3个文件已添加
42 ■■■■■ 已修改文件
src/main/java/com/example/lxw/pojo/UserBattgroupBaojigroupUsr.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
target/classes/com/example/lxw/pojo/UserBattgroupBaojigroupUsr.class 补丁 | 查看 | 原始文档 | blame | 历史
target/classes/mapper/User_infMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/example/lxw/pojo/UserBattgroupBaojigroupUsr.java
New file
@@ -0,0 +1,23 @@
package com.example.lxw.pojo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
/**
 * @author lxw
 * @create 2021-04-15 11:24
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class UserBattgroupBaojigroupUsr {
    @TableField(exist = false)
    private long num;
    private long baojiGroupId;
    @TableField(exist = false)
    private long uId;
}
target/classes/com/example/lxw/pojo/UserBattgroupBaojigroupUsr.class
Binary files differ
target/classes/mapper/User_infMapper.xml
New file
@@ -0,0 +1,19 @@
<?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.example.lxw.mapper.User_InfMapper" >
    <resultMap id="baojiUserMap" type="User_inf">
        <result column="uSnId" property="uSnId" />
        <result column="uName" property="uName" />
        <association property="UserBattgroupBaojigroupUsr">
            <result property="baojiGroupId" column="baojiGroupId"/>
        </association>
    </resultMap>
    <select id="searchByBaojiUsr" resultMap="baojiUserMap">
        SELECT tb_user_inf.*,tb_user_battgroup_baojigroup_usr.baoji_group_id
        from tb_user_inf
        LEFT JOIN tb_user_battgroup_baojigroup_usr ON tb_user_inf.uId=tb_user_battgroup_baojigroup_usr.uId
        order by tb_user_inf.uid
    </select>
</mapper>