47 lines
1.8 KiB
XML
47 lines
1.8 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.bycrm.mapper.SystemConfigMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="com.bycrm.entity.SystemConfig">
|
|
<id column="id" property="id"/>
|
|
<result column="config_key" property="configKey"/>
|
|
<result column="config_value" property="configValue"/>
|
|
<result column="config_label" property="configLabel"/>
|
|
<result column="config_type" property="configType"/>
|
|
<result column="description" property="description"/>
|
|
<result column="is_editable" property="isEditable"/>
|
|
<result column="created_at" property="createdAt"/>
|
|
<result column="updated_at" property="updatedAt"/>
|
|
</resultMap>
|
|
|
|
<select id="selectAll" resultMap="BaseResultMap">
|
|
SELECT * FROM crm_system_config ORDER BY id
|
|
</select>
|
|
|
|
<select id="selectByKey" resultMap="BaseResultMap">
|
|
SELECT * FROM crm_system_config WHERE config_key = #{configKey}
|
|
</select>
|
|
|
|
<select id="selectValueByKey" resultType="java.lang.String">
|
|
SELECT config_value FROM crm_system_config WHERE config_key = #{configKey}
|
|
</select>
|
|
|
|
<update id="update" parameterType="com.bycrm.entity.SystemConfig">
|
|
UPDATE crm_system_config
|
|
SET config_value = #{configValue},
|
|
updated_at = NOW()
|
|
WHERE config_key = #{configKey}
|
|
</update>
|
|
|
|
<update id="batchUpdate">
|
|
<foreach collection="configs" item="config" separator=";">
|
|
UPDATE crm_system_config
|
|
SET config_value = #{config.configValue},
|
|
updated_at = NOW()
|
|
WHERE config_key = #{config.configKey}
|
|
</foreach>
|
|
</update>
|
|
|
|
</mapper>
|