万材erp项目
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.

78 lines
3.7 KiB

2 years ago
<?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.system.mapper.SysDrawingMapper">
<resultMap type="SysDrawing" id="SysDrawingResult">
<result property="drawingId" column="drawing_id" />
<result property="drawingCode" column="drawing_code" />
<result property="drawingMaterialCategory" column="drawing_material_category" />
<result property="drawingRemarks" column="drawing_remarks" />
<result property="drawingUpload" column="drawing_upload" />
<result property="uploadPerson" column="upload_person" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
</resultMap>
<sql id="selectSysDrawingVo">
select drawing_id, drawing_code, drawing_material_category, drawing_remarks, drawing_upload, upload_person, first_add_time, update_info_time from sys_drawing
</sql>
<select id="selectSysDrawingList" parameterType="SysDrawing" resultMap="SysDrawingResult">
<include refid="selectSysDrawingVo"/>
<where>
<if test="drawingCode != null and drawingCode != ''"> and drawing_code = #{drawingCode}</if>
</where>
</select>
<select id="selectSysDrawingById" parameterType="Long" resultMap="SysDrawingResult">
<include refid="selectSysDrawingVo"/>
where drawing_id = #{drawingId}
</select>
<insert id="insertSysDrawing" parameterType="SysDrawing" useGeneratedKeys="true" keyProperty="drawingId">
insert into sys_drawing
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="drawingCode != null">drawing_code,</if>
<if test="drawingMaterialCategory != null">drawing_material_category,</if>
<if test="drawingRemarks != null">drawing_remarks,</if>
<if test="drawingUpload != null">drawing_upload,</if>
<if test="uploadPerson != null">upload_person,</if>
first_add_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="drawingCode != null">#{drawingCode},</if>
<if test="drawingMaterialCategory != null">#{drawingMaterialCategory},</if>
<if test="drawingRemarks != null">#{drawingRemarks},</if>
<if test="drawingUpload != null">#{drawingUpload},</if>
<if test="uploadPerson != null">#{uploadPerson},</if>
now(),
</trim>
</insert>
<update id="updateSysDrawing" parameterType="SysDrawing">
update sys_drawing
<trim prefix="SET" suffixOverrides=",">
<if test="drawingCode != null">drawing_code = #{drawingCode},</if>
<if test="drawingMaterialCategory != null">drawing_material_category = #{drawingMaterialCategory},</if>
<if test="drawingRemarks != null">drawing_remarks = #{drawingRemarks},</if>
<if test="drawingUpload != null">drawing_upload = #{drawingUpload},</if>
<if test="uploadPerson != null">upload_person = #{uploadPerson},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
</trim>
where drawing_id = #{drawingId}
</update>
<delete id="deleteSysDrawingById" parameterType="Long">
delete from sys_drawing where drawing_id = #{drawingId}
</delete>
<delete id="deleteSysDrawingByIds" parameterType="String">
delete from sys_drawing where drawing_id in
<foreach item="drawingId" collection="array" open="(" separator="," close=")">
#{drawingId}
</foreach>
</delete>
</mapper>