|
|
@@ -0,0 +1,121 @@
|
|
|
+<?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.base.mapper.AgriculturalTasksMapper">
|
|
|
+
|
|
|
+ <resultMap type="AgriculturalTasks" id="AgriculturalTasksResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="plotId" column="plot_id" />
|
|
|
+ <result property="taskName" column="task_name" />
|
|
|
+ <result property="taskImages" column="task_images" />
|
|
|
+ <result property="typeName" column="type_name" />
|
|
|
+ <result property="taskStatus" column="task_status" />
|
|
|
+ <result property="executeTime" column="execute_time" />
|
|
|
+ <result property="assigneeId" column="assignee_id" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="completionTime" column="completion_time" />
|
|
|
+ <result property="completionDesc" column="completion_desc" />
|
|
|
+ <result property="creatorId" column="creator_id" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectAgriculturalTasksVo">
|
|
|
+ select id, plot_id, task_name, task_images, type_name, task_status, execute_time, assignee_id, remark, completion_time, completion_desc, creator_id, create_time, update_time from agricultural_tasks
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectAgriculturalTasksList" parameterType="AgriculturalTasks" resultMap="AgriculturalTasksResult">
|
|
|
+ <include refid="selectAgriculturalTasksVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="plotId != null "> and plot_id = #{plotId}</if>
|
|
|
+ <if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
|
|
|
+ <if test="taskImages != null and taskImages != ''"> and task_images = #{taskImages}</if>
|
|
|
+ <if test="typeName != null and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if>
|
|
|
+ <if test="taskStatus != null and taskStatus != ''"> and task_status = #{taskStatus}</if>
|
|
|
+ <if test="executeTime != null "> and execute_time = #{executeTime}</if>
|
|
|
+ <if test="assigneeId != null "> and assignee_id = #{assigneeId}</if>
|
|
|
+ <if test="completionTime != null "> and completion_time = #{completionTime}</if>
|
|
|
+ <if test="completionDesc != null and completionDesc != ''"> and completion_desc = #{completionDesc}</if>
|
|
|
+ <if test="creatorId != null "> and creator_id = #{creatorId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectAgriculturalTasksById" parameterType="Long" resultMap="AgriculturalTasksResult">
|
|
|
+ <include refid="selectAgriculturalTasksVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+ <select id="countStatusTypeTasks" resultType="java.lang.Integer" parameterType="AgriculturalTasks">
|
|
|
+ select count(*) from agricultural_tasks
|
|
|
+ <where>
|
|
|
+ <if test="plotId != null "> and plot_id = #{plotId}</if>
|
|
|
+ <if test="taskStatus != null and taskStatus != ''"> and task_status = #{taskStatus}</if>
|
|
|
+ <if test="assigneeId != null "> and assignee_id = #{assigneeId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertAgriculturalTasks" parameterType="AgriculturalTasks" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into agricultural_tasks
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="plotId != null">plot_id,</if>
|
|
|
+ <if test="taskName != null and taskName != ''">task_name,</if>
|
|
|
+ <if test="taskImages != null and taskImages != ''">task_images,</if>
|
|
|
+ <if test="typeName != null and typeName != ''">type_name,</if>
|
|
|
+ <if test="taskStatus != null">task_status,</if>
|
|
|
+ <if test="executeTime != null">execute_time,</if>
|
|
|
+ <if test="assigneeId != null">assignee_id,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="completionTime != null">completion_time,</if>
|
|
|
+ <if test="completionDesc != null">completion_desc,</if>
|
|
|
+ <if test="creatorId != null">creator_id,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="plotId != null">#{plotId},</if>
|
|
|
+ <if test="taskName != null and taskName != ''">#{taskName},</if>
|
|
|
+ <if test="taskImages != null and taskImages != ''">#{taskImages},</if>
|
|
|
+ <if test="typeName != null and typeName != ''">#{typeName},</if>
|
|
|
+ <if test="taskStatus != null">#{taskStatus},</if>
|
|
|
+ <if test="executeTime != null">#{executeTime},</if>
|
|
|
+ <if test="assigneeId != null">#{assigneeId},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="completionTime != null">#{completionTime},</if>
|
|
|
+ <if test="completionDesc != null">#{completionDesc},</if>
|
|
|
+ <if test="creatorId != null">#{creatorId},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateAgriculturalTasks" parameterType="AgriculturalTasks">
|
|
|
+ update agricultural_tasks
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="plotId != null">plot_id = #{plotId},</if>
|
|
|
+ <if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
|
|
|
+ <if test="taskImages != null and taskImages != ''">task_images = #{taskImages},</if>
|
|
|
+ <if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
|
|
|
+ <if test="taskStatus != null">task_status = #{taskStatus},</if>
|
|
|
+ <if test="executeTime != null">execute_time = #{executeTime},</if>
|
|
|
+ <if test="assigneeId != null">assignee_id = #{assigneeId},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="completionTime != null">completion_time = #{completionTime},</if>
|
|
|
+ <if test="completionDesc != null">completion_desc = #{completionDesc},</if>
|
|
|
+ <if test="creatorId != null">creator_id = #{creatorId},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteAgriculturalTasksById" parameterType="Long">
|
|
|
+ delete from agricultural_tasks where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteAgriculturalTasksByIds" parameterType="String">
|
|
|
+ delete from agricultural_tasks where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|