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.
138 lines
8.1 KiB
138 lines
8.1 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.system.mapper.SysSopMapper">
|
|
|
|
<resultMap type="SysSop" id="SysSopResult">
|
|
<result property="sopId" column="sop_id" />
|
|
<result property="sopCode" column="sop_code" />
|
|
<result property="sopName" column="sop_name" />
|
|
<result property="sopModel" column="sop_model" />
|
|
<result property="typeOfMachine" column="type_of_machine" />
|
|
<result property="sopUnit" column="sop_unit" />
|
|
<result property="drawingFile" column="drawing_file" />
|
|
<result property="workhourFile" column="workhour_file" />
|
|
<result property="sopFile" column="sop_file" />
|
|
<result property="sipFile" column="sip_file" />
|
|
<result property="sppFile" column="spp_file" />
|
|
<result property="bomFile" column="bom_file" />
|
|
<result property="customerFile" column="customer_file" />
|
|
<result property="otherFile" column="other_file" />
|
|
<result property="customerCode" column="customer_code" />
|
|
<result property="customerName" column="customer_name" />
|
|
<result property="dateOfRegistration" column="date_of_registration" />
|
|
<result property="sopRegistrant" column="sop_registrant" />
|
|
<result property="sopRemark" column="sop_remark" />
|
|
<result property="currentVersion" column="current_version" />
|
|
<result property="firstAddTime" column="first_add_time" />
|
|
<result property="updateInfoTime" column="update_info_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectSysSopVo">
|
|
select sop_id, sop_code, sop_name, sop_model, type_of_machine, sop_unit, drawing_file, workhour_file, sop_file, sip_file, spp_file, bom_file, customer_file, other_file, customer_code, customer_name, date_of_registration, sop_registrant, sop_remark, current_version, first_add_time, update_info_time from sys_sop
|
|
</sql>
|
|
|
|
<select id="selectSysSopList" parameterType="SysSop" resultMap="SysSopResult">
|
|
<include refid="selectSysSopVo"/>
|
|
<where>
|
|
<if test="sopCode != null and sopCode != ''"> and sop_code like concat('%', #{sopCode}, '%')</if>
|
|
<if test="sopName != null and sopName != ''"> and sop_name like concat('%', #{sopName}, '%')</if>
|
|
<if test="customerCode != null and customerCode != ''"> and customer_code like concat('%', #{customerCode}, '%')</if>
|
|
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
|
|
<if test="currentVersion != null and currentVersion != ''"> and current_version = #{currentVersion}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectSysSopById" parameterType="Long" resultMap="SysSopResult">
|
|
<include refid="selectSysSopVo"/>
|
|
where sop_id = #{sopId}
|
|
</select>
|
|
|
|
<insert id="insertSysSop" parameterType="SysSop" useGeneratedKeys="true" keyProperty="sopId">
|
|
insert into sys_sop
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="sopCode != null and sopCode != ''">sop_code,</if>
|
|
<if test="sopName != null and sopName != ''">sop_name,</if>
|
|
<if test="sopModel != null">sop_model,</if>
|
|
<if test="typeOfMachine != null">type_of_machine,</if>
|
|
<if test="sopUnit != null">sop_unit,</if>
|
|
<if test="drawingFile != null">drawing_file,</if>
|
|
<if test="workhourFile != null">workhour_file,</if>
|
|
<if test="sopFile != null">sop_file,</if>
|
|
<if test="sipFile != null">sip_file,</if>
|
|
<if test="sppFile != null">spp_file,</if>
|
|
<if test="bomFile != null">bom_file,</if>
|
|
<if test="customerFile != null">customer_file,</if>
|
|
<if test="otherFile != null">other_file,</if>
|
|
<if test="customerCode != null">customer_code,</if>
|
|
<if test="customerName != null">customer_name,</if>
|
|
<if test="dateOfRegistration != null">date_of_registration,</if>
|
|
<if test="sopRegistrant != null">sop_registrant,</if>
|
|
<if test="sopRemark != null">sop_remark,</if>
|
|
<if test="currentVersion != null">current_version,</if>
|
|
first_add_time,
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="sopCode != null and sopCode != ''">#{sopCode},</if>
|
|
<if test="sopName != null and sopName != ''">#{sopName},</if>
|
|
<if test="sopModel != null and sopModel != ''">#{sopModel},</if>
|
|
<if test="typeOfMachine != null and typeOfMachine != ''">#{typeOfMachine},</if>
|
|
<if test="sopUnit != null and sopUnit != ''">#{sopUnit},</if>
|
|
<if test="drawingFile != null and drawingFile != ''">#{drawingFile},</if>
|
|
<if test="workhourFile != null and workhourFile != ''">#{workhourFile},</if>
|
|
<if test="sopFile != null and sopFile != ''">#{sopFile},</if>
|
|
<if test="sipFile != null and sipFile != ''">#{sipFile},</if>
|
|
<if test="sppFile != null and sppFile != ''">#{sppFile},</if>
|
|
<if test="bomFile != null and bomFile != ''">#{bomFile},</if>
|
|
<if test="customerFile != null and customerFile != ''">#{customerFile},</if>
|
|
<if test="otherFile != null and otherFile != ''">#{otherFile},</if>
|
|
<if test="customerCode != null and customerCode != ''">#{customerCode},</if>
|
|
<if test="customerName != null and customerName != ''">#{customerName},</if>
|
|
<if test="dateOfRegistration != null and dateOfRegistration != ''">#{dateOfRegistration},</if>
|
|
<if test="sopRegistrant != null and sopRegistrant != ''">#{sopRegistrant},</if>
|
|
<if test="sopRemark != null and sopRemark != ''">#{sopRemark},</if>
|
|
<if test="currentVersion != null and currentVersion != ''">#{currentVersion},</if>
|
|
now(),
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSysSop" parameterType="SysSop">
|
|
update sys_sop
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="sopCode != null and sopCode != ''">sop_code = #{sopCode},</if>
|
|
<if test="sopName != null and sopName != ''">sop_name = #{sopName},</if>
|
|
<if test="sopModel != null">sop_model = #{sopModel},</if>
|
|
<if test="typeOfMachine != null">type_of_machine = #{typeOfMachine},</if>
|
|
<if test="sopUnit != null">sop_unit = #{sopUnit},</if>
|
|
<if test="drawingFile != null">drawing_file = #{drawingFile},</if>
|
|
<if test="workhourFile != null">workhour_file = #{workhourFile},</if>
|
|
<if test="sopFile != null">sop_file = #{sopFile},</if>
|
|
<if test="sipFile != null">sip_file = #{sipFile},</if>
|
|
<if test="sppFile != null">spp_file = #{sppFile},</if>
|
|
<if test="bomFile != null">bom_file = #{bomFile},</if>
|
|
<if test="customerFile != null">customer_file = #{customerFile},</if>
|
|
<if test="otherFile != null">other_file = #{otherFile},</if>
|
|
<if test="customerCode != null">customer_code = #{customerCode},</if>
|
|
<if test="customerName != null">customer_name = #{customerName},</if>
|
|
<if test="dateOfRegistration != null">date_of_registration = #{dateOfRegistration},</if>
|
|
<if test="sopRegistrant != null">sop_registrant = #{sopRegistrant},</if>
|
|
<if test="sopRemark != null">sop_remark = #{sopRemark},</if>
|
|
<if test="currentVersion != null">current_version = #{currentVersion},</if>
|
|
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
|
|
</trim>
|
|
where sop_id = #{sopId}
|
|
</update>
|
|
|
|
<delete id="deleteSysSopById" parameterType="Long">
|
|
delete from sys_sop where sop_id = #{sopId}
|
|
</delete>
|
|
|
|
<delete id="deleteSysSopByIds" parameterType="String">
|
|
delete from sys_sop where sop_id in
|
|
<foreach item="sopId" collection="array" open="(" separator="," close=")">
|
|
#{sopId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper>
|