91 lines
3.7 KiB
XML
91 lines
3.7 KiB
XML
![]() |
<?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="pc.exam.pp.module.exam.dal.mysql.ExamSpecialtyMapper">
|
||
|
|
||
|
<resultMap type="ExamSpecialty" id="ExamSpecialtyResult">
|
||
|
<result property="spId" column="sp_id" />
|
||
|
<result property="parentId" column="parent_id" />
|
||
|
<result property="ancestors" column="ancestors" />
|
||
|
<result property="spName" column="sp_name" />
|
||
|
<result property="orderNum" column="order_num" />
|
||
|
<result property="status" column="status" />
|
||
|
<result property="unite" column="unite" />
|
||
|
<result property="treeNum" column="tree_num" />
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectExamSpecialtyVo">
|
||
|
select sp_id, parent_id, ancestors, sp_name, order_num, status, creator, create_time, updater, update_time, unite, tree_num, tenant_id from exam_specialty
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectExamSpecialtyListVo" resultType="pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo">
|
||
|
select sp_id as id, sp_name as name, parent_id, status, create_time from exam_specialty
|
||
|
<where>
|
||
|
<if test="name != null and name != ''"> and sp_name like concat('%', #{name}, '%')</if>
|
||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||
|
and deleted = 0
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectExamSpecialtyList" resultType="ExamSpecialty">
|
||
|
<include refid="selectExamSpecialtyVo"/>
|
||
|
<where>
|
||
|
<if test="name != null and name != ''"> and sp_name like concat('%', #{name}, '%')</if>
|
||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||
|
and deleted = 0
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectSpIds" parameterType="ExamSpecialty" resultMap="ExamSpecialtyResult">
|
||
|
<include refid="selectExamSpecialtyVo"/>
|
||
|
<!-- <where>-->
|
||
|
<!-- <if test="spId != null "> and sp_id = #{spId}</if>-->
|
||
|
<!-- </where>-->
|
||
|
where sp_id in
|
||
|
<foreach item="spId" collection="array" open="(" separator="," close=")">
|
||
|
#{spId}
|
||
|
</foreach>
|
||
|
</select>
|
||
|
|
||
|
|
||
|
<update id="updateExamSpecialty" parameterType="ExamSpecialty">
|
||
|
update exam_specialty
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
||
|
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
||
|
<if test="spName != null">sp_name = #{spName},</if>
|
||
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||
|
<if test="status != null">status = #{status},</if>
|
||
|
<if test="unite != null">unite = #{unite},</if>
|
||
|
<if test="treeNum != null">tree_num = #{treeNum},</if>
|
||
|
</trim>
|
||
|
where sp_id = #{spId}
|
||
|
</update>
|
||
|
|
||
|
<select id="selectExamSpecialtyBySpId" parameterType="Long" resultMap="ExamSpecialtyResult">
|
||
|
<include refid="selectExamSpecialtyVo"/>
|
||
|
where sp_id = #{spId}
|
||
|
</select>
|
||
|
|
||
|
<update id="deleteExamSpecialtyBySpId" parameterType="Long">
|
||
|
update exam_specialty
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
deleted = 1
|
||
|
</trim>
|
||
|
where sp_id = #{spId}
|
||
|
</update>
|
||
|
|
||
|
<update id="deleteExamSpecialtyBySpIds" parameterType="String">
|
||
|
update exam_specialty
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
deleted = 1
|
||
|
</trim>
|
||
|
where sp_id in
|
||
|
<foreach item="spId" collection="array" open="(" separator="," close=")">
|
||
|
#{spId}
|
||
|
</foreach>
|
||
|
</update>
|
||
|
|
||
|
</mapper>
|