2025-07-04 16:37:48 +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.equipment.mapper.DeptEquipmentConfigMapper">
|
|
|
|
|
<delete id="deleteByDeptIdAndTypeId">
|
|
|
|
|
DELETE FROM ma_dept_config WHERE dept_id = #{deptId} AND type_id = #{typeId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="selectConfig" resultType="com.bonus.material.equipment.domain.DeptEquipmentConfig">
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectConfigByDept" resultType="com.bonus.material.equipment.domain.DeptEquipmentConfig">
|
|
|
|
|
SELECT * FROM dept_equipment_config WHERE dept_id = #{deptId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertOrUpdateBatch" parameterType="com.bonus.material.equipment.domain.DeptEquipmentConfig">
|
|
|
|
|
INSERT INTO ma_dept_config (
|
|
|
|
|
dept_id,
|
|
|
|
|
type_id,
|
|
|
|
|
config_type,
|
|
|
|
|
config_value,
|
|
|
|
|
config_rate,
|
|
|
|
|
config_description,
|
|
|
|
|
remark
|
|
|
|
|
)
|
|
|
|
|
VALUES
|
|
|
|
|
<foreach collection="configs" item="item" separator=",">
|
|
|
|
|
(
|
|
|
|
|
#{deptId},
|
2025-07-09 12:32:07 +08:00
|
|
|
#{typeId},
|
2025-07-04 16:37:48 +08:00
|
|
|
#{item.configurationType},
|
|
|
|
|
#{item.basicConfig},
|
|
|
|
|
#{item.configurationRate},
|
|
|
|
|
#{item.configurationDescription},
|
|
|
|
|
#{remark}
|
|
|
|
|
)
|
|
|
|
|
</foreach>
|
|
|
|
|
ON DUPLICATE KEY UPDATE
|
|
|
|
|
config_value = VALUES(config_value),
|
|
|
|
|
config_rate = VALUES(config_rate),
|
|
|
|
|
config_description = VALUES(config_description),
|
|
|
|
|
remark = VALUES(remark),
|
|
|
|
|
update_time = CURRENT_TIMESTAMP
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
</mapper>
|