|
@@ -6,6 +6,8 @@
|
|
|
<resultMap type="com.ym.mec.biz.dal.entity.CooperationOrgan"
|
|
|
id="CooperationOrgan">
|
|
|
<result column="id_" property="id"/>
|
|
|
+ <result column="education_user_id_" property="educationUserId"/>
|
|
|
+ <result column="real_name_" property="realName"/>
|
|
|
<result column="name_" property="name"/>
|
|
|
<result column="linkman_" property="linkman"/>
|
|
|
<result column="organ_id_" property="organId"/>
|
|
@@ -45,16 +47,19 @@
|
|
|
useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
INSERT INTO cooperation_organ
|
|
|
(id_, name_, linkman_, job_, mobile_no_, address_, organ_id_, create_time_, update_time_, ownership_type_,
|
|
|
- is_enable_, full_job_resource_)
|
|
|
+ is_enable_, full_job_resource_,education_user_id_)
|
|
|
VALUES (#{id}, #{name}, #{linkman}, #{job}, #{mobileNo}, #{address}, #{organId}, now(), now(),
|
|
|
#{ownershipType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{isEnable},
|
|
|
- #{fullJobResource})
|
|
|
+ #{fullJobResource},#{educationUserId})
|
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.CooperationOrgan">
|
|
|
UPDATE cooperation_organ
|
|
|
<set>
|
|
|
+ <if test="educationUserId != null">
|
|
|
+ education_user_id_ = #{educationUserId},
|
|
|
+ </if>
|
|
|
<if test="fullJobResource != null">
|
|
|
full_job_resource_ = #{fullJobResource},
|
|
|
</if>
|
|
@@ -99,11 +104,20 @@
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="ExtCooperationOrgan"
|
|
|
parameterType="map">
|
|
|
- SELECT co.*,o.name_ organ_name_ FROM cooperation_organ co left join organization o on co.organ_id_ = o.id_
|
|
|
+ SELECT co.*,o.name_ organ_name_,su.real_name_ FROM cooperation_organ co
|
|
|
+ LEFT JOIN organization o ON co.organ_id_ = o.id_
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = co.education_user_id_
|
|
|
+ <include refid="queryPageSql"/>
|
|
|
+ ORDER BY co.update_time_ DESC
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <sql id="queryPageSql">
|
|
|
<where>
|
|
|
co.del_flag_ != 1
|
|
|
<if test="search != null">
|
|
|
- AND (co.id_ LIKE CONCAT('%',#{search},'%') OR co.name_ LIKE CONCAT('%',#{search},'%'))
|
|
|
+ AND (co.education_user_id_ = #{search} OR su.real_name_ LIKE CONCAT('%',#{search},'%')
|
|
|
+ OR co.id_ LIKE CONCAT('%',#{search},'%') OR co.name_ LIKE CONCAT('%',#{search},'%'))
|
|
|
</if>
|
|
|
<if test="organId != null">
|
|
|
AND FIND_IN_SET(co.organ_id_,#{organId})
|
|
@@ -115,28 +129,13 @@
|
|
|
AND co.full_job_resource_ = #{fullJobResource}
|
|
|
</if>
|
|
|
</where>
|
|
|
- ORDER BY co.update_time_ DESC
|
|
|
- <include refid="global.limit"/>
|
|
|
- </select>
|
|
|
+ </sql>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM cooperation_organ
|
|
|
- <where>
|
|
|
- del_flag_ != 1
|
|
|
- <if test="search != null">
|
|
|
- AND (id_ LIKE CONCAT('%',#{search},'%') OR name_ LIKE CONCAT('%',#{search},'%'))
|
|
|
- </if>
|
|
|
- <if test="organId != null">
|
|
|
- AND FIND_IN_SET(organ_id_,#{organId})
|
|
|
- </if>
|
|
|
- <if test="isEnable != null">
|
|
|
- AND is_enable_ = #{isEnable}
|
|
|
- </if>
|
|
|
- <if test="fullJobResource != null">
|
|
|
- AND full_job_resource_ = #{fullJobResource}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
+ SELECT COUNT(co.id_) FROM cooperation_organ co
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = co.education_user_id_
|
|
|
+ <include refid="queryPageSql"/>
|
|
|
</select>
|
|
|
|
|
|
<select id="queryByOrganId" resultMap="CooperationOrgan">
|