Non-executable SQL statement for "database _postgresql" entity class mapping problem

Source: Internet
Author: User

Background controller to DAO is no problem, the foreground page receives an entity class object, the service layer is also the object, the incoming mapper inside is also the object, no map, but the print table does not execute the SQL statement, there is no obvious error hint.

Finally find the reason, post the original SQL statement and the successful execution of the SQL statement, you can see the alias and if test after the judgment is removed can be executed. Specifically because the alias or if test interested friends can test, I will not try.

The original code

<select id= "Querybyprimarykey" parametertype= "java.lang.String" resulttype= " Com.suneee.scn.chtpub.wms.model.DictionaryDO ">         Select                dictionarycode as Dictionarycode,                Dictionaryname as Dictionaryname,                NextValue as NextValue,                Mark as Mark         from                sp_wms_dictionary          WHERE                1 = 1<if test= "Dictionarycode!=null and  dictionarycode! =" ">               = #{dictionarycode,jdbctype=VARCHAR}        </if>           </select>

Now the code:

<select id= "Querybyprimarykey" parametertype= "java.lang.String" resulttype= " Com.suneee.scn.chtpub.wms.model.DictionaryDO ">         Select                dictionarycode,                dictionaryname,                NextValue,                Mark         from                sp_wms_dictionary          WHERE                1 = 1    and = #{ Dictionarycode,jdbctype=VARCHAR}           </select>

Non-executable SQL statement for "database _postgresql" entity class mapping problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.