|
@@ -38,25 +38,28 @@
|
|
|
UPDATE exam_location
|
|
|
<set>
|
|
|
<if test="address != null">
|
|
|
- address_ = #{address},
|
|
|
+ address_ = #{address},
|
|
|
</if>
|
|
|
<if test="isAvailable != null">
|
|
|
- is_available_ = #{isAvailable},
|
|
|
+ is_available_ = #{isAvailable},
|
|
|
</if>
|
|
|
<if test="id != null">
|
|
|
- id_ = #{id},
|
|
|
+ id_ = #{id},
|
|
|
</if>
|
|
|
<if test="contactPhone != null">
|
|
|
- contact_phone_ = #{contactPhone},
|
|
|
+ contact_phone_ = #{contactPhone},
|
|
|
</if>
|
|
|
<if test="contactName != null">
|
|
|
- contact_name_ = #{contactName},
|
|
|
+ contact_name_ = #{contactName},
|
|
|
</if>
|
|
|
<if test="name != null">
|
|
|
- name_ = #{name},
|
|
|
+ name_ = #{name},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag!=null">
|
|
|
+ del_flag_=#{delFlag},
|
|
|
</if>
|
|
|
<if test="createTime != null">
|
|
|
- create_time_ = #{createTime},
|
|
|
+ create_time_ = #{createTime},
|
|
|
</if>
|
|
|
update_time_ = NOW()
|
|
|
</set> WHERE id_ = #{id}
|
|
@@ -66,14 +69,30 @@
|
|
|
<delete id="delete" >
|
|
|
DELETE FROM exam_location WHERE id_ = #{id}
|
|
|
</delete>
|
|
|
+
|
|
|
+ <sql id="queryCondition">
|
|
|
+ <where>
|
|
|
+ del_flag_=0
|
|
|
+ <if test="isAvailable!=null">
|
|
|
+ AND is_available_=#{isAvailable}
|
|
|
+ </if>
|
|
|
+ <if test="search!=null">
|
|
|
+ AND (id_=#{search} OR name_ LIKE CONCAT('%', #{serch}, '%'))
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="ExamLocation" parameterType="map">
|
|
|
- SELECT * FROM exam_location ORDER BY id_ <include refid="global.limit"/>
|
|
|
+ SELECT * FROM exam_location
|
|
|
+ <include refid="queryCondition"/>
|
|
|
+ ORDER BY id_
|
|
|
+ <include refid="global.limit"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
SELECT COUNT(*) FROM exam_location
|
|
|
+ <include refid="queryCondition"/>
|
|
|
</select>
|
|
|
</mapper>
|