refactor mapper xml
This commit is contained in:
@@ -1,4 +1,14 @@
|
||||
ALTER TABLE `gao_store`
|
||||
ADD COLUMN `auto_closed_day` BOOLEAN NOT NULL DEFAULT FALSE COMMENT 'true 为启用自动计算休息日' AFTER `remark`;
|
||||
ALTER TABLE `gao_store_business_day`
|
||||
RENAME COLUMN `open_status` TO `status`;
|
||||
DROP KEY `uk_gao_store_business_day_active_no`,
|
||||
DROP KEY `idx_gao_store_business_day_open_no`,
|
||||
DROP COLUMN `active_business_day_no`;
|
||||
ALTER TABLE `gao_store_business_day`
|
||||
CHANGE COLUMN `open_status` `status` VARCHAR(32) NOT NULL COMMENT '营业状态';
|
||||
ALTER TABLE `gao_store_business_day`
|
||||
ADD COLUMN `active_business_day_no` BIGINT GENERATED ALWAYS AS (
|
||||
CASE WHEN `deleted_at` IS NULL AND `status` = 'OPEN' THEN `business_day_no` ELSE NULL END
|
||||
) STORED COMMENT '未删除营业日序号' INVISIBLE AFTER `business_day_no`,
|
||||
ADD UNIQUE KEY `uk_gao_store_business_day_active_no` (`store_id`, `active_business_day_no`),
|
||||
ADD KEY `idx_gao_store_business_day_status_no` (`store_id`, `status`, `business_day_no`);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?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.imyeyu.api.modules.common.mapper.TagMapper">
|
||||
<select id="selectByIdList" resultType="com.imyeyu.api.modules.common.entity.Tag">
|
||||
SELECT
|
||||
*
|
||||
FROM `tag`
|
||||
WHERE
|
||||
TRUE
|
||||
<if test="idList != null and !idList.isEmpty()">
|
||||
AND `id` IN
|
||||
<foreach collection="idList" item="id" separator="," open="(" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="idList == null or idList.isEmpty()">
|
||||
AND FALSE
|
||||
</if>
|
||||
AND `deleted_at` IS NULL
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user