Parcourir la source

添加组长教练员查询

小么熊🐻 il y a 1 an
Parent
commit
0d530b47bb

+ 8 - 4
jsjp-service/src/main/resources/mapper/tms/TmsStudentInfoMapper.xml

@@ -108,11 +108,12 @@
         <where>
             AND t1.TSO_BUSITYPE in ('0', '1')
             AND t1.TSO_LOGOUT = 0
-            <if test="coachId!=null" > AND t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC } </if>
             <if test="appCoachId!=null" > AND t1.TSO_APP_COACH_ID = #{appCoachId,jdbcType=NUMERIC } </if>
             <if test="field != null  and field != ''"> AND (t1.Tso_Name like '%' || #{field,jdbcType=VARCHAR} || '%' or t1.TSO_IDCARD like '%' || #{field,jdbcType=VARCHAR} || '%' or t1.Tso_Phone like '%' || #{field,jdbcType=VARCHAR} || '%') </if>
             <if test="schoolId != null "> and t1.TSO_SCHOOL_ID = #{schoolId,jdbcType=NUMERIC} </if>
             <if test="state != null  and state != ''"> AND t1.TSO_STATE = #{state,jdbcType=VARCHAR }</if>
+            <if test="coachId!=null" >  AND ( t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC }
+                                        or t1.TSO_COACH_LEADER = #{coachId,jdbcType=NUMERIC } ) </if>
         </where>
         ORDER BY t1.TSO_ID desc
     </select>
@@ -124,10 +125,11 @@
         <where>
             AND t1.TSO_BUSITYPE in ('0', '1')
             AND t1.TSO_LOGOUT = 0
-            <if test="coachId!=null" > AND t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC } </if>
             <if test="appCoachId!=null" > AND t1.TSO_APP_COACH_ID = #{appCoachId,jdbcType=NUMERIC } </if>
             <if test="field != null  and field != ''"> AND (t1.Tso_Name like '%' || #{field,jdbcType=VARCHAR} || '%' or t1.TSO_IDCARD like '%' || #{field,jdbcType=VARCHAR} || '%' or t1.Tso_Phone like '%' || #{field,jdbcType=VARCHAR} || '%') </if>
             <if test="schoolId != null "> and t1.TSO_SCHOOL_ID = #{schoolId,jdbcType=NUMERIC} </if>
+            <if test="coachId!=null" >  AND ( t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC }
+                                        or t1.TSO_COACH_LEADER = #{coachId,jdbcType=NUMERIC } ) </if>
         </where>
         ORDER BY t1.TSO_ID desc
     </select>
@@ -153,7 +155,8 @@
                     #{sid}
                 </foreach>
             </if>
-            <if test="coachId!=null" > AND t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC } </if>
+            <if test="coachId!=null" >  AND ( t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC }
+                                        or t1.TSO_COACH_LEADER = #{coachId,jdbcType=NUMERIC } ) </if>
         </where>
         union
         select t1.TSO_ID, t1.TSO_IDCARD, t1.TSO_NAME,t1.TSO_SEX,t1.Tso_Phone,t1.TSO_APPLYDATE, t1.TSO_STATE , t1.
@@ -172,7 +175,8 @@
                     #{sid}
                 </foreach>
             </if>
-            <if test="coachId!=null" > AND t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC } </if>
+            <if test="coachId!=null" >  AND ( t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC }
+                                        or t1.TSO_COACH_LEADER = #{coachId,jdbcType=NUMERIC } )</if>
         </where>
         )
         ORDER BY TSO_ID desc