2025-06-19 17:02:07 +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">
|
2025-06-30 09:09:51 +08:00
|
|
|
<mapper namespace="com.bonus.canteen.core.ims.mapper.ImsUnitMapper">
|
|
|
|
|
<resultMap type="com.bonus.canteen.core.ims.domain.ImsUnit" id="ImsUnitResult">
|
2025-06-19 17:02:07 +08:00
|
|
|
<result property="unitId" column="unit_id" />
|
|
|
|
|
<result property="unitName" column="unit_name" />
|
|
|
|
|
<result property="rate" column="rate" />
|
|
|
|
|
<result property="weighType" column="weigh_type" />
|
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectImsUnitVo">
|
|
|
|
|
select unit_id, unit_name, rate, weigh_type, create_by, create_time, update_by, update_time from ims_unit
|
|
|
|
|
</sql>
|
|
|
|
|
|
2025-06-30 09:09:51 +08:00
|
|
|
<select id="selectImsUnitList" parameterType="com.bonus.canteen.core.ims.domain.ImsUnit" resultMap="ImsUnitResult">
|
2025-06-19 17:02:07 +08:00
|
|
|
<include refid="selectImsUnitVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
|
|
|
|
|
<if test="rate != null "> and rate = #{rate}</if>
|
|
|
|
|
<if test="weighType != null "> and weigh_type = #{weighType}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectImsUnitByUnitId" parameterType="Long" resultMap="ImsUnitResult">
|
|
|
|
|
<include refid="selectImsUnitVo"/>
|
|
|
|
|
where unit_id = #{unitId}
|
|
|
|
|
</select>
|
2025-07-01 16:27:45 +08:00
|
|
|
|
2025-07-16 10:36:52 +08:00
|
|
|
<select id="selectImsUnitByUnitName" parameterType="Long" resultMap="ImsUnitResult">
|
|
|
|
|
<include refid="selectImsUnitVo"/>
|
|
|
|
|
where unit_name = #{unitName}
|
|
|
|
|
</select>
|
|
|
|
|
|
2025-07-01 16:27:45 +08:00
|
|
|
<select id="selectImsUnitByUnitIds" resultMap="ImsUnitResult">
|
|
|
|
|
<include refid="selectImsUnitVo"/>
|
|
|
|
|
where unit_id in
|
|
|
|
|
<foreach item="unitId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{unitId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</select>
|
2025-06-19 17:02:07 +08:00
|
|
|
|
2025-06-30 09:09:51 +08:00
|
|
|
<insert id="insertImsUnit" parameterType="com.bonus.canteen.core.ims.domain.ImsUnit" useGeneratedKeys="true" keyProperty="unitId">
|
2025-06-19 17:02:07 +08:00
|
|
|
insert into ims_unit
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="unitName != null and unitName != ''">unit_name,</if>
|
|
|
|
|
<if test="rate != null">rate,</if>
|
|
|
|
|
<if test="weighType != null">weigh_type,</if>
|
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="unitName != null and unitName != ''">#{unitName},</if>
|
|
|
|
|
<if test="rate != null">#{rate},</if>
|
|
|
|
|
<if test="weighType != null">#{weighType},</if>
|
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
2025-06-30 09:09:51 +08:00
|
|
|
<update id="updateImsUnit" parameterType="com.bonus.canteen.core.ims.domain.ImsUnit">
|
2025-06-19 17:02:07 +08:00
|
|
|
update ims_unit
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
|
|
|
|
|
<if test="rate != null">rate = #{rate},</if>
|
|
|
|
|
<if test="weighType != null">weigh_type = #{weighType},</if>
|
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where unit_id = #{unitId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteImsUnitByUnitId" parameterType="Long">
|
|
|
|
|
delete from ims_unit where unit_id = #{unitId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteImsUnitByUnitIds" parameterType="String">
|
|
|
|
|
delete from ims_unit where unit_id in
|
|
|
|
|
<foreach item="unitId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{unitId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|