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.
94 lines
5.0 KiB
94 lines
5.0 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.SysProcedureMapper">
|
||
|
|
||
|
<resultMap type="SysProcedure" id="SysProcedureResult">
|
||
|
<result property="procedureId" column="procedure_id" />
|
||
|
<result property="procedureCode" column="procedure_code" />
|
||
|
<result property="workshopName" column="workshop_name" />
|
||
|
<result property="procedureName" column="procedure_name" />
|
||
|
<result property="sequence" column="sequence" />
|
||
|
<result property="eachCost" column="each_cost" />
|
||
|
<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
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectSysProcedureList" parameterType="SysProcedure" resultMap="SysProcedureResult">
|
||
|
<include refid="selectSysProcedureVo"/>
|
||
|
<where>
|
||
|
<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="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}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertSysProcedure" parameterType="SysProcedure" useGeneratedKeys="true" keyProperty="procedureId">
|
||
|
insert into sys_procedure
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="procedureCode != null">procedure_code,</if>
|
||
|
<if test="workshopName != null and workshopName != ''">workshop_name,</if>
|
||
|
<if test="procedureName != null">procedure_name,</if>
|
||
|
<if test="sequence != null">sequence,</if>
|
||
|
<if test="eachCost != null">each_cost,</if>
|
||
|
<if test="procedureWorkhour != null">procedure_workhour,</if>
|
||
|
<if test="associatedItem != null">associated_item,</if>
|
||
|
<if test="procedureRemark != null">procedure_remark,</if>
|
||
|
first_add_time,
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="procedureCode != null">#{procedureCode},</if>
|
||
|
<if test="workshopName != null and workshopName != ''">#{workshopName},</if>
|
||
|
<if test="procedureName != null">#{procedureName},</if>
|
||
|
<if test="sequence != null">#{sequence},</if>
|
||
|
<if test="eachCost != null">#{eachCost},</if>
|
||
|
<if test="procedureWorkhour != null">#{procedureWorkhour},</if>
|
||
|
<if test="associatedItem != null">#{associatedItem},</if>
|
||
|
<if test="procedureRemark != null">#{procedureRemark},</if>
|
||
|
now()
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateSysProcedure" parameterType="SysProcedure">
|
||
|
update sys_procedure
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<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>
|
||
|
<if test="sequence != null">sequence = #{sequence},</if>
|
||
|
<if test="eachCost != null">each_cost = #{eachCost},</if>
|
||
|
<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),
|
||
|
</trim>
|
||
|
where procedure_id = #{procedureId}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteSysProcedureById" parameterType="Long">
|
||
|
delete from sys_procedure where procedure_id = #{procedureId}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteSysProcedureByIds" parameterType="String">
|
||
|
delete from sys_procedure where procedure_id in
|
||
|
<foreach item="procedureId" collection="array" open="(" separator="," close=")">
|
||
|
#{procedureId}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
</mapper>
|