SearchDao.java 1.59 KB
package com.example.dahua.dao;

import com.example.dahua.bean.CheckIn;
import com.example.dahua.bean.Message;
import com.example.dahua.bean.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SearchDao {
    /**
     * 考勤推送存储过程
     * @param checkIn
     * @return
     */
    int checkIn(CheckIn checkIn);

    /**
     * 获取学生信息
     * @param cardNum
     * @return
     */
    List<User> selectUserByCardNum(String cardNum);

    /**
     * 获取卡号
     * @param cardNo
     * @return
     */
    @Select("select Top(1) StudentNum from HS_LeaveExaminePassList where StudentNum= #{cardNo} and GETDATE() <![CDATA[ > ]]> LeaveTime and GETDATE()  <![CDATA[ < ]]> ReturnTime")
    String checkLeave(@Param("cardNo") String cardNo);

    /**
     * 获取学生父母电话
     * @param cardNo
     * @return
     */
    @Select("select school_id , ParentMobile , name from SZ_V_School_Student where student_num = #{cardNo}")
    Message selectByParentMobile(@Param("cardNo") String cardNo);

    /**
     * 插入短信发送表
     * @param tableName
     * @param schoolId
     * @param mobile
     * @param msg
     */
    @Select("insert into ${tableName} (SchoolID,Mobile,Msg,tdtype,Status,IsNeedSend,SendTime,intime) values (#{schoolId},#{mobile},#{msg},1,0,1,GETDATE(),GETDATE())")
    void insertMessage(@Param("tableName") String tableName,@Param("schoolId") String schoolId,@Param("mobile") String mobile,@Param("msg") String msg);


}