|
|
@@ -1,237 +0,0 @@
|
|
|
-<?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.usoftchina.smartschool.device.mapper.DeviceMapper" >
|
|
|
- <resultMap id="CurriculumDetailDTOMap" type="com.usoftchina.smartschool.device.po.Device">
|
|
|
- <id column="deviceId" property="deviceId" jdbcType="BIGINT" />
|
|
|
- <result column="deviceName" property="deviceName" jdbcType="VARCHAR" />
|
|
|
- <result column="deviceIp" property="deviceIp" jdbcType="VARCHAR" />
|
|
|
- <result column="devicePort" property="devicePort" jdbcType="VARCHAR" />
|
|
|
- <result column="deviceUser" property="deviceUser" jdbcType="VARCHAR" />
|
|
|
- <result column="devicePassword" property="devicePassword" jdbcType="VARCHAR"/>
|
|
|
- </resultMap>
|
|
|
- <select id="findAll" resultMap="deviceInfoMap">
|
|
|
- select * from device
|
|
|
- </select>
|
|
|
-
|
|
|
- <resultMap id="deviceInfoMap" type="com.usoftchina.smartschool.device.dto.DeviceInfo">
|
|
|
- <result column="deviceIp" property="ip" jdbcType="VARCHAR" />
|
|
|
- <result column="devicePort" property="port" jdbcType="INTEGER" />
|
|
|
- <result column="deviceUser" property="username" jdbcType="VARCHAR" />
|
|
|
- <result column="devicePassword" property="password" jdbcType="VARCHAR"/>
|
|
|
- </resultMap>
|
|
|
-
|
|
|
- <select id="selectByConditon" resultType="com.usoftchina.smartschool.device.po.Device">
|
|
|
- select * from device
|
|
|
- <where>
|
|
|
- <if test="con != null">
|
|
|
- ${con}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ORDER BY deviceId DESC
|
|
|
- </select>
|
|
|
-
|
|
|
-
|
|
|
- <insert id="insertSelective" parameterType="com.usoftchina.smartschool.device.po.Device" >
|
|
|
- <selectKey resultType="java.lang.Long" keyProperty="deviceId">
|
|
|
- SELECT LAST_INSERT_ID() AS ID
|
|
|
- </selectKey>
|
|
|
- insert into device
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
- <if test="deviceUser != null" >
|
|
|
- deviceUser,
|
|
|
- </if>
|
|
|
- <if test="devicePassword != null" >
|
|
|
- devicePassword,
|
|
|
- </if>
|
|
|
- <if test="deviceIp != null" >
|
|
|
- deviceIp,
|
|
|
- </if>
|
|
|
- <if test="devicePort != null" >
|
|
|
- devicePort,
|
|
|
- </if>
|
|
|
- <if test="deviceRemark != null" >
|
|
|
- deviceRemark,
|
|
|
- </if>
|
|
|
- <if test="deviceName != null" >
|
|
|
- deviceName,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
- <if test="deviceUser != null" >
|
|
|
- #{deviceUser,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="devicePassword != null" >
|
|
|
- #{devicePassword,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="deviceIp != null" >
|
|
|
- #{deviceIp,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="devicePort != null" >
|
|
|
- #{devicePort,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="deviceRemark != null" >
|
|
|
- #{deviceRemark,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="deviceName != null" >
|
|
|
- #{deviceName,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
-
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.device.po.Device" >
|
|
|
- update device
|
|
|
- <set >
|
|
|
- <if test="deviceUser != null" >
|
|
|
- deviceUser = #{deviceUser,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="devicePort != null" >
|
|
|
- devicePort = #{devicePort,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="devicePassword != null" >
|
|
|
- devicePassword = #{devicePassword,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="deviceIp != null" >
|
|
|
- deviceIp = #{deviceIp,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="deviceRemark != null" >k
|
|
|
- deviceRemark = #{deviceRemark,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="deviceName != null" >
|
|
|
- deviceName = #{deviceName,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where deviceId = #{deviceId,jdbcType=BIGINT}
|
|
|
- </update>
|
|
|
-
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="long">
|
|
|
- delete from device where deviceId = #{id}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <select id="selectInfoByCardNo" parameterType="string" resultMap="information">
|
|
|
- select school_appid,school_secret,sys_parents.openid,sys_student.stu_name,sys_student.stu_id,sys_school.school_id,
|
|
|
- stu_number,sys_student.clazz_id,stu_class,stu_grade,stu_classnickname,stu_sex from sys_student left join sys_school on sys_student.school_id=sys_school.school_id
|
|
|
- left join sys_parents_stu on sys_student.stu_id=sys_parents_stu.stu_id left join sys_parents on sys_parents.parent_id =
|
|
|
- sys_parents_stu.parent_id where stu_cardNo = #{cardNo}
|
|
|
- </select>
|
|
|
-
|
|
|
- <resultMap id="information" type="com.usoftchina.smartschool.device.po.Information" >
|
|
|
- <result column="school_appid" property="appId" jdbcType="VARCHAR" />
|
|
|
- <result column="school_secret" property="secret" jdbcType="VARCHAR" />
|
|
|
- <result column="openid" property="openId" jdbcType="VARCHAR" />
|
|
|
- <result column="stu_name" property="stuName" jdbcType="VARCHAR" />
|
|
|
- <result column="stu_id" property="stuId" jdbcType="BIGINT"/>
|
|
|
- <result column="school_id" property="schoolId" jdbcType="BIGINT"/>
|
|
|
- <result column="stu_number" property="stuNumber" jdbcType="VARCHAR" />
|
|
|
- <result column="clazz_id" property="clazz_id" jdbcType="BIGINT" />
|
|
|
- <result column="stu_class" property="stuClass" jdbcType="VARCHAR" />
|
|
|
- <result column="stu_grade" property="stuGrade" jdbcType="VARCHAR" />
|
|
|
- <result column="stu_classnickname" property="stuClassnickname" jdbcType="VARCHAR"/>
|
|
|
- <result column="stu_sex" property="stuSex" jdbcType="INTEGER"/>
|
|
|
- </resultMap>
|
|
|
-
|
|
|
- <insert id="insertRecordSelective" parameterType="com.usoftchina.smartschool.device.po.OutInRecord" >
|
|
|
- insert into out_in_record
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
- <if test="record_name != null" >
|
|
|
- record_name,
|
|
|
- </if>
|
|
|
- <if test="out_date != null" >
|
|
|
- out_date,
|
|
|
- </if>
|
|
|
- <if test="in_date != null" >
|
|
|
- in_date,
|
|
|
- </if>
|
|
|
- <if test="record_details != null" >
|
|
|
- record_details,
|
|
|
- </if>
|
|
|
- <if test="record_remarks != null" >
|
|
|
- record_remarks,
|
|
|
- </if>
|
|
|
- <if test="device_id != null" >
|
|
|
- device_id,
|
|
|
- </if>
|
|
|
- <if test="stu_id != null" >
|
|
|
- stu_id,
|
|
|
- </if>
|
|
|
- <if test="school_id != null" >
|
|
|
- school_id,
|
|
|
- </if>
|
|
|
- <if test="stu_number != null" >
|
|
|
- stu_number,
|
|
|
- </if>
|
|
|
- <if test="clazz_id != null" >
|
|
|
- clazz_id,
|
|
|
- </if>
|
|
|
- <if test="clazz_name != null" >
|
|
|
- clazz_name,
|
|
|
- </if>
|
|
|
- <if test="grade_name != null" >
|
|
|
- grade_name,
|
|
|
- </if>
|
|
|
- <if test="grade_clazz != null" >
|
|
|
- grade_clazz,
|
|
|
- </if>
|
|
|
- <if test="stu_sex != null" >
|
|
|
- stu_sex,
|
|
|
- </if>
|
|
|
- <if test="record_type != null" >
|
|
|
- record_type,
|
|
|
- </if>
|
|
|
- <if test="record_date != null" >
|
|
|
- record_date,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
- <if test="record_name != null" >
|
|
|
- #{record_name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="out_date != null" >
|
|
|
- #{out_date,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="in_date != null" >
|
|
|
- #{in_date,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="record_details != null" >
|
|
|
- #{record_details,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record_remarks != null" >
|
|
|
- #{record_remarks,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="device_id != null" >
|
|
|
- #{device_id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="stu_id != null" >
|
|
|
- #{stu_id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="school_id != null" >
|
|
|
- #{school_id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="stu_number != null" >
|
|
|
- #{stu_number,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="clazz_id != null" >
|
|
|
- #{clazz_id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="clazz_name != null" >
|
|
|
- #{clazz_name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="grade_name != null" >
|
|
|
- #{grade_name,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="grade_clazz != null" >
|
|
|
- #{grade_clazz,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="stu_sex != null" >
|
|
|
- #{stu_sex,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record_type != null" >
|
|
|
- #{record_type,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record_date != null" >
|
|
|
- #{record_date,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
-
|
|
|
-</mapper>
|