From 437713ee567f25c04f094057a1908b6dc54eeefd Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期四, 16 十一月 2023 16:57:29 +0800 Subject: [PATCH] 1、农户类型管理 2、农户管理 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml | 423 ++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 295 insertions(+), 128 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml index c195457..be5f478 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml @@ -33,132 +33,299 @@ disabled </sql> - <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoBa.BaClient"> - <!--@mbg.generated--> - insert into ba_client (id, countyId, townId, villageId, blockId, divideId, - typeId, `name`, num, phone, - idCard, area, district, address, - remark, disabled, deleted - ) - values (#{id,jdbcType=BIGINT}, #{countyId,jdbcType=BIGINT}, - #{townId,jdbcType=BIGINT}, #{villageId,jdbcType=BIGINT}, - #{blockId,jdbcType=BIGINT}, #{divideId,jdbcType=BIGINT}, #{typeId,jdbcType=BIGINT}, - #{name,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, - #{phone,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR}, - #{area,jdbcType=FLOAT}, #{district,jdbcType=VARCHAR}, - #{address,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR}, - #{disabled,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, - #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT} - ) - </insert> - <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaClient"> - <!--@mbg.generated--> - insert into ba_client - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="id != null"> - id, - </if> - <if test="countyId != null"> - countyId, - </if> - <if test="townId != null"> - townId, - </if> - <if test="villageId != null"> - villageId, - </if> - <if test="divideId != null"> - divideId, - </if> - <if test="blockId != null"> - blockId, - </if> - <if test="typeId != null"> - typeId, - </if> - <if test="name != null"> - `name`, - </if> - <if test="num != null"> - num, - </if> - <if test="phone != null"> - phone, - </if> - <if test="idcard != null"> - idCard, - </if> - <if test="area != null"> - area, - </if> - <if test="district != null"> - district, - </if> - <if test="address != null"> - address, - </if> - <if test="remark != null"> - remark, - </if> - <if test="disabled != null"> - disabled, - </if> - <if test="deleted != null"> - deleted, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="id != null"> - #{id,jdbcType=BIGINT}, - </if> - <if test="countyId != null"> - #{countyId,jdbcType=BIGINT}, - </if> - <if test="townId != null"> - #{townId,jdbcType=BIGINT}, - </if> - <if test="villageId != null"> - #{villageId,jdbcType=BIGINT}, - </if> - <if test="divideId != null"> - #{divideId,jdbcType=BIGINT}, - </if> - <if test="blockId != null"> - #{blockId,jdbcType=BIGINT}, - </if> - <if test="typeId != null"> - #{typeId,jdbcType=BIGINT}, - </if> - <if test="name != null"> - #{name,jdbcType=VARCHAR}, - </if> - <if test="num != null"> - #{num,jdbcType=INTEGER}, - </if> - <if test="phone != null"> - #{phone,jdbcType=VARCHAR}, - </if> - <if test="idcard != null"> - #{idcard,jdbcType=VARCHAR}, - </if> - <if test="area != null"> - #{area,jdbcType=FLOAT}, - </if> - <if test="district != null"> - #{district,jdbcType=VARCHAR}, - </if> - <if test="address != null"> - #{address,jdbcType=VARCHAR}, - </if> - <if test="remark != null"> - #{remark,jdbcType=VARCHAR}, - </if> - <if test="disabled != null"> - #{disabled,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, - </if> - <if test="deleted != null"> - #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, - </if> - </trim> - </insert> + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="Base_Column_List" /> + from ba_client + where id = #{id,jdbcType=BIGINT} + </select> + <select id="selectCountByType" parameterType="long" resultType="java.lang.Long"> + select + count(*) + from ba_client + where deleted != 1 and typeId = #{typeId,jdbcType=BIGINT} + </select> + <select id="selectTotal" parameterType="java.util.Map" resultType="java.lang.Long"> + select + count(*) + from ba_client + where deleted != 1 + <trim prefix="and" suffixOverrides="and"> + <if test="countyId != null"> + countyId = #{countyId,jdbcType=BIGINT} and + </if> + <if test="townId != null"> + townId = #{townId,jdbcType=BIGINT} and + </if> + <if test="villageId != null"> + villageId = #{villageId,jdbcType=BIGINT} and + </if> + <if test="blockId != null"> + blockId = #{blockId,jdbcType=BIGINT} and + </if> + <if test="name != null"> + name like '%#{name,jdbcType=VARCHAR}%' and + </if> + <if test="num != null"> + num = '#{num,jdbcType=VARCHAR}' and + </if> + <if test="phone != null"> + phone = '#{phone,jdbcType=VARCHAR}' and + </if> + </trim> + </select> + <select id="selectSome" parameterType="java.util.Map" resultMap="BaseResultMap"> + <!--@mbg.generated--> + select + <include refid="part_Column_List" /> + from ba_client + where deleted != 1 + <trim prefix="and" suffixOverrides="and"> + <if test="countyId != null"> + countyId = #{countyId,jdbcType=BIGINT} and + </if> + <if test="townId != null"> + townId = #{townId,jdbcType=BIGINT} and + </if> + <if test="villageId != null"> + villageId = #{villageId,jdbcType=BIGINT} and + </if> + <if test="blockId != null"> + blockId = #{blockId,jdbcType=BIGINT} and + </if> + <if test="name != null"> + name like '%#{name,jdbcType=VARCHAR}%' and + </if> + <if test="num != null"> + num = '#{num,jdbcType=VARCHAR}' and + </if> + <if test="phone != null"> + phone = '#{phone,jdbcType=VARCHAR}' and + </if> + </trim> + order by id DESC + <trim prefix="limit " > + <if test="start != null and count != null"> + #{start}, #{count} + </if> + </trim> + </select> + <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoBa.BaClient"> + <!--@mbg.generated--> + insert into ba_client (id, countyId, townId, villageId, blockId, divideId, + typeId, `name`, num, phone, + idCard, area, district, address, + remark, disabled, deleted + ) + values (#{id,jdbcType=BIGINT}, #{countyId,jdbcType=BIGINT}, + #{townId,jdbcType=BIGINT}, #{villageId,jdbcType=BIGINT}, + #{blockId,jdbcType=BIGINT}, #{divideId,jdbcType=BIGINT}, #{typeId,jdbcType=BIGINT}, + #{name,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, + #{phone,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR}, + #{area,jdbcType=FLOAT}, #{district,jdbcType=VARCHAR}, + #{address,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR}, + #{disabled,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, + #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT} + ) + </insert> + <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaClient"> + <!--@mbg.generated--> + insert into ba_client + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null"> + id, + </if> + <if test="countyId != null"> + countyId, + </if> + <if test="townId != null"> + townId, + </if> + <if test="villageId != null"> + villageId, + </if> + <if test="divideId != null"> + divideId, + </if> + <if test="blockId != null"> + blockId, + </if> + <if test="typeId != null"> + typeId, + </if> + <if test="name != null"> + `name`, + </if> + <if test="num != null"> + num, + </if> + <if test="phone != null"> + phone, + </if> + <if test="idcard != null"> + idCard, + </if> + <if test="area != null"> + area, + </if> + <if test="district != null"> + district, + </if> + <if test="address != null"> + address, + </if> + <if test="remark != null"> + remark, + </if> + <if test="disabled != null"> + disabled, + </if> + <if test="deleted != null"> + deleted, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null"> + #{id,jdbcType=BIGINT}, + </if> + <if test="countyId != null"> + #{countyId,jdbcType=BIGINT}, + </if> + <if test="townId != null"> + #{townId,jdbcType=BIGINT}, + </if> + <if test="villageId != null"> + #{villageId,jdbcType=BIGINT}, + </if> + <if test="divideId != null"> + #{divideId,jdbcType=BIGINT}, + </if> + <if test="blockId != null"> + #{blockId,jdbcType=BIGINT}, + </if> + <if test="typeId != null"> + #{typeId,jdbcType=BIGINT}, + </if> + <if test="name != null"> + #{name,jdbcType=VARCHAR}, + </if> + <if test="num != null"> + #{num,jdbcType=INTEGER}, + </if> + <if test="phone != null"> + #{phone,jdbcType=VARCHAR}, + </if> + <if test="idcard != null"> + #{idcard,jdbcType=VARCHAR}, + </if> + <if test="area != null"> + #{area,jdbcType=FLOAT}, + </if> + <if test="district != null"> + #{district,jdbcType=VARCHAR}, + </if> + <if test="address != null"> + #{address,jdbcType=VARCHAR}, + </if> + <if test="remark != null"> + #{remark,jdbcType=VARCHAR}, + </if> + <if test="disabled != null"> + #{disabled,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, + </if> + <if test="deleted != null"> + #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoBa.BaClient"> + update ba_client + <trim prefix="set " suffixOverrides=","> + <if test="countyId != null"> + countyId = #{countyId,jdbcType=BIGINT}, + </if> + <if test="townId != null"> + townId = #{townId,jdbcType=BIGINT}, + </if> + <if test="villageId != null"> + villageId = #{villageId,jdbcType=BIGINT}, + </if> + <if test="divideId != null"> + divideId = #{divideId,jdbcType=BIGINT}, + </if> + <if test="blockId != null"> + blockId = #{blockId,jdbcType=BIGINT}, + </if> + <if test="typeId != null"> + typeId = #{typeId,jdbcType=BIGINT}, + </if> + <if test="name != null"> + 'name' = #{name,jdbcType=VARCHAR}, + </if> + <if test="num != null"> + num = #{num,jdbcType=INTEGER}, + </if> + <if test="phone != null"> + phone = #{phone,jdbcType=VARCHAR}, + </if> + <if test="idcard != null"> + idcard = #{idcard,jdbcType=VARCHAR}, + </if> + <if test="area != null"> + area = #{area,jdbcType=FLOAT}, + </if> + <if test="district != null"> + district = #{district,jdbcType=VARCHAR}, + </if> + <if test="address != null"> + address = #{address,jdbcType=VARCHAR}, + </if> + <if test="remark != null"> + remark = #{remark,jdbcType=VARCHAR}, + </if> + <if test="disabled != null"> + disabled = #{disabled,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, + </if> + <if test="deleted != null"> + deleted = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, + </if> + </trim> + where id = #{id,jdbcType=BIGINT} + </update> + + <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoBa.BaClient"> + update ba_client + <trim prefix="set " suffixOverrides=","> + countyId = #{countyId,jdbcType=BIGINT}, + townId = #{townId,jdbcType=BIGINT}, + villageId = #{villageId,jdbcType=BIGINT}, + divideId = #{divideId,jdbcType=BIGINT}, + blockId = #{blockId,jdbcType=BIGINT}, + typeId = #{typeId,jdbcType=BIGINT}, + `name` = #{name,jdbcType=VARCHAR}, + num = #{num,jdbcType=INTEGER}, + phone = #{phone,jdbcType=VARCHAR}, + idcard = #{idcard,jdbcType=VARCHAR}, + area = #{area,jdbcType=FLOAT}, + district = #{district,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + disabled = #{disabled,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, + deleted = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, + </trim> + where id = #{id,jdbcType=BIGINT} + </update> + + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> + <!--@mbg.generated--> + delete from ba_client + where id = #{id,jdbcType=BIGINT} + </delete> + <delete id="deleteLogicById" parameterType="java.lang.Long"> + <!--@mbg.generated--> + update ba_client set deleted = 1 + where id = #{id,jdbcType=BIGINT} + </delete> + </mapper> \ No newline at end of file -- Gitblit v1.8.0