Bonus-Cloud-Material-Mall/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/task/TmTaskMapper.xml

111 lines
4.3 KiB
XML
Raw Normal View History

2024-12-25 13:26:35 +08:00
<?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.bonus.material.task.mapper.TmTaskMapper">
<resultMap id="BaseResultMap" type="com.bonus.material.task.domain.TmTask">
<id column="task_id" jdbcType="BIGINT" property="taskId" />
<result column="task_type" jdbcType="INTEGER" property="taskType" />
<result column="task_status" jdbcType="INTEGER" property="taskStatus" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
2024-12-25 14:33:29 +08:00
<result column="buyer_company_id" jdbcType="INTEGER" property="buyerCompanyId" />
<result column="seller_company_id" jdbcType="INTEGER" property="sellerCompanyId" />
2024-12-25 13:26:35 +08:00
</resultMap>
<resultMap id="ResultMap" type="com.bonus.material.task.domain.TmTask">
<id column="task_id" jdbcType="BIGINT" property="taskId" />
<result column="task_type" jdbcType="INTEGER" property="taskType" />
<result column="task_status" jdbcType="INTEGER" property="taskStatus" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
2024-12-25 14:33:29 +08:00
<result column="buyer_company_id" jdbcType="INTEGER" property="buyerCompanyId" />
<result column="seller_company_id" jdbcType="INTEGER" property="sellerCompanyId" />
2024-12-25 13:26:35 +08:00
</resultMap>
<sql id="Base_Column_List">
task_id, task_type, task_status, code, create_by, create_time, update_by, update_time,
2024-12-25 14:33:29 +08:00
remark, buyer_company_id, seller_company_id
2024-12-25 13:26:35 +08:00
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tm_task
where task_id = #{taskId,jdbcType=BIGINT}
</select>
<update id="deleteTaskByPrimaryKey" >
update tm_task set `status` = '0',update_time = NOW()
where task_id = #{taskId}
</update>
<insert id="insertSelective" keyColumn="task_id" keyProperty="id" parameterType="com.bonus.material.task.domain.TmTask" useGeneratedKeys="true">
insert into tm_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskType != null">
task_type,
</if>
<if test="taskStatus != null">
task_status,
</if>
<if test="code != null and code != ''">
code,
</if>
<if test="createBy != null and createBy != ''">
create_by,
</if>
create_time,
<if test="updateBy != null and updateBy != ''">
update_by,
</if>
update_time,
<if test="remark != null and remark != ''">
remark,
</if>
2024-12-25 14:33:29 +08:00
<if test="buyerCompanyId != null">
buyer_company_id,
</if>
<if test="sellerCompanyId != null">
seller_company_id,
2024-12-25 13:26:35 +08:00
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskType != null">
#{taskType,jdbcType=INTEGER},
</if>
<if test="taskStatus != null">
#{taskStatus,jdbcType=INTEGER},
</if>
<if test="code != null and code != ''">
#{code,jdbcType=VARCHAR},
</if>
<if test="createBy != null and createBy != ''">
#{createBy,jdbcType=VARCHAR},
</if>
now(),
<if test="updateBy != null and updateBy != ''">
#{updateBy,jdbcType=VARCHAR},
</if>
now(),
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
2024-12-25 14:33:29 +08:00
<if test="buyerCompanyId != null">
#{buyerCompanyId,jdbcType=INTEGER},
</if>
<if test="sellerCompanyId != null">
#{sellerCompanyId,jdbcType=INTEGER},
2024-12-25 13:26:35 +08:00
</if>
</trim>
</insert>
</mapper>