You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
JinJiHuJava/ruoyi-admin/src/main/resources/mapper/jjh/declaration/BmsApprovalInfoMapper.xml

176 lines
8.3 KiB

<?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.jjh.declaration.mapper.BmsApprovalInfoMapper">
<resultMap type="com.ruoyi.jjh.declaration.entity.BmsApprovalInfo" id="BmsApprovalInfoResult">
<result property="id" column="id"/>
<result property="processId" column="process_id"/>
<result property="declarationRecordsId" column="declaration_records_id"/>
<result property="approvalStatus" column="approval_status"/>
<result property="approvalOpinions" column="approval_opinions"/>
<result property="approvalAttachment" column="approval_attachment"/>
<result property="approvalTime" column="approval_time"/>
<result property="isReview" column="is_review"/>
<result property="isBeforeData" column="is_before_data"/>
<result property="sort" column="sort"/>
<result property="isDeleted" column="is_deleted"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectBmsApprovalInfoVo">
select id,
process_id,
declaration_records_id,
approval_status,
approval_opinions,
approval_attachment,
approval_time,
is_review,
sort,
is_before_data,
is_deleted,
create_by,
create_time,
update_by,
update_time,
remark
from bms_approval_info
</sql>
<select id="selectBmsApprovalInfoList" parameterType="com.ruoyi.jjh.declaration.entity.BmsApprovalInfo"
resultMap="BmsApprovalInfoResult">
<include refid="selectBmsApprovalInfoVo"/>
<where>
<if test="processId != null ">and process_id = #{processId}</if>
<if test="declarationRecordsId != null and declarationRecordsId != ''">and declaration_records_id =
#{declarationRecordsId}
</if>
<if test="approvalStatus != null ">and approval_status = #{approvalStatus}</if>
<if test="approvalOpinions != null and approvalOpinions != ''">and approval_opinions =
#{approvalOpinions}
</if>
<if test="approvalAttachment != null and approvalAttachment != ''">and approval_attachment =
#{approvalAttachment}
</if>
<if test="approvalTime != null and approvalTime != ''">and approval_time = #{approvalTime}</if>
<if test="isReview != null and isReview != ''">and is_review = #{isReview}</if>
<if test="isBeforeData != null and isBeforeData != ''">and is_before_data = #{isBeforeData}</if>
<if test="sort != null ">and sort = #{sort}</if>
<if test="isDeleted != null ">and is_deleted = #{isDeleted}</if>
</where>
</select>
<select id="selectBmsApprovalInfoById" parameterType="Long" resultMap="BmsApprovalInfoResult">
<include refid="selectBmsApprovalInfoVo"/>
where id = #{id}
</select>
<select id="getApprovalInfoList" resultType="com.ruoyi.jjh.declaration.entity.vo.BmsApprovalInfoQueryVo">
SELECT
a.id,
a.approval_by_id,
b.nick_name AS approvalByName,
a.approval_status,
a.approval_opinions,
a.approval_attachment,
a.approval_time,
a.is_before_data,
a.sort
FROM
bms_approval_info a
INNER JOIN sys_user b ON a.approval_by_id = b.user_id
<where>
a.declaration_records_id=#{declarationRecordsId}
</where>
order by a.sort asc
</select>
<insert id="insertBmsApprovalInfo" parameterType="com.ruoyi.jjh.declaration.entity.BmsApprovalInfo"
useGeneratedKeys="true" keyProperty="id">
insert into bms_approval_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="processId != null">process_id,</if>
<if test="declarationRecordsId != null">declaration_records_id,</if>
<if test="approvalStatus != null">approval_status,</if>
<if test="approvalOpinions != null">approval_opinions,</if>
<if test="approvalAttachment != null">approval_attachment,</if>
<if test="approvalTime != null">approval_time,</if>
<if test="isReview != null">is_review,</if>
<if test="isBeforeData != null">is_before_data,</if>
<if test="sort != null">sort,</if>
<if test="isDeleted != null">is_deleted,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="processId != null">#{processId},</if>
<if test="declarationRecordsId != null">#{declarationRecordsId},</if>
<if test="approvalStatus != null">#{approvalStatus},</if>
<if test="approvalOpinions != null">#{approvalOpinions},</if>
<if test="approvalAttachment != null">#{approvalAttachment},</if>
<if test="approvalTime != null">#{approvalTime},</if>
<if test="isReview != null">#{isReview},</if>
<if test="isBeforeData != null">#{isBeforeData},</if>
<if test="sort != null">#{sort},</if>
<if test="isDeleted != null">#{isDeleted},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateBmsApprovalInfo" parameterType="com.ruoyi.jjh.declaration.entity.BmsApprovalInfo">
update bms_approval_info
<trim prefix="SET" suffixOverrides=",">
<if test="processId != null">process_id = #{processId},</if>
<if test="declarationRecordsId != null">declaration_records_id = #{declarationRecordsId},</if>
<if test="approvalStatus != null">approval_status = #{approvalStatus},</if>
<if test="approvalOpinions != null">approval_opinions = #{approvalOpinions},</if>
<if test="approvalAttachment != null">approval_attachment = #{approvalAttachment},</if>
<if test="approvalTime != null">approval_time = #{approvalTime},</if>
<if test="isReview != null">is_review = #{isReview},</if>
<if test="isBeforeData != null">is_before_data = #{isBeforeData},</if>
<if test="sort != null">sort = #{sort},</if>
<if test="isDeleted != null">is_deleted = #{isDeleted},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<update id="updateApproval">
update bms_approval_info
set is_before_data = 1
where declaration_records_id = #{declarationRecordsId}
</update>
<update id="updateApprovalList">
<foreach collection="list" item="item" separator=";">
update bms_approval_info set is_before_data = 1 where declaration_records_id = #{item}
</foreach>
</update>
<delete id="deleteBmsApprovalInfoById" parameterType="Long">
delete
from bms_approval_info
where id = #{id}
</delete>
<delete id="deleteBmsApprovalInfoByIds" parameterType="String">
delete from bms_approval_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>