WorkMapper.xml 2.21 KB
<?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.ruoyi.service.mapper.WorkMapper">

	<insert id="insert" parameterType="com.ruoyi.service.domain.Work">
		insert into work(
		<if test="userId != null and userId != ''">userId,</if>
		<if test="message != null and message != ''">message,</if>
		<if test="workType != null and workType != ''">workType,</if>
		<if test="applicant != null and applicant != ''">applicant,</if>
		<if test="dept != null and dept != ''">dept,</if>
		<if test="workState != null and workState != ''">workState,</if>
		<if test="no != null and no != ''">no,</if>
		<if test="name != null and name != ''">name,</if>
		<if test="purpose != null and purpose != ''">purpose,</if>
		<if test="way != null and way != ''">way,</if>
		createTime
		)values(
		<if test="userId != null and userId != ''">#{userId},</if>
		<if test="message != null and message != ''">#{message},</if>
		<if test="workType != null and workType != ''">#{workType},</if>
		<if test="applicant != null and applicant != ''">#{applicant},</if>
		<if test="dept != null and dept != ''">#{dept},</if>
		<if test="workState != null and workState != ''">#{workState},</if>
		<if test="no != null and no != ''">#{no},</if>
		<if test="name != null and name != ''">#{name},</if>
		<if test="purpose != null and purpose != ''">#{purpose},</if>
		<if test="way != null and way != ''">#{way},</if>
		sysdate()
		)
	</insert>

	<select id="selectList" resultType="com.ruoyi.service.domain.Work" parameterType="com.ruoyi.service.domain.Work">
		select * from work
		where userId =#{userId}
		<if test="workType != null and workType != 0">
			AND workType =#{workType}
		</if>
		<if test="workState != null and workState != 0">
			AND workState =#{workState}
		</if>
	</select>

	<update id="update" parameterType="com.ruoyi.service.domain.Work">
		update work
		<set>
			<if test="workState != null and workState != ''">workState = #{workState},</if>
			<if test="examineType != null and examineType != ''">examineType = #{examineType},</if>
			<if test="mark != null">mark = #{mark},</if>
			updateTime = sysdate()
		</set>
		where id = #{id}
	</update>

</mapper>