update tab_link set delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@DELETE_STATUS} where delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS}
from tab_link t1 left join tab_link_scene t2 on t1.link_id = t2.link_id
from tab_link t1 left join tab_link_scene t2 on t1.link_id = t2.link_id
and t1.parent_id = #{parentId}
and t1.parent_id = #{parentId}
and (t1.enterprise_type = 1 or (t1.enterprise_type = 2 and t2.enterprise_id = #{enterpriseId} and t2.status = 1 ))
and (t1.enterprise_type = 1 or (t1.enterprise_type = 2 and t2.enterprise_id = #{enterpriseId} and t2.delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS} ))
and t1.status = 1
and t1.delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS}
where link_scene_id = #{linkSceneId,jdbcType=INTEGER}
where link_scene_id = #{linkSceneId,jdbcType=INTEGER}
...
@@ -97,30 +97,30 @@
...
@@ -97,30 +97,30 @@
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
delete_flag = #{deleteFlag,jdbcType=INTEGER}
where link_scene_id = #{linkSceneId,jdbcType=INTEGER}
where link_scene_id = #{linkSceneId,jdbcType=INTEGER}
</update>
</update>
<selectid="listByLinkId"resultType="int">
<selectid="listByLinkId"resultType="int">
select
select
enterprise_id
enterprise_id
from tab_link_scene
from tab_link_scene
where status = 1
where delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS}
and link_id = #{linkId}
and link_id = #{linkId}
</select>
</select>
<updateid="delByLinkEnterprise">
<updateid="delByLinkEnterprise">
update tab_link_scene set status = 0 where status = 1 and link_id = #{linkId}
update tab_link_scene set delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@DELETE_STATUS} where delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS} and link_id = #{linkId}
</update>
</update>
<insertid="insertSelectiveByNotExist">
<insertid="insertSelectiveByNotExist">
INSERT INTO tab_link_scene (
INSERT INTO tab_link_scene (
link_id,
link_id,
enterprise_id,
enterprise_id,
create_time,
create_time,
status
delete_flag
) SELECT
) SELECT
#{linkId},
#{linkId},
#{enterpriseId},
#{enterpriseId},
#{createTime},
#{createTime},
#{status}
#{deleteFlag}
FROM
FROM
DUAL
DUAL
WHERE
WHERE
...
@@ -135,14 +135,14 @@
...
@@ -135,14 +135,14 @@
)
)
</insert>
</insert>
<updateid="updateStatusByEnterpriseId">
<updateid="updateStatusByEnterpriseId">
update tab_link_scene set status = 1 where link_id = #{linkId}
update tab_link_scene set delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS} where link_id = #{linkId}
update tab_link_scene set status = 0 where status = 1 and
update tab_link_scene set delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@DELETE_STATUS} where delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS} and
where delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS}
<iftest="createType != null ">
<iftest="createType != null ">
and create_type = #{createType}
and create_type = #{createType}
</if>
</if>
...
@@ -155,7 +155,7 @@
...
@@ -155,7 +155,7 @@
order by create_time desc
order by create_time desc
</select>
</select>
<updateid="delBrandByIds">
<updateid="delBrandByIds">
update tab_platform_brand set status = 0 where status = 1
update tab_platform_brand set delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@DELETE_STATUS} where delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS}
select count(1) from tab_platform_brand_ref where platform_brand_id = #{platformBrandId} and status = 1
select count(1) from tab_platform_brand_ref where platform_brand_id = #{platformBrandId} and delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS}
update tab_platform_brand_ref set status = 0 where enterprise_id = #{enterpriseId} and enterprise_brand_id = #{enterpriseBrandId}
update tab_platform_brand_ref set delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@DELETE_STATUS} where enterprise_id = #{enterpriseId} and enterprise_brand_id = #{enterpriseBrandId}
where delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS}
<iftest="platformBrandId != null ">
<iftest="platformBrandId != null ">
and platform_brand_id = #{platformBrandId}
and platform_brand_id = #{platformBrandId}
</if>
</if>
order by create_time desc
order by create_time desc
</select>
</select>
<updateid="delRefs">
<updateid="delRefs">
update tab_platform_brand_ref set status = 0 where enterprise_id = #{enterpriseId} and status = 1
update tab_platform_brand_ref set delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@DELETE_STATUS} where enterprise_id = #{enterpriseId} and delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS}
update tab_platform_brand_ref set platform_brand_id = #{toBrandId} where status = 1 and platform_brand_id = #{fromBrandId}
update tab_platform_brand_ref set platform_brand_id = #{toBrandId} where delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS} and platform_brand_id = #{fromBrandId}
</update>
</update>
<updateid="updateRefs">
<updateid="updateRefs">
update tab_platform_brand_ref set platform_brand_id = #{toBrandId} where status = 1
update tab_platform_brand_ref set platform_brand_id = #{toBrandId} where delete_flag = ${@com.gic.enterprise.constant.DeleteFlagConstants@NORMAL_STATUS}