Files
Mediation-Backend/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/template/TemplateManageMapper.xml
T
2024-01-05 18:14:54 +08:00

85 lines
4.1 KiB
XML

<?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.wisdomarbitrate.mapper.template.TemplateManageMapper">
<resultMap type="TemplateManage" id="TemplateManageResult">
<id property="id" column="id" />
<result property="identifyId" column="identify_id" />
<result property="temName" column="tem_name" />
<result property="temType" column="tem_type" />
<result property="temFormat" column="tem_format" />
<result property="temOrigPath" column="tem_orig_path" />
<result property="temRevisPath" column="tem_revis_path" />
<result property="delFlag" column="del_flag" />
<result property="fileName" column="file_name" />
</resultMap>
<insert id="insertTemplateManage" parameterType="TemplateManage" useGeneratedKeys="true" keyProperty="id">
insert into ms_template_manage(
<if test="identifyId != null">identify_id,</if>
<if test="temName != null and temName != ''">tem_name,</if>
<if test="temType != null">tem_type,</if>
<if test="temFormat != null and temFormat != '' ">tem_format,</if>
<if test="temOrigPath != null and temOrigPath != '' ">tem_orig_path,</if>
<if test="temRevisPath != null and temRevisPath != '' ">tem_revis_path,</if>
<if test="createBy != null and createBy != '' ">create_by,</if>
<if test="fileName != null and fileName != '' ">file_name,</if>
del_flag,create_time
)values(
<if test="identifyId != null">#{identifyId},</if>
<if test="temName != null and temName != ''">#{temName},</if>
<if test="temType != null">#{temType},</if>
<if test="temFormat != null and temFormat != ''">#{temFormat},</if>
<if test="temOrigPath != null and temOrigPath != ''">#{temOrigPath},</if>
<if test="temRevisPath != null and temRevisPath != ''">#{temRevisPath},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="fileName != null and fileName != ''">#{fileName},</if>
0,sysdate()
)
</insert>
<update id="updateTemplateManage" parameterType="TemplateManage">
update ms_template_manage
<set>
<if test="identifyId != null">identify_id = #{identifyId},</if>
<if test="temName != null and temName != ''">tem_name = #{temName},</if>
<if test="temType != null">tem_type = #{temType},</if>
<if test="temFormat != null and temFormat != '' ">tem_format = #{temFormat},</if>
<if test="temOrigPath != null and temOrigPath != ''">tem_orig_path = #{temOrigPath},</if>
<if test="delFlag != null ">del_flag = #{delFlag},</if>
<if test="temRevisPath != null and temRevisPath != '' ">tem_revis_path = #{temRevisPath},</if>
<if test="updateBy != null and updateBy != '' ">update_by = #{updateBy},</if>
<if test="fileName != null and fileName != '' ">file_name = #{fileName},</if>
update_time = sysdate()
</set>
<where>
<if test="id != null">
AND id = #{id}
</if>
</where>
</update>
<select id="selectTemplateList" parameterType="TemplateManage" resultMap="TemplateManageResult">
SELECT id, identify_id ,tem_name , tem_type,tem_format,tem_orig_path,tem_revis_path ,file_name
FROM ms_template_manage
<where>
<if test="id != null">
AND id = #{id}
</if>
<if test="identifyId != null">
AND identify_id = #{identifyId}
</if>
<if test="temName != null and temName != ''">
AND tem_name = #{temName}
</if>
<if test="temType != null ">
AND tem_type = #{temType}
</if>
AND del_flag =0
</where>
ORDER BY create_time DESC
</select>
</mapper>