mapper.SysTaskLogMapper.xml Maven / Gradle / Ivy
<?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="system.mapper.SysTaskLogMapper"> <!-- @mgp-generator base/*Mapper由系统生成,不要修改,重新生成将被覆盖 本同名文件用于撰写自已的SQL,重新生成不会覆盖 两个文件在运行时将会自动合并 参考: https://www.xiaobo.li/project/projects/jishi-mgp/wiki --> <select id="list" parameterType="system.entity.SysTaskLog" resultType="system.entity.SysTaskLog"> SELECT <include refid="All_Column_List" /> FROM sys_task_log <where> <if test="id != null and id != '' "> AND id = #{id,jdbcType=VARCHAR} </if> <if test="taskId != null "> AND task_id = #{taskId,jdbcType=BIGINT} </if> <if test="name != null and name != '' "> AND name = #{name,jdbcType=VARCHAR} </if> <if test="runStatus != null "> AND run_status = #{runStatus,jdbcType=VARCHAR} </if> <if test="runHostname != null and runHostname != '' "> AND run_hostname = #{runHostname,jdbcType=VARCHAR} </if> </where> ORDER BY create_time DESC </select> <!-- 覆盖tk的insertSelective默认实现 --> <insert id="insertSelective" keyProperty="id" parameterType="system.entity.SysTaskLog" useGeneratedKeys="true"> INSERT INTO sys_task_log ( <trim suffixOverrides=","> <if test="id != null">id,</if> <if test="taskId != null">task_id,</if> <if test="name != null">name,</if> <if test="createTime != null">create_time,</if> <if test="actuator != null">actuator,</if> <if test="schedule != null">schedule,</if> <if test="param != null">param,</if> <if test="runStatus != null">run_status,</if> <if test="runHostname != null">run_hostname,</if> <if test="runEnvName != null">run_env_name,</if> <if test="runRemarks != null">run_remarks,</if> <if test="runTimeStart != null">run_time_start,</if> <if test="runTimeEnd != null">run_time_end,</if> <if test="logPath != null">log_path,</if> </trim> ) VALUES ( <trim suffixOverrides=","> <if test="id != null">#{id,jdbcType=VARCHAR},</if> <if test="taskId != null">#{taskId,jdbcType=BIGINT},</if> <if test="name != null">#{name,jdbcType=VARCHAR},</if> <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> <if test="actuator != null">#{actuator,jdbcType=VARCHAR},</if> <if test="schedule != null">#{schedule,jdbcType=VARCHAR},</if> <if test="param != null">#{param,jdbcType=VARCHAR},</if> <if test="runStatus != null">#{runStatus,jdbcType=VARCHAR},</if> <if test="runHostname != null">#{runHostname,jdbcType=VARCHAR},</if> <if test="runEnvName != null">#{runEnvName,jdbcType=VARCHAR},</if> <if test="runRemarks != null">#{runRemarks,jdbcType=VARCHAR},</if> <if test="runTimeStart != null">#{runTimeStart,jdbcType=TIMESTAMP},</if> <if test="runTimeEnd != null">#{runTimeEnd,jdbcType=TIMESTAMP},</if> <if test="logPath != null">#{logPath,jdbcType=VARCHAR},</if> </trim> ) </insert> <!-- 主体更新方法: 1. 注释不允许修改的字段 2. 表结构调整后需要手动添加或删除 --> <update id="updateBody" parameterType="system.entity.SysTaskLog"> UPDATE sys_task_log <set> <!-- id = #{id,jdbcType=VARCHAR}, --> task_id = #{taskId,jdbcType=BIGINT}, name = #{name,jdbcType=VARCHAR}, <!-- create_time = #{createTime,jdbcType=TIMESTAMP},--> actuator = #{actuator,jdbcType=VARCHAR}, schedule = #{schedule,jdbcType=VARCHAR}, param = #{param,jdbcType=VARCHAR}, run_status = #{runStatus,jdbcType=VARCHAR}, run_hostname = #{runHostname,jdbcType=VARCHAR}, run_env_name = #{runEnvName,jdbcType=VARCHAR}, run_remarks = #{runRemarks,jdbcType=VARCHAR}, run_time_start = #{runTimeStart,jdbcType=TIMESTAMP}, run_time_end = #{runTimeEnd,jdbcType=TIMESTAMP}, log_path = #{logPath,jdbcType=VARCHAR}, </set> <where> AND id = #{id,jdbcType=VARCHAR} </where> </update> </mapper>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy