后端开发技巧(三)

后端开发技巧(三)

1.在postgre SQL 中 如何对单列元素去重

    <select id="selectSatellite" parameterType="java.util.Map" resultType="java.util.Map">
        select distinct on (satellite) id, satellite from   sar_satellite_image_dic
        where 1=1
    </select>

2. 对于前端的任何 下拉框 都应该写查询,使其动态的变化,传递回来的数据为id。

  <select id="select" parameterType="java.util.Map" resultType="java.util.Map">
        select id,image_mode "imageMode" from   sar_dic
        where 1=1
        <if test="satelliteCode!=null and satelliteCode!=''">
            and satellite=#{satelliteCode}
        </if>
    </select>

3. 最新型的 sql中 已经不再建立外键,采取左连接的方式,对数据进行聚合

4. 整理清楚业务,在进行写代码 重要重要重要

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值