|
|
@@ -0,0 +1,148 @@
|
|
|
+<?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.zd.laboratory.mapper.XxpCardInfoMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.zd.laboratory.domain.XxpCardInfo" id="XxpCardInfoResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="cardName" column="card_name"/>
|
|
|
+ <result property="cardNum" column="card_num"/>
|
|
|
+ <result property="college" column="college"/>
|
|
|
+ <result property="location" column="location"/>
|
|
|
+ <result property="operate" column="operate"/>
|
|
|
+ <result property="subjectId" column="subject_id"/>
|
|
|
+ <result property="subjectName" column="subject_name"/>
|
|
|
+ <result property="deptId" column="dept_id"/>
|
|
|
+ <result property="deptName" column="dept_name"/>
|
|
|
+ <result property="isStart" column="is_start"/>
|
|
|
+
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectXxpCardInfo">
|
|
|
+ select id,
|
|
|
+ card_name,
|
|
|
+ card_num,
|
|
|
+ college,
|
|
|
+ location,
|
|
|
+ operate,
|
|
|
+ subject_id,
|
|
|
+ subject_name,
|
|
|
+ dept_id,
|
|
|
+ dept_name,
|
|
|
+ is_start,
|
|
|
+ user_id,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time
|
|
|
+ from xxp_card_info t
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectXxpCardInfoList" parameterType="com.zd.laboratory.domain.XxpCardInfo"
|
|
|
+ resultMap="XxpCardInfoResult">
|
|
|
+ <include refid="selectXxpCardInfo"/>
|
|
|
+ <where>
|
|
|
+ <if test="cardName != null and cardName != null">and t.card_name = #{cardName}</if>
|
|
|
+ <if test="cardNum != null and cardNum != ''">and t.card_num = #{cardNum}</if>
|
|
|
+ <if test="college != null and college != null">and t.college = #{college}</if>
|
|
|
+ <if test="location != null and location != '' ">and t.location = #{location}</if>
|
|
|
+ <if test="operate != null ">and t.operate = #{operate}</if>
|
|
|
+ <if test="subject_id != null ">and t.subject_id = #{subjectId}</if>
|
|
|
+ <if test="subjectName != null ">and t.subject_name = #{subjectName}</if>
|
|
|
+ <if test="deptId != null ">and t.dept_id = #{deptId}</if>
|
|
|
+ <if test="deptName != null ">and t.dept_name = #{deptName}</if>
|
|
|
+ <if test="isStart != null ">and t.is_start = #{isStart}</if>
|
|
|
+ <if test="userId != null ">and t.user_id = #{userId}</if>
|
|
|
+ <if test="createBy != null ">and t.create_by = #{createBy}</if>
|
|
|
+ <if test="createTime != null ">and t.create_time = #{createTime}</if>
|
|
|
+ <if test="updateBy != null ">and t.update_by = #{updateBy}</if>
|
|
|
+ <if test="updateTime != null">and t.update_time =#{updateTime}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectXxpCardInfoById" resultMap="XxpCardInfoResult">
|
|
|
+ <include refid="selectXxpCardInfo"/>
|
|
|
+ where t.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertXxpCardInfo" parameterType="com.zd.laboratory.domain.XxpCardInfo">
|
|
|
+ insert into xxp_card_info
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="cardName != null">card_name,</if>
|
|
|
+ <if test="cardNum != null">card_num,</if>
|
|
|
+ <if test="college != null">college,</if>
|
|
|
+ <if test="location != null">location,</if>
|
|
|
+ <if test="operate != null">operate,</if>
|
|
|
+ <if test="subjectId != null">subject_id,</if>
|
|
|
+ <if test="subjectName != null">subject_name,</if>
|
|
|
+ <if test="deptId != null">dept_id,</if>
|
|
|
+ <if test="deptName != null">dept_name,</if>
|
|
|
+ <if test="isStart != null">is_start,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="cardName != null">#{cardName},</if>
|
|
|
+ <if test="cardNum != null">#{cardNum},</if>
|
|
|
+ <if test="college != null">#{college},</if>
|
|
|
+ <if test="location != null">#{location},</if>
|
|
|
+ <if test="operate != null">#{operate},</if>
|
|
|
+ <if test="subjectId != null">#{subjectId},</if>
|
|
|
+ <if test="subjectName != null">#{subjectName},</if>
|
|
|
+ <if test="deptId != null">#{deptId},</if>
|
|
|
+ <if test="deptName != null">#{deptName},</if>
|
|
|
+ <if test="isStart != null">#{isStart},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateXxpCardInfo" parameterType="com.zd.laboratory.domain.XxpCardInfo">
|
|
|
+ update xxp_card_info
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="cardNum != null">card_name = #{cardNum},</if>
|
|
|
+ <if test="cardNum != null">card_num = #{cardNum},</if>
|
|
|
+
|
|
|
+ <if test="college != null">college = #{college},</if>
|
|
|
+ <if test="location != null">location = #{location},</if>
|
|
|
+ <if test="operate != null">operate = #{operate},</if>
|
|
|
+ <if test="subjectId != null">subject_id = #{subjectId},</if>
|
|
|
+ <if test="subjectName != null">subject_name = #{subjectName},</if>
|
|
|
+ <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
+ <if test="deptName != null">dept_name = #{deptName},</if>
|
|
|
+ <if test="isStart != null">is_start = #{isStart},</if>
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteXxpCardInfoById">
|
|
|
+ delete
|
|
|
+ from xxp_card_info
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteXxpCardInfoByIds">
|
|
|
+ delete from xxp_card_info where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|