zoukankan      html  css  js  c++  java
  • 双向表-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>

  • 相关阅读:
    ios 学习小笔记
    object c 2.0 @property属性
    uiPickerView 滚动盘
    ios 文件操作
    ios多窗体项目
    Linux命令
    Mina的使用
    设计模式学习总结访问者模式(Visitor Method)
    socket, nio socket 及nio socket框架MINA总结
    UML类图与类的关系详解UML一波流系列(转转)
  • 原文地址:https://www.cnblogs.com/liuzhaolong/p/12971441.html
Copyright © 2011-2022 走看看