|
@@ -6,6 +6,7 @@
|
|
|
|
|
|
|
|
<resultMap type="DzClasses" id="DzClassesResult">
|
|
<resultMap type="DzClasses" id="DzClassesResult">
|
|
|
<result property="classId" column="class_id" />
|
|
<result property="classId" column="class_id" />
|
|
|
|
|
+ <result property="deptId" column="dept_id" />
|
|
|
<result property="schoolId" column="school_id" />
|
|
<result property="schoolId" column="school_id" />
|
|
|
<result property="year" column="year" />
|
|
<result property="year" column="year" />
|
|
|
<result property="name" column="name" />
|
|
<result property="name" column="name" />
|
|
@@ -29,7 +30,7 @@
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectDzClassesVo">
|
|
<sql id="selectDzClassesVo">
|
|
|
- select t1.class_id, t1.school_id, t1.year, t1.name, t1.online, t1.status, t1.stats, t1.create_time, t1.update_time,t1.is_default,
|
|
|
|
|
|
|
+ select t1.class_id, t1.dept_id, t1.school_id, t1.year, t1.name, t1.online, t1.status, t1.stats, t1.create_time, t1.update_time,t1.is_default,
|
|
|
t2.id, t2.name school_name, t2.dept_id, t2.pro, t2.city, t2.area
|
|
t2.id, t2.name school_name, t2.dept_id, t2.pro, t2.city, t2.area
|
|
|
from dz_classes t1
|
|
from dz_classes t1
|
|
|
left join dz_school t2 on t1.school_id=t2.id
|
|
left join dz_school t2 on t1.school_id=t2.id
|
|
@@ -39,6 +40,8 @@
|
|
|
<include refid="selectDzClassesVo"/>
|
|
<include refid="selectDzClassesVo"/>
|
|
|
<where>
|
|
<where>
|
|
|
<if test="schoolId != null "> and t1.school_id = #{schoolId}</if>
|
|
<if test="schoolId != null "> and t1.school_id = #{schoolId}</if>
|
|
|
|
|
+ <if test="deptId != null and deptId > 0 "> and t1.dept_id = #{deptId}</if>
|
|
|
|
|
+ <if test="deptId == 0 "> and t1.dept_id is null </if>
|
|
|
<if test="year != null "> and t1.year = #{year}</if>
|
|
<if test="year != null "> and t1.year = #{year}</if>
|
|
|
<if test="name != null and name != ''"> and t1.name like concat('%', #{name}, '%')</if>
|
|
<if test="name != null and name != ''"> and t1.name like concat('%', #{name}, '%')</if>
|
|
|
<if test="online != null "> and t1.online = #{online}</if>
|
|
<if test="online != null "> and t1.online = #{online}</if>
|
|
@@ -72,6 +75,7 @@
|
|
|
<insert id="insertDzClasses" parameterType="DzClasses" useGeneratedKeys="true" keyProperty="classId">
|
|
<insert id="insertDzClasses" parameterType="DzClasses" useGeneratedKeys="true" keyProperty="classId">
|
|
|
insert into dz_classes
|
|
insert into dz_classes
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="deptId != null">dept_id,</if>
|
|
|
<if test="schoolId != null">school_id,</if>
|
|
<if test="schoolId != null">school_id,</if>
|
|
|
<if test="year != null">year,</if>
|
|
<if test="year != null">year,</if>
|
|
|
<if test="name != null and name != ''">name,</if>
|
|
<if test="name != null and name != ''">name,</if>
|
|
@@ -83,6 +87,7 @@
|
|
|
<if test="isDefault != null">is_default,</if>
|
|
<if test="isDefault != null">is_default,</if>
|
|
|
</trim>
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="deptId != null">#{deptId},</if>
|
|
|
<if test="schoolId != null">#{schoolId},</if>
|
|
<if test="schoolId != null">#{schoolId},</if>
|
|
|
<if test="year != null">#{year},</if>
|
|
<if test="year != null">#{year},</if>
|
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
@@ -98,6 +103,7 @@
|
|
|
<update id="updateDzClasses" parameterType="DzClasses">
|
|
<update id="updateDzClasses" parameterType="DzClasses">
|
|
|
update dz_classes
|
|
update dz_classes
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
+ <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
<if test="schoolId != null">school_id = #{schoolId},</if>
|
|
<if test="schoolId != null">school_id = #{schoolId},</if>
|
|
|
<if test="year != null">year = #{year},</if>
|
|
<if test="year != null">year = #{year},</if>
|
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
<if test="name != null and name != ''">name = #{name},</if>
|