feat: 企业标准库 迁移1
This commit is contained in:
+204
@@ -0,0 +1,204 @@
|
||||
<?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.adc.da.slrs.sarBussStandMenu.dao.SarBussStandMenuDao">
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu" >
|
||||
<id column="id" property="id" />
|
||||
<result column="menu_id" property="menuId" />
|
||||
<result column="buss_stand_id" property="bussStandId" />
|
||||
<result column="valid_flag" property="validFlag" />
|
||||
</resultMap>
|
||||
|
||||
<!-- SAR_BUSS_STAND_MENU table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
menu_id, buss_stand_id, id, valid_flag
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
<if test="menuId != null" >
|
||||
and menu_id = #{menuId}
|
||||
</if>
|
||||
<if test="bussStandId != null" >
|
||||
and buss_stand_id = #{bussStandId}
|
||||
</if>
|
||||
<if test="id != null" >
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="validFlag != null" >
|
||||
and valid_flag = #{validFlag}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_SAR_BUSS_STAND_MENU.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into SAR_BUSS_STAND_MENU(<include refid="Base_Column_List" />)
|
||||
values (#{menuId, jdbcType=VARCHAR}, #{bussStandId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR}, #{validFlag, jdbcType=INTEGER})
|
||||
</insert>
|
||||
|
||||
<!-- 动态插入记录 主键是序列 -->
|
||||
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu" >
|
||||
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
||||
SELECT SEQ_SAR_BUSS_STAND_MENU.NEXTVAL FROM DUAL
|
||||
</selectKey> -->
|
||||
insert into SAR_BUSS_STAND_MENU
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="menuId != null" >menu_id,</if>
|
||||
<if test="bussStandId != null" >buss_stand_id,</if>
|
||||
<if test="id != null" >id,</if>
|
||||
<if test="validFlag != null" >valid_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="menuId != null" >#{menuId, jdbcType=VARCHAR},</if>
|
||||
<if test="bussStandId != null" >#{bussStandId, jdbcType=VARCHAR},</if>
|
||||
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
|
||||
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 根据pk,修改记录-->
|
||||
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu" >
|
||||
update SAR_BUSS_STAND_MENU
|
||||
set menu_id = #{menuId},
|
||||
buss_stand_id = #{bussStandId},
|
||||
valid_flag = #{validFlag}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 修改记录,只修改只不为空的字段 -->
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu" >
|
||||
update SAR_BUSS_STAND_MENU
|
||||
<set >
|
||||
<if test="menuId != null" >
|
||||
menu_id = #{menuId},
|
||||
</if>
|
||||
<if test="bussStandId != null" >
|
||||
buss_stand_id = #{bussStandId},
|
||||
</if>
|
||||
<if test="validFlag != null" >
|
||||
valid_flag = #{validFlag},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateMenuidByMenuid" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.NewmenuOldmenuVO" >
|
||||
update SAR_BUSS_STAND_MENU
|
||||
set menu_id = #{newMenuid}
|
||||
where menu_id = #{oldMenuid}
|
||||
</update>
|
||||
|
||||
<update id="updateByStandIDSelective" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu" >
|
||||
update SAR_BUSS_STAND_MENU
|
||||
<set >
|
||||
<if test="menuId != null" >
|
||||
menu_id = #{menuId},
|
||||
</if>
|
||||
<if test="validFlag != null" >
|
||||
valid_flag = #{validFlag},
|
||||
</if>
|
||||
</set>
|
||||
where buss_stand_id = #{bussStandId}
|
||||
</update>
|
||||
<!-- 根据id查询 SAR_BUSS_STAND_MENU -->
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
||||
select <include refid="Base_Column_List" />
|
||||
from SAR_BUSS_STAND_MENU
|
||||
where id = #{value}
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 删除记录 -->
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from SAR_BUSS_STAND_MENU
|
||||
where id = #{value}
|
||||
|
||||
</delete>
|
||||
|
||||
<!-- SAR_BUSS_STAND_MENU 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from SAR_BUSS_STAND_MENU
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询SAR_BUSS_STAND_MENU列表 -->
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List" /> from
|
||||
(select tmp_tb.* from
|
||||
(select <include refid="Base_Column_List" /> from SAR_BUSS_STAND_MENU
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from SAR_BUSS_STAND_MENU
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectByMenuId" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu">
|
||||
select <include refid="Base_Column_List"/> from SAR_BUSS_STAND_MENU
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<delete id="deleteByStandId" parameterType="java.lang.String">
|
||||
delete from SAR_BUSS_STAND_MENU
|
||||
where buss_stand_id = #{bussStandId}
|
||||
|
||||
</delete>
|
||||
|
||||
<select id="selectMenuByMenuParentId" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu">
|
||||
select <include refid="Base_Column_List"/> from SAR_BUSS_STAND_MENU
|
||||
where buss_stand_id = #{bussStandId} and valid_flag=0
|
||||
and MENU_ID in
|
||||
<foreach collection="menuIds" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<update id="updateByStandIdAndMenuId" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu" >
|
||||
update SAR_BUSS_STAND_MENU
|
||||
<set >
|
||||
<if test="menuId != null" >
|
||||
menu_id = #{menuId},
|
||||
</if>
|
||||
</set>
|
||||
where buss_stand_id = #{bussStandId}
|
||||
and MENU_ID in
|
||||
<foreach collection="menuIds" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteByMenuId" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu">
|
||||
delete from SAR_BUSS_STAND_MENU
|
||||
where buss_stand_id = #{bussStandId}
|
||||
and MENU_ID in
|
||||
<foreach collection="menuIds" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectAllMenuByStandId" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu">
|
||||
select <include refid="Base_Column_List" />
|
||||
from SAR_BUSS_STAND_MENU
|
||||
where buss_stand_id = #{bussStandId} and valid_flag=0
|
||||
</select>
|
||||
|
||||
<delete id="deleteByStandIdAndMenuId" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.SarBussStandMenu">
|
||||
delete from SAR_BUSS_STAND_MENU
|
||||
where buss_stand_id = #{bussStandId, jdbcType=VARCHAR} and MENU_ID = #{menuId, jdbcType=VARCHAR}
|
||||
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user