无关风月
2025-05-08 9486766c806fe1d9e082b2fd02ea1cc558f1b443
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?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.dsh.account.mapper.TStudentMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.dsh.account.dto.TStudentDto">
        <id column="id" property="id"/>
        <result column="appUserId" property="appUserId"/>
        <result column="name" property="name"/>
        <result column="phone" property="phone"/>
        <result column="birthday" property="birthday"/>
        <result column="sex" property="sex"/>
        <result column="height" property="height"/>
        <result column="weight" property="weight"/>
        <result column="bmi" property="bmi"/>
        <result column="idCard" property="idCard"/>
        <result column="lateralSurface" property="lateralSurface"/>
        <result column="state" property="state"/>
        <result column="insertTime" property="insertTime"/>
        <result column="headImg" property="headImg"/>
        <result column="isDefault" property="isDefault"/>
 
    </resultMap>
    <insert id="createHistory">
        insert into t_usetime_history (createBy,pleasePic,passPic,insertTime)
 
            value(#{createHistoryDto.createBy},#{createHistoryDto.pleasePic},#{createHistoryDto.passPic},#{createHistoryDto.date})
    </insert>
 
    <select id="selectAll" resultType="com.dsh.account.dto.TStudentDto">
        SELECT * FROM (
        SELECT
        st.* ,us.`name` AS userName,us.provinceCode as province,us.cityCode as city
        FROM
        t_student st
        LEFT JOIN t_app_user us on st.appUserId = us.id) o
        <where>
            <if test="item.province != null and item.province != ''">
                and o.province = #{item.province}
            </if>
            <if test="item.city != null and item.city != ''">
                and o.city = #{item.city}
            </if>
            <if test="item.name != null and item.name != ''">
                and o.name LIKE CONCAT('%',#{item.name},'%')
            </if>
            <if test="item.userName != null and item.userName != ''">
                and o.userName LIKE CONCAT('%',#{item.userName},'%')
            </if>
            <if test="item.phone != null and item.phone != ''">
                and o.phone LIKE CONCAT('%',#{item.phone},'%')
            </if>
            <if test="item.ids != null and item.ids.size >0 ">
                and o.appUserId in
                <foreach collection="item.ids" separator="," open="(" item="id" close=")">
                    #{id}
                </foreach>
            </if>
        and o.state!=3
        </where>
 
    </select>
    <select id="selectWebOne" resultType="com.dsh.account.dto.TStudentDto">
        SELECT * FROM (
                          SELECT
                              st.* ,us.`name` AS userName,us.province,us.city
                          FROM
                              t_student st
                                  LEFT JOIN t_app_user us on st.appUserId = us.id
                        ) o
        where o.id = #{id}
 
    </select>
    <select id="getHistory" resultType="com.dsh.account.dto.GetHistoryDto">
        SELECT
 
    </select>
 
 
    <select id="getGiftSelect" resultType="java.lang.Integer">
            SELECT appUserId FROM t_student
            WHERE name = #{giftSearchDto.name}
              AND phone = #{giftSearchDto.phone}
    </select>
 
 
    <select id="queryCom" resultType="java.util.Map">
        SELECT
            es.id as id ,es.coachId,es.content,es.insertTime,es.imgs as images
        FROM
 
            t_evaluate_student es
 
        where es.studentId = #{id}
 
 
 
 
    </select>
</mapper>