Files
usdt/luqj-ec/src/main/resources/mapper/ec/EcTaskCommandMapper.xml
T
2026-03-03 09:39:33 +08:00

69 lines
3.0 KiB
XML

<?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.luqj.ec.mapper.EcTaskCommandMapper">
<resultMap type="EcTaskCommand" id="EcTaskCommandResult">
<result property="id" column="id" />
<result property="taskId" column="task_id" />
<result property="stepOrder" column="step_order" />
<result property="commandType" column="command_type" />
<result property="commandContent" column="command_content" />
</resultMap>
<sql id="selectEcTaskCommandVo">
select id, task_id, step_order, command_type, command_content from ec_task_command
</sql>
<select id="selectEcTaskCommandList" parameterType="EcTaskCommand" resultMap="EcTaskCommandResult">
<include refid="selectEcTaskCommandVo"/>
<where>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="commandType != null and commandType != ''"> and command_type = #{commandType}</if>
</where>
</select>
<select id="selectEcTaskCommandById" parameterType="Long" resultMap="EcTaskCommandResult">
<include refid="selectEcTaskCommandVo"/>
where id = #{id}
</select>
<insert id="insertEcTaskCommand" parameterType="EcTaskCommand" useGeneratedKeys="true" keyProperty="id">
insert into ec_task_command
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskId != null">task_id,</if>
<if test="stepOrder != null">step_order,</if>
<if test="commandType != null">command_type,</if>
<if test="commandContent != null">command_content,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskId != null">#{taskId},</if>
<if test="stepOrder != null">#{stepOrder},</if>
<if test="commandType != null">#{commandType},</if>
<if test="commandContent != null">#{commandContent},</if>
</trim>
</insert>
<update id="updateEcTaskCommand" parameterType="EcTaskCommand">
update ec_task_command
<trim prefix="SET" suffixOverrides=",">
<if test="taskId != null">task_id = #{taskId},</if>
<if test="stepOrder != null">step_order = #{stepOrder},</if>
<if test="commandType != null">command_type = #{commandType},</if>
<if test="commandContent != null">command_content = #{commandContent},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEcTaskCommandById" parameterType="Long">
delete from ec_task_command where id = #{id}
</delete>
<delete id="deleteEcTaskCommandByIds" parameterType="String">
delete from ec_task_command where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>