|  | @@ -13,36 +13,41 @@
 | 
	
		
			
				|  |  |          <result column="mobile_no_" property="mobileNo"/>
 | 
	
		
			
				|  |  |          <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="update_time_" property="updateTime"/>
 | 
	
		
			
				|  |  |          <result column="full_job_resource_" property="fullJobResource"/>
 | 
	
		
			
				|  |  |      </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"/>
 | 
	
		
			
				|  |  | +        <result column="organ_id_" property="organization.id"/>
 | 
	
		
			
				|  |  | +        <result column="organ_name_" property="organization.name"/>
 | 
	
		
			
				|  |  |      </resultMap>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!-- 根据主键查询一条记录 -->
 | 
	
		
			
				|  |  |      <select id="get" resultMap="CooperationOrgan">
 | 
	
		
			
				|  |  | -		SELECT * FROM
 | 
	
		
			
				|  |  | -		cooperation_organ WHERE id_ = #{id}
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +        SELECT *
 | 
	
		
			
				|  |  | +        FROM cooperation_organ
 | 
	
		
			
				|  |  | +        WHERE id_ = #{id}
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!-- 全查询 -->
 | 
	
		
			
				|  |  |      <select id="findAll" resultMap="CooperationOrgan">
 | 
	
		
			
				|  |  | -		SELECT * FROM cooperation_organ AND del_flag_ != 1
 | 
	
		
			
				|  |  | -		ORDER BY id_
 | 
	
		
			
				|  |  | -	</select>
 | 
	
		
			
				|  |  | +        SELECT *
 | 
	
		
			
				|  |  | +        FROM cooperation_organ AND del_flag_ != 1
 | 
	
		
			
				|  |  | +        ORDER BY id_
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!-- 向数据库增加一条记录 -->
 | 
	
		
			
				|  |  |      <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CooperationOrgan"
 | 
	
		
			
				|  |  |              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_)
 | 
	
		
			
				|  |  | -        VALUES(#{id},#{name},#{linkman},#{job},#{mobileNo},#{address},#{organId},now(),now(),
 | 
	
		
			
				|  |  | -        #{ownershipType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isEnable},#{fullJobResource})
 | 
	
		
			
				|  |  | +        (id_, name_, linkman_, job_, mobile_no_, address_, organ_id_, create_time_, update_time_, ownership_type_,
 | 
	
		
			
				|  |  | +         is_enable_, full_job_resource_)
 | 
	
		
			
				|  |  | +        VALUES (#{id}, #{name}, #{linkman}, #{job}, #{mobileNo}, #{address}, #{organId}, now(), now(),
 | 
	
		
			
				|  |  | +                #{ownershipType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{isEnable},
 | 
	
		
			
				|  |  | +                #{fullJobResource})
 | 
	
		
			
				|  |  |      </insert>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!-- 根据主键查询一条记录 -->
 | 
	
	
		
			
				|  | @@ -85,24 +90,26 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!-- 根据主键删除一条记录 -->
 | 
	
		
			
				|  |  |      <update id="delete">
 | 
	
		
			
				|  |  | -		UPDATE cooperation_organ SET del_flag_ = 1 WHERE id_ =#{id}
 | 
	
		
			
				|  |  | -	</update>
 | 
	
		
			
				|  |  | +        UPDATE cooperation_organ
 | 
	
		
			
				|  |  | +        SET del_flag_ = 1
 | 
	
		
			
				|  |  | +        WHERE id_ = #{id}
 | 
	
		
			
				|  |  | +    </update>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!-- 分页查询 -->
 | 
	
		
			
				|  |  |      <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_
 | 
	
		
			
				|  |  |          <where>
 | 
	
		
			
				|  |  | -                co.del_flag_ != 1
 | 
	
		
			
				|  |  | +            co.del_flag_ != 1
 | 
	
		
			
				|  |  |              <if test="search != null">
 | 
	
		
			
				|  |  |                  AND (co.id_ LIKE CONCAT('%',#{search},'%') OR co.name_ LIKE CONCAT('%',#{search},'%'))
 | 
	
		
			
				|  |  |              </if>
 | 
	
		
			
				|  |  | -	        <if test="organId != null">
 | 
	
		
			
				|  |  | -	            AND FIND_IN_SET(co.organ_id_,#{organId})
 | 
	
		
			
				|  |  | -	        </if>
 | 
	
		
			
				|  |  | -	        <if test="isEnable != null">
 | 
	
		
			
				|  |  | -	            AND co.is_enable_ = #{isEnable}
 | 
	
		
			
				|  |  | -	        </if>
 | 
	
		
			
				|  |  | +            <if test="organId != null">
 | 
	
		
			
				|  |  | +                AND FIND_IN_SET(co.organ_id_,#{organId})
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="isEnable != null">
 | 
	
		
			
				|  |  | +                AND co.is_enable_ = #{isEnable}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  |              <if test="fullJobResource != null">
 | 
	
		
			
				|  |  |                  AND co.full_job_resource_ = #{fullJobResource}
 | 
	
		
			
				|  |  |              </if>
 | 
	
	
		
			
				|  | @@ -113,42 +120,62 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!-- 查询当前表的总记录数 -->
 | 
	
		
			
				|  |  |      <select id="queryCount" resultType="int">
 | 
	
		
			
				|  |  | -		SELECT COUNT(*) FROM cooperation_organ
 | 
	
		
			
				|  |  | +        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="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>
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="queryByOrganId" resultMap="CooperationOrgan">
 | 
	
		
			
				|  |  | -        SELECT * FROM cooperation_organ WHERE FIND_IN_SET(organ_id_,#{organId}) AND del_flag_ != 1 AND is_enable_ = 1
 | 
	
		
			
				|  |  | +        SELECT *
 | 
	
		
			
				|  |  | +        FROM cooperation_organ
 | 
	
		
			
				|  |  | +        WHERE FIND_IN_SET(organ_id_, #{organId})
 | 
	
		
			
				|  |  | +          AND del_flag_ != 1
 | 
	
		
			
				|  |  | +          AND is_enable_ = 1
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="queryNameByIds" resultType="java.util.Map">
 | 
	
		
			
				|  |  | -        SELECT co.id_ 'key',co.name_ 'value' FROM cooperation_organ co
 | 
	
		
			
				|  |  | -        WHERE FIND_IN_SET(co.id_,#{organIds}) AND co.del_flag_ != 1
 | 
	
		
			
				|  |  | +        SELECT co.id_ 'key', co.name_ 'value'
 | 
	
		
			
				|  |  | +        FROM cooperation_organ co
 | 
	
		
			
				|  |  | +        WHERE FIND_IN_SET(co.id_, #{organIds})
 | 
	
		
			
				|  |  | +          AND co.del_flag_ != 1
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="getOrganFullJobResourceNum" resultType="com.ym.mec.biz.dal.dto.OrganFullJobResourceNumDto">
 | 
	
		
			
				|  |  | -        SELECT organ_id_ organId,COUNT(*) num FROM cooperation_organ
 | 
	
		
			
				|  |  | -        WHERE full_job_resource_ =1 AND del_flag_ = 0
 | 
	
		
			
				|  |  | +        SELECT organ_id_ organId, COUNT(*) num
 | 
	
		
			
				|  |  | +        FROM cooperation_organ
 | 
	
		
			
				|  |  | +        WHERE full_job_resource_ = 1
 | 
	
		
			
				|  |  | +          AND del_flag_ = 0
 | 
	
		
			
				|  |  |          GROUP BY organ_id_
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <!-- 获取全部使用中的合作单位 -->
 | 
	
		
			
				|  |  |      <select id="getAllCooperationOrgan" resultMap="CooperationOrgan">
 | 
	
		
			
				|  |  | -        SELECT * FROM cooperation_organ
 | 
	
		
			
				|  |  | +        SELECT *
 | 
	
		
			
				|  |  | +        FROM cooperation_organ
 | 
	
		
			
				|  |  |          WHERE del_flag_ = 0
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    <!-- 获取合作单位乐团的的学校缴费 -->
 | 
	
		
			
				|  |  | +    <select id="getCooperationOrganCalender4School"
 | 
	
		
			
				|  |  | +            resultMap="com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao.MusicGroupPaymentCalender">
 | 
	
		
			
				|  |  | +        SELECT mgpc.*
 | 
	
		
			
				|  |  | +        FROM music_group mg
 | 
	
		
			
				|  |  | +                 LEFT JOIN music_group_payment_calender mgpc ON mgpc.music_group_id_ = mg.id_
 | 
	
		
			
				|  |  | +        WHERE mg.cooperation_organ_id_ = #{cooperationOrganId}
 | 
	
		
			
				|  |  | +          AND mgpc.pay_user_type_ = 'SCHOOL'
 | 
	
		
			
				|  |  | +          AND mgpc.status_ IN ('NO', 'OPEN', 'OVER')
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  |  </mapper>
 |