|
@@ -12,10 +12,16 @@
|
|
<result column="job_" property="job"/>
|
|
<result column="job_" property="job"/>
|
|
<result column="mobile_no_" property="mobileNo"/>
|
|
<result column="mobile_no_" property="mobileNo"/>
|
|
<result column="address_" property="address"/>
|
|
<result column="address_" property="address"/>
|
|
|
|
+ <result column="is_enable_" property="isEnable"/>
|
|
<result column="ownership_type_" property="ownershipType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
<result column="ownership_type_" property="ownershipType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
<result column="create_time_" property="createTime"/>
|
|
<result column="create_time_" property="createTime"/>
|
|
<result column="update_time_" property="updateTime"/>
|
|
<result column="update_time_" property="updateTime"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
+
|
|
|
|
+ <resultMap type="com.ym.mec.biz.dal.entity.CooperationOrgan" id="ExtCooperationOrgan" extends="CooperationOrgan">
|
|
|
|
+ <result column="organ_id_" property="organization.id"/>
|
|
|
|
+ <result column="organ_name_" property="organization.name"/>
|
|
|
|
+ </resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
<!-- 根据主键查询一条记录 -->
|
|
<select id="get" resultMap="CooperationOrgan">
|
|
<select id="get" resultMap="CooperationOrgan">
|
|
@@ -33,8 +39,8 @@
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CooperationOrgan"
|
|
<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CooperationOrgan"
|
|
useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
INSERT INTO cooperation_organ
|
|
INSERT INTO cooperation_organ
|
|
- (id_,name_,linkman_,job_,mobile_no_,address_,organ_id_,create_time_,update_time_,ownership_type_)
|
|
|
|
- VALUES(#{id},#{name},#{linkman},#{job},#{mobileNo},#{address},#{organId},now(),now(),#{ownershipType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
|
|
|
|
|
|
+ (id_,name_,linkman_,job_,mobile_no_,address_,organ_id_,create_time_,update_time_,ownership_type_,is_enable_)
|
|
|
|
+ VALUES(#{id},#{name},#{linkman},#{job},#{mobileNo},#{address},#{organId},now(),now(),#{ownershipType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler,#{isEnable}})
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
<!-- 根据主键查询一条记录 -->
|
|
@@ -65,6 +71,9 @@
|
|
<if test="organId != null">
|
|
<if test="organId != null">
|
|
organ_id_ = #{organId},
|
|
organ_id_ = #{organId},
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="isEnable != null">
|
|
|
|
+ is_enable_ = #{isEnable},
|
|
|
|
+ </if>
|
|
</set>
|
|
</set>
|
|
WHERE id_ = #{id}
|
|
WHERE id_ = #{id}
|
|
</update>
|
|
</update>
|
|
@@ -75,19 +84,22 @@
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
<!-- 分页查询 -->
|
|
- <select id="queryPage" resultMap="CooperationOrgan"
|
|
|
|
|
|
+ <select id="queryPage" resultMap="ExtCooperationOrgan"
|
|
parameterType="map">
|
|
parameterType="map">
|
|
- SELECT * FROM cooperation_organ
|
|
|
|
|
|
+ SELECT co.*,o.name_ organ_name_ FROM cooperation_organ co left join organization o on co.organ_id_ = o.id_
|
|
<where>
|
|
<where>
|
|
- del_flag_ != 1
|
|
|
|
|
|
+ co.del_flag_ != 1
|
|
<if test="search != null">
|
|
<if test="search != null">
|
|
- AND (id_ LIKE CONCAT('%',#{search},'%') OR name_ LIKE CONCAT('%',#{search},'%'))
|
|
|
|
|
|
+ AND (co.id_ LIKE CONCAT('%',#{search},'%') OR co.name_ LIKE CONCAT('%',#{search},'%'))
|
|
</if>
|
|
</if>
|
|
<if test="organId != null">
|
|
<if test="organId != null">
|
|
- AND FIND_IN_SET(organ_id_,#{organId})
|
|
|
|
|
|
+ AND FIND_IN_SET(co.organ_id_,#{organId})
|
|
|
|
+ </if>
|
|
|
|
+ <if test="isEnable != null">
|
|
|
|
+ AND co.is_enable_ = #{isEnable}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
- ORDER BY update_time_ DESC
|
|
|
|
|
|
+ ORDER BY co.update_time_ DESC
|
|
<include refid="global.limit"/>
|
|
<include refid="global.limit"/>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -102,6 +114,9 @@
|
|
<if test="organId != null">
|
|
<if test="organId != null">
|
|
AND FIND_IN_SET(organ_id_,#{organId})
|
|
AND FIND_IN_SET(organ_id_,#{organId})
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="isEnable != null">
|
|
|
|
+ AND is_enable_ = #{isEnable}
|
|
|
|
+ </if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|