|
@@ -7,7 +7,7 @@
|
|
|
<mapper namespace="com.keao.edu.user.dao.OrganizationDao">
|
|
|
|
|
|
<resultMap type="com.keao.edu.user.entity.Organization" id="Organization">
|
|
|
- <result column="id_" property="id" />
|
|
|
+ <result column="organization_id_" property="id" />
|
|
|
<result column="user_id_" property="userId" />
|
|
|
<result column="name_" property="name" />
|
|
|
<result column="contact_name_" property="contactName" />
|
|
@@ -24,17 +24,24 @@
|
|
|
<result column="tenant_id_" property="tenantId" />
|
|
|
<association property="sysUser" resultMap="com.keao.edu.user.dao.SysUserDao.SysUser"/>
|
|
|
</resultMap>
|
|
|
+ <sql id="organizationColumn">
|
|
|
+ o.id_ organization_id_, o.user_id_, o.name_, o.contact_name_, o.contact_phone_,
|
|
|
+ o.settlement_type_, o.share_profit_amount_, o.level_, o.parent_organ_id_,
|
|
|
+ o.parent_organ_id_tag_, o.is_allow_arrange_exam_, o.create_time_,
|
|
|
+ o.update_time_, o.del_flag_, o.tenant_id_
|
|
|
+ </sql>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<select id="get" resultMap="Organization" >
|
|
|
- SELECT * FROM organization o
|
|
|
+ SELECT <include refid="organizationColumn"/>,su.*
|
|
|
+ FROM organization o
|
|
|
LEFT JOIN sys_user su ON o.user_id_ = su.id_
|
|
|
WHERE o.id_ = #{id} LIMIT 1
|
|
|
</select>
|
|
|
|
|
|
<!-- 全查询 -->
|
|
|
<select id="findAll" resultMap="Organization">
|
|
|
- SELECT * FROM organization WHERE tenant_id_ = #{tenantId} ORDER BY id_
|
|
|
+ SELECT <include refid="organizationColumn"/> FROM organization o WHERE tenant_id_ = #{tenantId} ORDER BY id_
|
|
|
</select>
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
@@ -112,7 +119,7 @@
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="Organization" parameterType="map">
|
|
|
- SELECT * FROM organization
|
|
|
+ SELECT <include refid="organizationColumn"/> FROM organization o
|
|
|
<include refid="organQueryPage"/>
|
|
|
ORDER BY update_time_ DESC <include refid="global.limit"/>
|
|
|
</select>
|
|
@@ -124,7 +131,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getByTenant" resultMap="Organization">
|
|
|
- SELECT * FROM organization WHERE tenant_id_ = #{tenantId} ORDER BY id_
|
|
|
+ SELECT <include refid="organizationColumn"/> FROM organization o WHERE tenant_id_ = #{tenantId} ORDER BY id_
|
|
|
</select>
|
|
|
|
|
|
<select id="getChildOrganIds" resultType="int">
|
|
@@ -132,14 +139,14 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getChildOrgans" resultMap="Organization">
|
|
|
- SELECT * FROM organization WHERE parent_organ_id_tag_ LIKE CONCAT(#{parentOrganIdTag}, '%');
|
|
|
+ SELECT <include refid="organizationColumn"/> FROM organization o WHERE parent_organ_id_tag_ LIKE CONCAT(#{parentOrganIdTag}, '%');
|
|
|
</select>
|
|
|
|
|
|
<select id="getNextLevelOrganIds" resultType="int">
|
|
|
SELECT id_ FROM organization WHERE parent_organ_id_ =#{organId};
|
|
|
</select>
|
|
|
<select id="getOrgans" resultMap="Organization">
|
|
|
- SELECT * FROM organization WHERE id_ IN
|
|
|
+ SELECT <include refid="organizationColumn"/> FROM organization o WHERE id_ IN
|
|
|
<foreach collection="organIds" item="organId" separator="," open="(" close=")">
|
|
|
#{organId}
|
|
|
</foreach>
|