• 双向表-dao+sql


    package com.lzl.dao;

    import java.util.List;

    import org.apache.ibatis.annotations.Param;

    import com.lzl.pojo.Mingxi;
    import com.lzl.pojo.Wuliao;

    public interface MingxiDao {

    List<Mingxi> select( @Param("ctime1")String ctime1, @Param("ctime2")String ctime2, @Param("cqid")String cqid,@Param("cname") String cname,@Param("ctel") String ctel);

    void addWuliao(Wuliao wuliao);

    void addMingxi(Mingxi mingxi);

    }

    ----------------------------------sql

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    <mapper namespace="com.lzl.dao.MingxiDao">


    <select id="select" resultType="Mingxi">

    select * from mingxi

    <where>
    <if test="ctime1!=null and ctime1!=''"> and time &gt;= #{ctime1}</if>
    <if test="ctime2!=null and ctime2!=''"> and time &gt;= #{ctime2}</if>
    <if test="cname!=null and cname!=''"> no like '%${cname}%'</if>
    <if test="ctel!=null and ctel!=''"> no like '%${ctel}%'</if>

    </where>

    </select>
    <insert id="addMingxi">

    INSERT INTO `zuoye524`.`mingxi` (`id`, `time`, `qid`, `name`, `tel`)
    VALUES (null, #{time},#{qid}, #{name}, #{tel});


    </insert>
    <insert id="addWuliao">

    INSERT INTO `zuoye524`.`wuliao` (`id`, `name`, `guige`, `danwei`, `price`, `beizhu`)
    VALUES (null, #{name}, #{guige}, #{danwei}, #{price}, #{beizhu});


    </insert>

    </mapper>

  • 相关阅读:
    HDU-5980
    HDU-5974
    HDU-5979
    关于position的定位
    javascript学习笔记w3chool
    表单相关css技巧
    fis压缩工具的使用
    将HTML页面内容存入json数组
    中介PHP连接前台HTML与数据库MySQL
    lesscss的使用
  • 原文地址:https://www.cnblogs.com/liuzhaolong/p/12971441.html
Copyright © 2020-2023  润新知