|
|
@ -5,7 +5,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<mapper namespace="com.ruoyi.system.mapper.SysSopMapper"> |
|
|
|
|
|
|
|
<resultMap type="SysSop" id="SysSopResult"> |
|
|
|
<result property="id" column="id" /> |
|
|
|
<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" /> |
|
|
|
<result property="delFlag" column="del_flag" /> |
|
|
|
<result property="sopId" column="sop_id" /> |
|
|
|
<result property="sopNum" column="sop_num" /> |
|
|
|
<result property="productName" column="product_name" /> |
|
|
|
<result property="equipModel" column="equip_model" /> |
|
|
|
<result property="describe" column="describe" /> |
|
|
|
<result property="sopCode" column="sop_code" /> |
|
|
|
<result property="sopName" column="sop_name" /> |
|
|
|
<result property="sopModel" column="sop_model" /> |
|
|
@ -25,17 +36,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<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 |
|
|
|
select id,del_flag,create_by,create_time,update_by,update_time,remark,sop_id,sop_num,product_name,equip_model,`describe`,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 from sys_sop |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="selectSysSopList" parameterType="SysSop" resultMap="SysSopResult"> |
|
|
|
<include refid="selectSysSopVo"/> |
|
|
|
<where> |
|
|
|
<if test="sopId != null and sopId != ''"> and sop_id = #{sopId}</if> |
|
|
|
<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> |
|
|
@ -46,12 +56,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
|
|
|
|
<select id="selectSysSopById" parameterType="Long" resultMap="SysSopResult"> |
|
|
|
<include refid="selectSysSopVo"/> |
|
|
|
where sop_id = #{sopId} |
|
|
|
where id = #{id} |
|
|
|
</select> |
|
|
|
|
|
|
|
<insert id="insertSysSop" parameterType="SysSop" useGeneratedKeys="true" keyProperty="sopId"> |
|
|
|
insert into sys_sop |
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
|
<if test="sopId != null and sopId != ''">sop_id,</if> |
|
|
|
<if test="sopNum != null and sopNum != ''">sop_num,</if> |
|
|
|
<if test="productName != null and productName != ''">product_name,</if> |
|
|
|
<if test="equipModel != null and equipModel != ''">equip_model,</if> |
|
|
|
<if test="describe != null and describe != ''">`describe`,</if> |
|
|
|
<if test="sopCode != null and sopCode != ''">sop_code,</if> |
|
|
|
<if test="sopName != null and sopName != ''">sop_name,</if> |
|
|
|
<if test="sopModel != null and sopModel != ''">sop_model,</if> |
|
|
@ -71,9 +86,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="sopRegistrant != null and sopRegistrant != ''">sop_registrant,</if> |
|
|
|
<if test="sopRemark != null and sopRemark != ''">sop_remark,</if> |
|
|
|
<if test="currentVersion != null and currentVersion != ''">current_version,</if> |
|
|
|
first_add_time, |
|
|
|
<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> |
|
|
|
<if test="delFlag != null">del_flag,</if> |
|
|
|
</trim> |
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
|
<if test="sopId != null and sopId != ''">#{sopId},</if> |
|
|
|
<if test="sopNum != null and sopNum != ''">#{sopNum},</if> |
|
|
|
<if test="productName != null and productName != ''">#{productName},</if> |
|
|
|
<if test="equipModel != null and equipModel != ''">#{equipModel},</if> |
|
|
|
<if test="describe != null and describe != ''">#{describe},</if> |
|
|
|
<if test="sopCode != null and sopCode != ''">#{sopCode},</if> |
|
|
|
<if test="sopName != null and sopName != ''">#{sopName},</if> |
|
|
|
<if test="sopModel != null and sopModel != ''">#{sopModel},</if> |
|
|
@ -93,13 +118,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<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(), |
|
|
|
<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> |
|
|
|
<if test="delFlag != null">#{delFlag},</if> |
|
|
|
</trim> |
|
|
|
</insert> |
|
|
|
|
|
|
|
<update id="updateSysSop" parameterType="SysSop"> |
|
|
|
update sys_sop |
|
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
|
<if test="sopNum != null and sopNum != ''">sop_num = #{sopNum},</if> |
|
|
|
<if test="productName != null and productName != ''">product_name = #{productName},</if> |
|
|
|
<if test="equipModel != null and equipModel != ''">equip_model = #{equipModel},</if> |
|
|
|
<if test="describe != null and describe != ''">`describe` = #{describe},</if> |
|
|
|
<if test="sopCode != null and sopCode != ''">sop_code = #{sopCode},</if> |
|
|
|
<if test="sopName != null and sopName != ''">sop_name = #{sopName},</if> |
|
|
|
<if test="sopModel != null and sopModel != ''">sop_model = #{sopModel},</if> |
|
|
@ -119,19 +153,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="sopRegistrant != null and sopRegistrant != ''">sop_registrant = #{sopRegistrant},</if> |
|
|
|
<if test="sopRemark != null and sopRemark != ''">sop_remark = #{sopRemark},</if> |
|
|
|
<if test="currentVersion != null and currentVersion != ''">current_version = #{currentVersion},</if> |
|
|
|
update_info_time = CONCAT_WS(',',NOW(),update_info_time), |
|
|
|
<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> |
|
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if> |
|
|
|
</trim> |
|
|
|
where sop_id = #{sopId} |
|
|
|
where id = #{sopId} |
|
|
|
</update> |
|
|
|
|
|
|
|
<delete id="deleteSysSopById" parameterType="Long"> |
|
|
|
delete from sys_sop where sop_id = #{sopId} |
|
|
|
delete from sys_sop where id = #{id} |
|
|
|
</delete> |
|
|
|
|
|
|
|
<delete id="deleteSysSopByIds" parameterType="String"> |
|
|
|
delete from sys_sop where sop_id in |
|
|
|
<foreach item="sopId" collection="array" open="(" separator="," close=")"> |
|
|
|
#{sopId} |
|
|
|
delete from sys_sop where id in |
|
|
|
<foreach item="item" collection="array" open="(" separator="," close=")"> |
|
|
|
#{item} |
|
|
|
</foreach> |
|
|
|
</delete> |
|
|
|
|
|
|
|