Files
cashier-client/src/main/resources/mapper/SysUsersJobsMapper.xml
韩鹏辉 b96a251fd8 提交
2024-03-21 10:17:54 +08:00

36 lines
1.5 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.chaozhanggui.system.cashierservice.dao.SysUsersJobsMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.SysUsersJobsKey">
<id column="user_id" jdbcType="BIGINT" property="userId" />
<id column="job_id" jdbcType="BIGINT" property="jobId" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.SysUsersJobsKey">
delete from sys_users_jobs
where user_id = #{userId,jdbcType=BIGINT}
and job_id = #{jobId,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.SysUsersJobsKey">
insert into sys_users_jobs (user_id, job_id)
values (#{userId,jdbcType=BIGINT}, #{jobId,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.SysUsersJobsKey">
insert into sys_users_jobs
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="jobId != null">
job_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="jobId != null">
#{jobId,jdbcType=BIGINT},
</if>
</trim>
</insert>
</mapper>