|  |  | 
 |  |  |     <!--@mbg.generated--> | 
 |  |  |     id, `name`, countyId, townId, villageId, blockId, villages, area, `header`, phone,  | 
 |  |  |     lng, lat, remark, deleted | 
 |  |  |   </sql>  <sql id="Base2_Column_List"> | 
 |  |  |     <!--@mbg.generated--> | 
 |  |  |   ${alias}.id, ${alias}.name, ${alias}.countyId, ${alias}.townId, ${alias}.villageId, ${alias}.blockId, ${alias}.villages, ${alias}.area, ${alias}.header, ${alias}.phone, ${alias}.lng, ${alias}.lat, ${alias}.remark | 
 |  |  |   </sql> | 
 |  |  |   <sql id="part_Column_List"> | 
 |  |  |     <!--@mbg.generated--> | 
 |  |  |     id, `name` | 
 |  |  |   </sql> | 
 |  |  |   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | 
 |  |  |     <!--@mbg.generated--> | 
 |  |  | 
 |  |  |     from ba_divide | 
 |  |  |     where id = #{id,jdbcType=BIGINT} | 
 |  |  |   </select> | 
 |  |  |   <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDivide"> | 
 |  |  |   <select id="selectAll" resultMap="BaseResultMap"> | 
 |  |  |     <!--@mbg.generated--> | 
 |  |  |     select | 
 |  |  |     <include refid="part_Column_List"/> | 
 |  |  |     from ba_divide | 
 |  |  |   </select> | 
 |  |  |   <select id="selectTotal" parameterType="java.util.Map" resultType="java.lang.Long"> | 
 |  |  |     <!--@mbg.generated--> | 
 |  |  |     select | 
 |  |  |     count(*) | 
 |  |  |     from ba_divide bd | 
 |  |  |     left join ba_block bbk on bd.blockId = bbk.id | 
 |  |  |     where bd.deleted != 1 | 
 |  |  |     <trim prefix="and" suffixOverrides="and"> | 
 |  |  |       <if test="name != null and name != ''"> | 
 |  |  |         bd.name like concat('%', #{name}, '%') and | 
 |  |  |       </if> | 
 |  |  |       <if test="header != null and header != ''"> | 
 |  |  |         bd.header = '#{header,jdbcType=VARCHAR}' and | 
 |  |  |       </if> | 
 |  |  |       <if test="phone != null and phone != ''"> | 
 |  |  |         bd.phone = '#{phone,jdbcType=VARCHAR}' and | 
 |  |  |       </if> | 
 |  |  |       <if test="blockName != null"> | 
 |  |  |         bbk.name like concat('%', #{blockName}, '%') and | 
 |  |  |       </if> | 
 |  |  |     </trim> | 
 |  |  |   </select> | 
 |  |  |   <select id="selectSome" parameterType="java.util.Map" resultMap="BaseResultMap"> | 
 |  |  |     <!--@mbg.generated--> | 
 |  |  |     select | 
 |  |  |     <include refid="Base2_Column_List" > | 
 |  |  |       <property name="alias" value="bd"/> | 
 |  |  |     </include>, | 
 |  |  |     bbk.name blockName, | 
 |  |  |     bdtt.name townName, | 
 |  |  |     bdtv.name villageName | 
 |  |  |     from ba_divide bd | 
 |  |  |     left join ba_block bbk on bd.blockId = bbk.id | 
 |  |  |     left join ba_district bdtt on bd.townId=bdtt.id | 
 |  |  |     left join ba_district bdtv on bd.villageId=bdtv.id | 
 |  |  |     where bd.deleted != 1 | 
 |  |  |     <trim prefix="and" suffixOverrides="and"> | 
 |  |  |       <if test="name != null and name != ''"> | 
 |  |  |         bd.name like concat('%', #{name}, '%') and | 
 |  |  |       </if> | 
 |  |  |       <if test="header != null and header != ''"> | 
 |  |  |         bd.header = '#{header,jdbcType=VARCHAR}' and | 
 |  |  |       </if> | 
 |  |  |       <if test="phone != null and phone != ''"> | 
 |  |  |         bd.phone = '#{phone,jdbcType=VARCHAR}' and | 
 |  |  |       </if> | 
 |  |  |       <if test="blockName != null"> | 
 |  |  |         bbk.name like concat('%', #{blockName}, '%') and | 
 |  |  |       </if> | 
 |  |  |     </trim> | 
 |  |  |     order by bd.id DESC | 
 |  |  |     <trim prefix="limit " > | 
 |  |  |       <if test="start != null and count != null"> | 
 |  |  |         #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} | 
 |  |  |       </if> | 
 |  |  |     </trim> | 
 |  |  |   </select> | 
 |  |  |   <insert id="putin" parameterType="com.dy.pipIrrGlobal.pojoBa.BaDivide"> | 
 |  |  |     <!--@mbg.generated--> | 
 |  |  |     insert into ba_divide (id, `name`, countyId,  | 
 |  |  |       townId, villageId, blockId,  | 
 |  |  |       villages, area, `header`,  | 
 |  |  |       villages, area, header, | 
 |  |  |       phone, lng, lat, remark,  | 
 |  |  |       deleted) | 
 |  |  |     values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{countyId,jdbcType=BIGINT},  |