liurunyu
2023-11-16 437713ee567f25c04f094057a1908b6dc54eeefd
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaClientMapper.xml
@@ -33,6 +33,84 @@
    disabled
  </sql>
  <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,
@@ -161,4 +239,93 @@
      </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>