|
|
@ -5,6 +5,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<mapper namespace="com.ruoyi.system.mapper.SysProcedureMapper"> |
|
|
|
|
|
|
|
<resultMap type="SysProcedure" id="SysProcedureResult"> |
|
|
|
<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="produceEquipModel" column="produce_equip_model" /> |
|
|
|
<result property="procedureId" column="procedure_id" /> |
|
|
|
<result property="procedureCode" column="procedure_code" /> |
|
|
|
<result property="workshopName" column="workshop_name" /> |
|
|
@ -14,13 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<result property="procedureWorkhour" column="procedure_workhour" /> |
|
|
|
<result property="associatedItem" column="associated_item" /> |
|
|
|
<result property="procedureRemark" column="procedure_remark" /> |
|
|
|
<result property="firstAddTime" column="first_add_time" /> |
|
|
|
<result property="updateInfoTime" column="update_info_time" /> |
|
|
|
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="selectSysProcedureVo"> |
|
|
|
select procedure_id, procedure_code, workshop_name, procedure_name, sequence, each_cost, procedure_workhour, associated_item, procedure_remark, first_add_time, update_info_time from sys_procedure |
|
|
|
select id,del_flag,create_by,create_time,update_by,update_time,remark,produce_equip_model,procedure_id, procedure_code, workshop_name, procedure_name, sequence, each_cost, procedure_workhour, associated_item, procedure_remark from sys_procedure |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="selectSysProcedureList" parameterType="SysProcedure" resultMap="SysProcedureResult"> |
|
|
@ -29,18 +35,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="procedureCode != null and procedureCode != ''"> and procedure_code = #{procedureCode}</if> |
|
|
|
<if test="workshopName != null and workshopName != ''"> and workshop_name like concat('%', #{workshopName}, '%')</if> |
|
|
|
<if test="procedureName != null and procedureName != ''"> and procedure_name like concat('%', #{procedureName}, '%')</if> |
|
|
|
<if test="produceEquipModel != null and produceEquipModel != ''"> and produce_equip_model like concat('%', #{produceEquipModel}, '%')</if> |
|
|
|
<if test="associatedItem != null and associatedItem != ''"> and associated_item = #{associatedItem}</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectSysProcedureById" parameterType="Long" resultMap="SysProcedureResult"> |
|
|
|
<include refid="selectSysProcedureVo"/> |
|
|
|
where procedure_id = #{procedureId} |
|
|
|
where id = #{id} |
|
|
|
</select> |
|
|
|
|
|
|
|
<insert id="insertSysProcedure" parameterType="SysProcedure" useGeneratedKeys="true" keyProperty="procedureId"> |
|
|
|
insert into sys_procedure |
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
|
|
<if test="produceEquipModel != null">produce_equip_model,</if> |
|
|
|
<if test="procedureId != null">procedure_id,</if> |
|
|
|
<if test="procedureCode != null">procedure_code,</if> |
|
|
|
<if test="workshopName != null and workshopName != ''">workshop_name,</if> |
|
|
|
<if test="procedureName != null">procedure_name,</if> |
|
|
@ -49,9 +58,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="procedureWorkhour != null">procedure_workhour,</if> |
|
|
|
<if test="associatedItem != null">associated_item,</if> |
|
|
|
<if test="procedureRemark != null">procedure_remark,</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="produceEquipModel != null">#{produceEquipModel},</if> |
|
|
|
<if test="procedureId != null">#{procedureId},</if> |
|
|
|
<if test="procedureCode != null">#{procedureCode},</if> |
|
|
|
<if test="workshopName != null and workshopName != ''">#{workshopName},</if> |
|
|
|
<if test="procedureName != null">#{procedureName},</if> |
|
|
@ -60,13 +76,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="procedureWorkhour != null">#{procedureWorkhour},</if> |
|
|
|
<if test="associatedItem != null">#{associatedItem},</if> |
|
|
|
<if test="procedureRemark != null">#{procedureRemark},</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="updateSysProcedure" parameterType="SysProcedure"> |
|
|
|
update sys_procedure |
|
|
|
<trim prefix="SET" suffixOverrides=","> |
|
|
|
<if test="produceEquipModel != null">produce_equip_model = #{produceEquipModel},</if> |
|
|
|
<if test="procedureId != null">procedure_id = #{procedureId},</if> |
|
|
|
<if test="procedureCode != null">procedure_code = #{procedureCode},</if> |
|
|
|
<if test="workshopName != null and workshopName != ''">workshop_name = #{workshopName},</if> |
|
|
|
<if test="procedureName != null">procedure_name = #{procedureName},</if> |
|
|
@ -75,19 +98,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="procedureWorkhour != null">procedure_workhour = #{procedureWorkhour},</if> |
|
|
|
<if test="associatedItem != null">associated_item = #{associatedItem},</if> |
|
|
|
<if test="procedureRemark != null">procedure_remark = #{procedureRemark},</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 procedure_id = #{procedureId} |
|
|
|
where id = #{id} |
|
|
|
</update> |
|
|
|
|
|
|
|
<delete id="deleteSysProcedureById" parameterType="Long"> |
|
|
|
delete from sys_procedure where procedure_id = #{procedureId} |
|
|
|
delete from sys_procedure where id = #{id} |
|
|
|
</delete> |
|
|
|
|
|
|
|
<delete id="deleteSysProcedureByIds" parameterType="String"> |
|
|
|
delete from sys_procedure where procedure_id in |
|
|
|
<foreach item="procedureId" collection="array" open="(" separator="," close=")"> |
|
|
|
#{procedureId} |
|
|
|
delete from sys_procedure where id in |
|
|
|
<foreach item="item" collection="array" open="(" separator="," close=")"> |
|
|
|
#{item} |
|
|
|
</foreach> |
|
|
|
</delete> |
|
|
|
|
|
|
|