码迷,mamicode.com
首页 > 数据库 > 详细

sql的插入或者修改

时间:2018-01-27 22:21:35      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:sys   pre   res   pos   修改   param   cat   date   photo   

<select id="insertOrUpdateTenantDetail" parameterType="tenantDetailDO">
  	INSERT INTO tenant_detail
    (tenant_id,province_id,city_id,zone_id,address,marry,education,political_visage,
    	industry,company_name,photo_img,remark,province_name,city_name,zone_name,gmt_create,created_by,gmt_last_update,last_updated_by) 
      VALUES 
     (#{tenantId},#{provinceId},#{cityId},#{zoneId},#{address},#{marry},#{education},#{politicalVisage},
     	#{industry},#{companyName},#{photoImg},#{remark},#{provinceName},#{cityName},#{zoneName},SYSDATE(),#{createdBy},SYSDATE(),#{lastUpdatedBy})
     ON DUPLICATE KEY 
	 UPDATE 
	province_id=#{provinceId},
        city_id=#{cityId},
        zone_id=#{zoneId},
        address=#{address},
        marry=#{marry},
        education=#{education},
        political_visage=#{politicalVisage},
        industry=#{industry},
        company_name=#{companyName},
        photo_img=#{photoImg},
        remark=#{remark},
        province_name=#{provinceName},
      	city_name=#{cityName},
      	zone_name=#{zoneName},
        gmt_last_update=SYSDATE(),
        last_updated_by=#{lastUpdatedBy}
  </select>

  

sql的插入或者修改

标签:sys   pre   res   pos   修改   param   cat   date   photo   

原文地址:https://www.cnblogs.com/TerLeeHost/p/8367203.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!