|
@@ -5,10 +5,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<mapper namespace="com.ruoyi.system.mapper.InvestigateDispositionMapper">
|
|
<mapper namespace="com.ruoyi.system.mapper.InvestigateDispositionMapper">
|
|
|
|
|
|
<resultMap type="InvestigateDisposition" id="InvestigateDispositionResult">
|
|
<resultMap type="InvestigateDisposition" id="InvestigateDispositionResult">
|
|
- <result property="id" column="id" />
|
|
|
|
- <result property="investigateId" column="investigate_id" />
|
|
|
|
|
|
+ <result property="investigateDispositionId" column="investigate_disposition_id" />
|
|
|
|
+ <result property="parentId" column="parent_id" />
|
|
|
|
+ <result property="ancestors" column="ancestors" />
|
|
|
|
+ <result property="orderNum" column="order_num" />
|
|
<result property="title" column="title" />
|
|
<result property="title" column="title" />
|
|
<result property="url" column="url" />
|
|
<result property="url" column="url" />
|
|
|
|
+ <result property="status" column="status" />
|
|
|
|
+ <result property="parentName" column="parent_name" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateBy" column="update_by" />
|
|
@@ -17,29 +21,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectInvestigateDispositionVo">
|
|
<sql id="selectInvestigateDispositionVo">
|
|
- select id, investigate_id, title, url, create_by, create_time, update_by, update_time, remark from investigate_disposition
|
|
|
|
|
|
+ select investigate_disposition_id, parent_id, ancestors, order_num, title, url, status, create_by, create_time, update_by, update_time, remark from investigate_disposition
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectInvestigateDispositionList" parameterType="InvestigateDisposition" resultMap="InvestigateDispositionResult">
|
|
<select id="selectInvestigateDispositionList" parameterType="InvestigateDisposition" resultMap="InvestigateDispositionResult">
|
|
<include refid="selectInvestigateDispositionVo"/>
|
|
<include refid="selectInvestigateDispositionVo"/>
|
|
<where>
|
|
<where>
|
|
- <if test="investigateId != null "> and investigate_id = #{investigateId}</if>
|
|
|
|
|
|
+ <if test="parentId != null "> and parent_id = #{parentId}</if>
|
|
|
|
+ <if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
|
|
|
|
+ <if test="orderNum != null "> and order_num = #{orderNum}</if>
|
|
<if test="title != null and title != ''"> and title = #{title}</if>
|
|
<if test="title != null and title != ''"> and title = #{title}</if>
|
|
<if test="url != null and url != ''"> and url = #{url}</if>
|
|
<if test="url != null and url != ''"> and url = #{url}</if>
|
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="selectInvestigateDispositionById" parameterType="Long" resultMap="InvestigateDispositionResult">
|
|
|
|
|
|
+ <select id="selectInvestigateDispositionByInvestigateDispositionId" parameterType="Long" resultMap="InvestigateDispositionResult">
|
|
<include refid="selectInvestigateDispositionVo"/>
|
|
<include refid="selectInvestigateDispositionVo"/>
|
|
- where id = #{id}
|
|
|
|
|
|
+ where investigate_disposition_id = #{investigateDispositionId}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <insert id="insertInvestigateDisposition" parameterType="InvestigateDisposition" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
|
+ <insert id="insertInvestigateDisposition" parameterType="InvestigateDisposition" useGeneratedKeys="true" keyProperty="investigateDispositionId">
|
|
insert into investigate_disposition
|
|
insert into investigate_disposition
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
- <if test="investigateId != null">investigate_id,</if>
|
|
|
|
|
|
+ <if test="parentId != null">parent_id,</if>
|
|
|
|
+ <if test="ancestors != null">ancestors,</if>
|
|
|
|
+ <if test="orderNum != null">order_num,</if>
|
|
<if test="title != null">title,</if>
|
|
<if test="title != null">title,</if>
|
|
<if test="url != null">url,</if>
|
|
<if test="url != null">url,</if>
|
|
|
|
+ <if test="status != null">status,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
@@ -47,9 +57,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="remark != null">remark,</if>
|
|
<if test="remark != null">remark,</if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
- <if test="investigateId != null">#{investigateId},</if>
|
|
|
|
|
|
+ <if test="parentId != null">#{parentId},</if>
|
|
|
|
+ <if test="ancestors != null">#{ancestors},</if>
|
|
|
|
+ <if test="orderNum != null">#{orderNum},</if>
|
|
<if test="title != null">#{title},</if>
|
|
<if test="title != null">#{title},</if>
|
|
<if test="url != null">#{url},</if>
|
|
<if test="url != null">#{url},</if>
|
|
|
|
+ <if test="status != null">#{status},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
@@ -61,26 +74,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<update id="updateInvestigateDisposition" parameterType="InvestigateDisposition">
|
|
<update id="updateInvestigateDisposition" parameterType="InvestigateDisposition">
|
|
update investigate_disposition
|
|
update investigate_disposition
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
- <if test="investigateId != null">investigate_id = #{investigateId},</if>
|
|
|
|
|
|
+ <if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
|
+ <if test="ancestors != null">ancestors = #{ancestors},</if>
|
|
|
|
+ <if test="orderNum != null">order_num = #{orderNum},</if>
|
|
<if test="title != null">title = #{title},</if>
|
|
<if test="title != null">title = #{title},</if>
|
|
<if test="url != null">url = #{url},</if>
|
|
<if test="url != null">url = #{url},</if>
|
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
</trim>
|
|
</trim>
|
|
- where id = #{id}
|
|
|
|
|
|
+ where investigate_disposition_id = #{investigateDispositionId}
|
|
</update>
|
|
</update>
|
|
|
|
|
|
- <delete id="deleteInvestigateDispositionById" parameterType="Long">
|
|
|
|
- delete from investigate_disposition where id = #{id}
|
|
|
|
|
|
+ <delete id="deleteInvestigateDispositionByInvestigateDispositionId" parameterType="Long">
|
|
|
|
+ delete from investigate_disposition where investigate_disposition_id = #{investigateDispositionId}
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
- <delete id="deleteInvestigateDispositionByIds" parameterType="String">
|
|
|
|
- delete from investigate_disposition where id in
|
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
- #{id}
|
|
|
|
|
|
+ <delete id="deleteInvestigateDispositionByInvestigateDispositionIds" parameterType="String">
|
|
|
|
+ delete from investigate_disposition where investigate_disposition_id in
|
|
|
|
+ <foreach item="investigateDispositionId" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{investigateDispositionId}
|
|
</foreach>
|
|
</foreach>
|
|
</delete>
|
|
</delete>
|
|
|
|
+
|
|
|
|
+ <select id="selectInvestigateDispositionById" parameterType="Long" resultMap="InvestigateDispositionResult">
|
|
|
|
+ select d.investigate_disposition_id, d.parent_id, d.ancestors, d.order_num, d.title, d.url, d.status,
|
|
|
|
+ (select title from investigate_disposition where investigate_disposition_id = d.investigate_disposition_id) parent_name
|
|
|
|
+ from investigate_disposition d
|
|
|
|
+ where d.investigate_disposition_id = #{investigateDispositionId}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectChildrenInvestigateDispositionById" parameterType="Long" resultMap="InvestigateDispositionResult">
|
|
|
|
+ select * from investigate_disposition where find_in_set(#{investigateDispositionId}, ancestors)
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <update id="updateInvestigateDispositionChildren" parameterType="java.util.List">
|
|
|
|
+ update investigate_disposition set ancestors =
|
|
|
|
+ <foreach collection="investigateDispositions" item="item" index="index"
|
|
|
|
+ separator=" " open="case investigate_disposition_id" close="end">
|
|
|
|
+ when #{investigateDispositionId} then #{item.ancestors}
|
|
|
|
+ </foreach>
|
|
|
|
+ where investigate_disposition_id in
|
|
|
|
+ <foreach collection="investigateDispositions" item="item" index="index"
|
|
|
|
+ separator="," open="(" close=")">
|
|
|
|
+ #{investigateDispositionId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </update>
|
|
</mapper>
|
|
</mapper>
|