|
@@ -2,8 +2,8 @@
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!-- namespace必须指向DAO接口 -->
|
|
<!-- namespace必须指向DAO接口 -->
|
|
-<mapper namespace="com.jpsoft.bus.modules.base.dao.CompanyInfoDAO">
|
|
|
|
- <resultMap id="CompanyInfoMap" type="com.jpsoft.bus.modules.base.entity.CompanyInfo">
|
|
|
|
|
|
+<mapper namespace="com.jpsoft.bus.modules.bus.dao.CompanyInfoDAO">
|
|
|
|
+ <resultMap id="CompanyInfoMap" type="com.jpsoft.bus.modules.bus.entity.CompanyInfo">
|
|
<id property="id" column="id_"/>
|
|
<id property="id" column="id_"/>
|
|
<result property="sortNo" column="sort_no"/>
|
|
<result property="sortNo" column="sort_no"/>
|
|
<result property="name" column="name_"/>
|
|
<result property="name" column="name_"/>
|
|
@@ -21,14 +21,14 @@
|
|
<result property="typeName" column="type_name" />
|
|
<result property="typeName" column="type_name" />
|
|
<result property="level" column="level_"/>
|
|
<result property="level" column="level_"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
- <insert id="insert" parameterType="com.jpsoft.bus.modules.base.entity.CompanyInfo">
|
|
|
|
|
|
+ <insert id="insert" parameterType="com.jpsoft.bus.modules.bus.entity.CompanyInfo">
|
|
<!--
|
|
<!--
|
|
<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
select sys_guid() from dual
|
|
select sys_guid() from dual
|
|
</selectKey>
|
|
</selectKey>
|
|
-->
|
|
-->
|
|
<![CDATA[
|
|
<![CDATA[
|
|
- insert into base_company_info
|
|
|
|
|
|
+ insert into bus_company_info
|
|
(id_,sort_no,name_,full_name,remark_,create_by,create_time,
|
|
(id_,sort_no,name_,full_name,remark_,create_by,create_time,
|
|
update_by,update_time,del_flag,parent_id,code_,type_,level_
|
|
update_by,update_time,del_flag,parent_id,code_,type_,level_
|
|
)
|
|
)
|
|
@@ -52,10 +52,10 @@
|
|
]]>
|
|
]]>
|
|
</insert>
|
|
</insert>
|
|
<delete id="delete" parameterType="string">
|
|
<delete id="delete" parameterType="string">
|
|
- delete from base_company_info where id_=#{id,jdbcType=VARCHAR}
|
|
|
|
|
|
+ delete from bus_company_info where id_=#{id,jdbcType=VARCHAR}
|
|
</delete>
|
|
</delete>
|
|
- <update id="update" parameterType="com.jpsoft.bus.modules.base.entity.CompanyInfo">
|
|
|
|
- update base_company_info
|
|
|
|
|
|
+ <update id="update" parameterType="com.jpsoft.bus.modules.bus.entity.CompanyInfo">
|
|
|
|
+ update bus_company_info
|
|
<set>
|
|
<set>
|
|
<if test="sortNo!=null">
|
|
<if test="sortNo!=null">
|
|
sort_no=#{sortNo,jdbcType= NUMERIC },
|
|
sort_no=#{sortNo,jdbcType= NUMERIC },
|
|
@@ -100,29 +100,29 @@
|
|
where id_=#{id}
|
|
where id_=#{id}
|
|
</update>
|
|
</update>
|
|
<update id="updateCode">
|
|
<update id="updateCode">
|
|
- update base_company_info
|
|
|
|
|
|
+ update bus_company_info
|
|
set code_ = concat(#{newCode},substr(code_,#{startIndex}))
|
|
set code_ = concat(#{newCode},substr(code_,#{startIndex}))
|
|
where code_ like #{oldCode}
|
|
where code_ like #{oldCode}
|
|
</update>
|
|
</update>
|
|
<select id="get" parameterType="string" resultMap="CompanyInfoMap">
|
|
<select id="get" parameterType="string" resultMap="CompanyInfoMap">
|
|
select a.*,b.name_ as parent_name
|
|
select a.*,b.name_ as parent_name
|
|
- from base_company_info a
|
|
|
|
- left join base_company_info b on a.parent_id = b.id_
|
|
|
|
|
|
+ from bus_company_info a
|
|
|
|
+ left join bus_company_info b on a.parent_id = b.id_
|
|
where a.id_=#{0}
|
|
where a.id_=#{0}
|
|
</select>
|
|
</select>
|
|
<select id="exist" parameterType="string" resultType="int">
|
|
<select id="exist" parameterType="string" resultType="int">
|
|
- select count(*) from base_company_info where id_=#{0} and del_flag = 0
|
|
|
|
|
|
+ select count(*) from bus_company_info where id_=#{0} and del_flag = 0
|
|
</select>
|
|
</select>
|
|
<select id="list" resultMap="CompanyInfoMap">
|
|
<select id="list" resultMap="CompanyInfoMap">
|
|
- select * from base_company_info where del_flag=0 order by level_ asc,sort_no asc
|
|
|
|
|
|
+ select * from bus_company_info where del_flag=0 order by level_ asc,sort_no asc
|
|
</select>
|
|
</select>
|
|
<select id="search" parameterType="hashmap" resultMap="CompanyInfoMap">
|
|
<select id="search" parameterType="hashmap" resultMap="CompanyInfoMap">
|
|
<![CDATA[
|
|
<![CDATA[
|
|
select
|
|
select
|
|
a.*,
|
|
a.*,
|
|
b.name_ as parent_name
|
|
b.name_ as parent_name
|
|
- from base_company_info a
|
|
|
|
- left join base_company_info b on a.parent_id = b.id_
|
|
|
|
|
|
+ from bus_company_info a
|
|
|
|
+ left join bus_company_info b on a.parent_id = b.id_
|
|
]]>
|
|
]]>
|
|
<where>
|
|
<where>
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
@@ -145,8 +145,8 @@
|
|
</select>
|
|
</select>
|
|
<select id="findByParentId" resultMap="CompanyInfoMap">
|
|
<select id="findByParentId" resultMap="CompanyInfoMap">
|
|
select a.*,b.name_ as parent_name
|
|
select a.*,b.name_ as parent_name
|
|
- from base_company_info a
|
|
|
|
- left join base_company_info b on a.parent_id = b.id_
|
|
|
|
|
|
+ from bus_company_info a
|
|
|
|
+ left join bus_company_info b on a.parent_id = b.id_
|
|
where a.del_flag=0
|
|
where a.del_flag=0
|
|
<if test="parentId!=null">
|
|
<if test="parentId!=null">
|
|
and a.parent_id=#{parentId,jdbcType=VARCHAR}
|
|
and a.parent_id=#{parentId,jdbcType=VARCHAR}
|
|
@@ -158,14 +158,14 @@
|
|
</select>
|
|
</select>
|
|
<select id="findByName" parameterType="string" resultMap="CompanyInfoMap">
|
|
<select id="findByName" parameterType="string" resultMap="CompanyInfoMap">
|
|
select a.*,b.name_ as parent_name
|
|
select a.*,b.name_ as parent_name
|
|
- from base_company_info a
|
|
|
|
- left join base_company_info b on a.parent_id = b.id_
|
|
|
|
|
|
+ from bus_company_info a
|
|
|
|
+ left join bus_company_info b on a.parent_id = b.id_
|
|
where (a.name_=#{0} or a.full_name=#{0})
|
|
where (a.name_=#{0} or a.full_name=#{0})
|
|
and a.del_flag = 0
|
|
and a.del_flag = 0
|
|
limit 1
|
|
limit 1
|
|
</select>
|
|
</select>
|
|
<select id="findByCompanyCodeAndType" resultMap="CompanyInfoMap">
|
|
<select id="findByCompanyCodeAndType" resultMap="CompanyInfoMap">
|
|
- select * from base_company_info
|
|
|
|
|
|
+ select * from bus_company_info
|
|
where del_flag = 0
|
|
where del_flag = 0
|
|
and code_ like #{code}
|
|
and code_ like #{code}
|
|
<if test="type!=null">
|
|
<if test="type!=null">
|
|
@@ -176,7 +176,7 @@
|
|
|
|
|
|
<select id="findAllCompanyByCode" resultMap="CompanyInfoMap">
|
|
<select id="findAllCompanyByCode" resultMap="CompanyInfoMap">
|
|
<![CDATA[
|
|
<![CDATA[
|
|
- select * from base_company_info
|
|
|
|
|
|
+ select * from bus_company_info
|
|
where del_flag = 0
|
|
where del_flag = 0
|
|
and code_ like #{code}
|
|
and code_ like #{code}
|
|
]]>
|
|
]]>
|
|
@@ -184,14 +184,14 @@
|
|
|
|
|
|
<select id="findByType" resultMap="CompanyInfoMap">
|
|
<select id="findByType" resultMap="CompanyInfoMap">
|
|
<![CDATA[
|
|
<![CDATA[
|
|
- select * from base_company_info
|
|
|
|
|
|
+ select * from bus_company_info
|
|
where del_flag = 0
|
|
where del_flag = 0
|
|
and type_ = #{type}
|
|
and type_ = #{type}
|
|
]]>
|
|
]]>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="countByParentId" resultType="long">
|
|
<select id="countByParentId" resultType="long">
|
|
- select count(*) from base_company_info
|
|
|
|
|
|
+ select count(*) from bus_company_info
|
|
<where>
|
|
<where>
|
|
del_flag=0
|
|
del_flag=0
|
|
<if test="parentId!=null">
|
|
<if test="parentId!=null">
|
|
@@ -205,8 +205,8 @@
|
|
|
|
|
|
<select id="findByCompanyCode" resultMap="CompanyInfoMap">
|
|
<select id="findByCompanyCode" resultMap="CompanyInfoMap">
|
|
select a.*,b.name_ as parent_name
|
|
select a.*,b.name_ as parent_name
|
|
- from base_company_info a
|
|
|
|
- left join base_company_info b on a.parent_id = b.id_
|
|
|
|
|
|
+ from bus_company_info a
|
|
|
|
+ left join bus_company_info b on a.parent_id = b.id_
|
|
where a.del_flag=0
|
|
where a.del_flag=0
|
|
<trim prefix="and (" prefixOverrides="AND|OR" suffix=")">
|
|
<trim prefix="and (" prefixOverrides="AND|OR" suffix=")">
|
|
<if test="code!=null">
|
|
<if test="code!=null">
|
|
@@ -215,11 +215,6 @@
|
|
<if test="code==null">
|
|
<if test="code==null">
|
|
a.code_='-1'
|
|
a.code_='-1'
|
|
</if>
|
|
</if>
|
|
- <if test="personId!=null">
|
|
|
|
- or a.id_ in (
|
|
|
|
- select c.company_id from base_person_company c where c.person_id = #{personId}
|
|
|
|
- )
|
|
|
|
- </if>
|
|
|
|
</trim>
|
|
</trim>
|
|
order by a.level_ asc,a.sort_no asc,a.name_ asc
|
|
order by a.level_ asc,a.sort_no asc,a.name_ asc
|
|
</select>
|
|
</select>
|