<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//oos.juyouhx.com//DTD Mapper 3.0//EN" "http://oss.juyouhx.com/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.scpyun.platform.standard.dq.partyandmassservice" name="党群服务中心">
    <select id="findPartOrgInfoList" parameterType="page" resultType="map" name="查询党组织信息列表">
        select
        *
        from jl_grid_org where garden_id = #{params.garden_id,jdbcType=VARCHAR} order by org_code
    </select>
    
    <select id="findOrgByCodeCount" parameterType="string" resultType="int" >
        select
        count(1)
        from jl_grid_org 
        where org_code = #{org_code,jdbcType=VARCHAR} 
        <if test="id != null">
	         and id!=#{id,jdbcType=VARCHAR}
	    </if>
       
    </select>
    


    <delete id="deletePartOrgInfo" parameterType="map" name="删除党组织信息">
        delete from jl_grid_org where id = #{id}
    </delete>

  <insert id="insertSelective" parameterType="map">
    insert into jl_grid_org
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="p_id != null">
        p_id,
      </if>
      <if test="org_type != null">
        org_type,
      </if>
      <if test="org_code != null">
        org_code,
      </if>
      <if test="org_name != null">
        org_name,
      </if>
      <if test="org_empl != null">
        org_empl,
      </if>
      <if test="org_empl_tel != null">
        org_empl_tel,
      </if>
      <if test="garden_id != null">
        garden_id,
      </if>
      <if test="org_address != null">
        org_address,
      </if>
      <if test="city_id != null">
        city_id,
      </if>
      <if test="area_id != null">
        area_id,
      </if>
      <if test="street_id != null">
        street_id,
      </if>
      <if test="community_id != null">
        community_id,
      </if>
      <if test="community_code != null">
        community_code,
      </if>
      <if test="csc_mapjson_ht != null">
        csc_mapjson_ht,
      </if>
      <if test="del_flag != null">
        del_flag,
      </if>
      <if test="create_by != null">
        create_by,
      </if>
      <if test="create_time != null">
        create_time,
      </if>
      <if test="update_by != null">
        update_by,
      </if>
      <if test="update_time != null">
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="p_id != null">
        #{p_id,jdbcType=VARCHAR},
      </if>
      <if test="org_type != null">
        #{org_type,jdbcType=VARCHAR},
      </if>
      <if test="org_code != null">
        #{org_code,jdbcType=VARCHAR},
      </if>
      <if test="org_name != null">
        #{org_name,jdbcType=VARCHAR},
      </if>
      <if test="org_empl != null">
        #{org_empl,jdbcType=VARCHAR},
      </if>
      <if test="org_empl_tel != null">
        #{org_empl_tel,jdbcType=VARCHAR},
      </if>
      <if test="garden_id != null">
        #{garden_id,jdbcType=VARCHAR},
      </if>
      <if test="org_address != null">
        #{org_address,jdbcType=VARCHAR},
      </if>
      <if test="city_id != null">
        #{city_id,jdbcType=VARCHAR},
      </if>
      <if test="area_id != null">
        #{area_id,jdbcType=VARCHAR},
      </if>
      <if test="street_id != null">
        #{street_id,jdbcType=VARCHAR},
      </if>
      <if test="community_id != null">
        #{community_id,jdbcType=VARCHAR},
      </if>
      <if test="community_code != null">
        #{community_code,jdbcType=VARCHAR},
      </if>
      <if test="csc_mapjson_ht != null">
        #{csc_mapjson_ht,jdbcType=VARCHAR},
      </if>
      <if test="del_flag != null">
        #{del_flag,jdbcType=CHAR},
      </if>
      <if test="create_by != null">
        #{create_by,jdbcType=VARCHAR},
      </if>
      <if test="create_time != null">
        #{create_time,jdbcType=TIMESTAMP},
      </if>
      <if test="update_by != null">
        #{update_by,jdbcType=VARCHAR},
      </if>
      <if test="update_time != null">
        #{update_time,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="map">
    update jl_grid_org
    <set>
      <if test="p_id != null">
        p_id = #{p_id,jdbcType=VARCHAR},
      </if>
      <if test="org_type != null">
        org_type = #{org_type,jdbcType=VARCHAR},
      </if>
      <if test="org_code != null">
        org_code = #{org_code,jdbcType=VARCHAR},
      </if>
      <if test="org_name != null">
        org_name = #{org_name,jdbcType=VARCHAR},
      </if>
      <if test="org_empl != null">
        org_empl = #{org_empl,jdbcType=VARCHAR},
      </if>
      <if test="org_empl_tel != null">
        org_empl_tel = #{org_empl_tel,jdbcType=VARCHAR},
      </if>
      <if test="garden_id != null">
        garden_id = #{garden_id,jdbcType=VARCHAR},
      </if>
      <if test="org_address != null">
        org_address = #{org_address,jdbcType=VARCHAR},
      </if>
      <if test="city_id != null">
        city_id = #{city_id,jdbcType=VARCHAR},
      </if>
      <if test="area_id != null">
        area_id = #{area_id,jdbcType=VARCHAR},
      </if>
      <if test="street_id != null">
        street_id = #{street_id,jdbcType=VARCHAR},
      </if>
      <if test="community_id != null">
        community_id = #{community_id,jdbcType=VARCHAR},
      </if>
      <if test="community_code != null">
        community_code = #{community_code,jdbcType=VARCHAR},
      </if>
      <if test="csc_mapjson_ht != null">
        csc_mapjson_ht = #{csc_mapjson_ht,jdbcType=VARCHAR},
      </if>
      <if test="del_flag != null">
        del_flag = #{del_flag,jdbcType=CHAR},
      </if>
      <if test="create_by != null">
        create_by = #{create_by,jdbcType=VARCHAR},
      </if>
      <if test="create_time != null">
        create_time = #{create_time,jdbcType=TIMESTAMP},
      </if>
      <if test="update_by != null">
        update_by = #{update_by,jdbcType=VARCHAR},
      </if>
      <if test="update_time != null">
        update_time = #{update_time,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>

</mapper>